Skip to content

Commit

Permalink
Merge branch 'hotfix/1.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fabfuel committed Apr 20, 2022
2 parents 7849762 + 567d087 commit c84304e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ecs_deploy/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.13.0'
VERSION = '1.13.1'
12 changes: 9 additions & 3 deletions ecs_deploy/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,21 @@ def register_task_definition(self, family, containers, volumes, role_arn,
if tags:
additional_properties['tags'] = tags

if cpu:
additional_properties['cpu'] = cpu

if memory:
additional_properties['memory'] = memory

if runtime_platform:
additional_properties['runtimePlatform'] = runtime_platform

return self.boto.register_task_definition(
family=family,
containerDefinitions=containers,
volumes=volumes,
taskRoleArn=role_arn,
executionRoleArn=execution_role_arn,
runtimePlatform=runtime_platform,
cpu=cpu,
memory=memory,
**additional_properties
)

Expand Down
44 changes: 44 additions & 0 deletions tests/test_ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,50 @@ def test_client_register_task_definition(client):
)


def test_client_register_task_definition_without_optional_values(client):
containers = [{u'name': u'foo'}]
volumes = [{u'foo': u'bar'}]
role_arn = 'arn:test:role'
execution_role_arn = 'arn:test:role'
runtime_platform = {u'cpuArchitecture': u'X86_64', u'operatingSystemFamily': u'LINUX'}
task_definition = EcsTaskDefinition(
containerDefinitions=containers,
volumes=volumes,
family=u'family',
revision=1,
taskRoleArn=role_arn,
executionRoleArn=execution_role_arn,
tags={
'Name': 'test_client_register_task_definition'
},
status='active',
taskDefinitionArn='arn:task',
requiresAttributes={},
)

client.register_task_definition(
family=task_definition.family,
containers=task_definition.containers,
volumes=task_definition.volumes,
role_arn=task_definition.role_arn,
execution_role_arn=execution_role_arn,
tags=task_definition.tags,
additional_properties=task_definition.additional_properties,
runtime_platform=None,
cpu=None,
memory=None
)

client.boto.register_task_definition.assert_called_once_with(
family=u'family',
containerDefinitions=containers,
volumes=volumes,
taskRoleArn=role_arn,
executionRoleArn=execution_role_arn,
tags=task_definition.tags,
)


def test_client_register_task_definition_without_tags(client):
containers = [{u'name': u'foo'}]
volumes = [{u'foo': u'bar'}]
Expand Down

0 comments on commit c84304e

Please sign in to comment.