Skip to content

Commit

Permalink
feat(ecs): Add support for ECS deployment circuit breaker (#6132)
Browse files Browse the repository at this point in the history
* feat(ecs): Add support for ECS deployment circuit breaker

* ffeat(ecs): Formatting of code

* feat(ecs): remove unnecessary lines of code, oriented at enableExecuteCommand

* fix(ecs): used wrong syntax to test for enabled deploymentCircuitBreaker

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
jgrumboe and mergify[bot] authored Jan 16, 2024
1 parent ae2e202 commit 3a1e81b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public class CreateServerGroupDescription extends AbstractECSDescription {
String taskDefinitionArtifactAccount;
Map<String, String> containerToImageMap;
boolean enableExecuteCommand;
boolean enableDeploymentCircuitBreaker;

/**
* @deprecated this field only allows for one container to be specified. ECS supports the ability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ protected CreateServiceRequest makeServiceRequest(
DeploymentConfiguration deploymentConfiguration =
new DeploymentConfiguration().withMinimumHealthyPercent(100).withMaximumPercent(200);

DeploymentCircuitBreaker deploymentCircuitBreaker =
new DeploymentCircuitBreaker()
.withEnable(description.isEnableDeploymentCircuitBreaker())
.withRollback(false);
deploymentConfiguration.setDeploymentCircuitBreaker(deploymentCircuitBreaker);

CreateServiceRequest request =
new CreateServiceRequest()
.withServiceName(newServerGroupName.getServiceName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class CreateServerGroupAtomicOperationSpec extends CommonAtomicOperation {
request.launchType == null
request.platformVersion == null
request.enableExecuteCommand == false
request.deploymentConfiguration.deploymentCircuitBreaker.enable == false
}) >> new CreateServiceResult().withService(service)

result.getServerGroupNames().size() == 1
Expand Down Expand Up @@ -246,7 +247,8 @@ class CreateServerGroupAtomicOperationSpec extends CommonAtomicOperation {
securityGroupNames: ['helloworld'],
associatePublicIpAddress: true,
serviceDiscoveryAssociations: [serviceRegistry],
enableExecuteCommand: true
enableExecuteCommand: true,
enableDeploymentCircuitBreaker: true
)

def operation = new CreateServerGroupAtomicOperation(description)
Expand Down Expand Up @@ -311,6 +313,7 @@ class CreateServerGroupAtomicOperationSpec extends CommonAtomicOperation {
request.launchType == 'FARGATE'
request.platformVersion == '1.0.0'
request.enableExecuteCommand == true
request.deploymentConfiguration.deploymentCircuitBreaker.enable == true
} as CreateServiceRequest) >> new CreateServiceResult().withService(service)

result.getServerGroupNames().size() == 1
Expand Down

0 comments on commit 3a1e81b

Please sign in to comment.