Merge pull request #3147 from bblommers/enhancement/3139
ECS - UpdateService - Allow service ARN to be passed in
This commit is contained in:
commit
41427a78b6
@ -1028,9 +1028,10 @@ class EC2ContainerServiceBackend(BaseBackend):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def update_service(
|
def update_service(
|
||||||
self, cluster_str, service_name, task_definition_str, desired_count
|
self, cluster_str, service_str, task_definition_str, desired_count
|
||||||
):
|
):
|
||||||
cluster_name = cluster_str.split("/")[-1]
|
cluster_name = cluster_str.split("/")[-1]
|
||||||
|
service_name = service_str.split("/")[-1]
|
||||||
cluster_service_pair = "{0}:{1}".format(cluster_name, service_name)
|
cluster_service_pair = "{0}:{1}".format(cluster_name, service_name)
|
||||||
if cluster_service_pair in self.services:
|
if cluster_service_pair in self.services:
|
||||||
if task_definition_str is not None:
|
if task_definition_str is not None:
|
||||||
|
@ -660,6 +660,15 @@ def test_update_service():
|
|||||||
response["service"]["desiredCount"].should.equal(0)
|
response["service"]["desiredCount"].should.equal(0)
|
||||||
response["service"]["schedulingStrategy"].should.equal("REPLICA")
|
response["service"]["schedulingStrategy"].should.equal("REPLICA")
|
||||||
|
|
||||||
|
# Verify we can pass the ARNs of the cluster and service
|
||||||
|
response = client.update_service(
|
||||||
|
cluster=response["service"]["clusterArn"],
|
||||||
|
service=response["service"]["serviceArn"],
|
||||||
|
taskDefinition="test_ecs_task",
|
||||||
|
desiredCount=1,
|
||||||
|
)
|
||||||
|
response["service"]["desiredCount"].should.equal(1)
|
||||||
|
|
||||||
|
|
||||||
@mock_ecs
|
@mock_ecs
|
||||||
def test_update_missing_service():
|
def test_update_missing_service():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user