mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(ecs): reject negative desiredCount in CreateService and UpdateService (#1409)
This commit is contained in:
1 parent
dbad78991d
commit
16b58b99c1
2 files changed
+70
No files matched your search
@@ -590,6 +590,9 @@ public class EcsService {
|
||||
svc.setClusterArn(cluster.getClusterArn());
|
||||
svc.setTaskDefinition(taskDefinition);
|
||||
svc.setLaunchType(launchType != null ? launchType : LaunchType.FARGATE);
|
||||
if (desiredCount < 0) {
|
||||
throw new AwsException("InvalidParameterException", "desiredCount cannot be a negative number.", 400);
|
||||
}
|
||||
svc.setDesiredCount(desiredCount);
|
||||
svc.setLoadBalancers(loadBalancers);
|
||||
svc.setNetworkConfiguration(networkConfiguration);
|
||||
@@ -623,6 +626,9 @@ public class EcsService {
|
||||
"Service " + serviceName + " is not active.", 400);
|
||||
}
|
||||
if (desiredCount != null) {
|
||||
if (desiredCount < 0) {
|
||||
throw new AwsException("InvalidParameterException", "desiredCount cannot be a negative number.", 400);
|
||||
}
|
||||
svc.setDesiredCount(desiredCount);
|
||||
}
|
||||
if (networkConfiguration != null) {
|
||||
|
||||
Reference in new issue
Block a user