diff --git a/flytekit/__init__.py b/flytekit/__init__.py index 36d78a7b65..fa54203a57 100644 --- a/flytekit/__init__.py +++ b/flytekit/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import import flytekit.plugins -__version__ = '0.5.1' +__version__ = '0.5.2' diff --git a/flytekit/common/tasks/sidecar_task.py b/flytekit/common/tasks/sidecar_task.py index ef021cf562..18da551b3c 100644 --- a/flytekit/common/tasks/sidecar_task.py +++ b/flytekit/common/tasks/sidecar_task.py @@ -110,11 +110,11 @@ def reconcile_partial_pod_spec_and_task(self, resource_requirements = _lazy_k8s.io.api.core.v1.generated_pb2.ResourceRequirements() for resource in self._container.resources.limits: resource_requirements.limits[ - _core_task.Resources.ResourceName.Name(resource.name).lower()].CopyFrom( + _core_task.Resources.ResourceName.Name(resource.name)].CopyFrom( _lazy_k8s.io.apimachinery.pkg.api.resource.generated_pb2.Quantity(string=resource.value)) for resource in self._container.resources.requests: resource_requirements.requests[ - _core_task.Resources.ResourceName.Name(resource.name).lower()].CopyFrom( + _core_task.Resources.ResourceName.Name(resource.name)].CopyFrom( _lazy_k8s.io.apimachinery.pkg.api.resource.generated_pb2.Quantity(string=resource.value)) if resource_requirements.ByteSize(): # Important! Only copy over resource requirements if they are non-empty. diff --git a/tests/flytekit/unit/sdk/tasks/test_sidecar_tasks.py b/tests/flytekit/unit/sdk/tasks/test_sidecar_tasks.py index 65d9b4ea28..edbe15a221 100644 --- a/tests/flytekit/unit/sdk/tasks/test_sidecar_tasks.py +++ b/tests/flytekit/unit/sdk/tasks/test_sidecar_tasks.py @@ -61,7 +61,7 @@ def test_sidecar_task(): '{{.outputPrefix}}'] assert primary_container['volumeMounts'] == [{'mountPath': 'some/where', 'name': 'volume mount'}] assert {'name': 'foo', 'value': 'bar'} in primary_container['env'] - assert primary_container['resources'] == {'requests': {'cpu': {'string': '10'}}, - 'limits': {'gpu': {'string': '2'}}} + assert primary_container['resources'] == {'requests': {'CPU': {'string': '10'}}, + 'limits': {'GPU': {'string': '2'}}} assert pod_spec['containers'][1]['name'] == 'another container' assert simple_sidecar_task.custom['primaryContainerName'] == 'a container'