Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: byhsu <[email protected]>
  • Loading branch information
ByronHsu committed Feb 2, 2023
1 parent e54baf9 commit 01b10c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
5 changes: 2 additions & 3 deletions flytekit/core/python_auto_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
- `Confidant <https://lyft.github.io/confidant/>`__
- `Kube secrets <https://kubernetes.io/docs/concepts/configuration/secret/>`__
- `AWS Parameter store <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html>`__
:param pod_template: custom PodTemplate.
:param pod_template: Custom PodTemplate for this task.
:param pod_template_name: The name of the existing PodTemplate resource which will be used in this task.
"""
sec_ctx = None
Expand Down Expand Up @@ -178,8 +178,7 @@ def get_command(self, settings: SerializationSettings) -> List[str]:
return self._get_command_fn(settings)

def get_container(self, settings: SerializationSettings) -> _task_model.Container:
# if pod_template exists, return None
# but in get_k8s_pod, return pod_template merged with container
# if pod_template is not None, return None here but in get_k8s_pod, return pod_template merged with container
if self.pod_template is not None:
return None
else:
Expand Down
2 changes: 1 addition & 1 deletion flytekit/core/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def foo2():
:param task_resolver: Provide a custom task resolver.
:param disable_deck: If true, this task will not output deck html file
:param docs: Documentation about this task
:param pod_template: custom PodTemplate.
:param pod_template: Custom PodTemplate for this task.
:param pod_template_name: The name of the existing PodTemplate resource which will be used in this task.
"""

Expand Down
1 change: 0 additions & 1 deletion flytekit/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ def pod_template_name(self):
The name of the existing PodTemplate resource which will be used in this task.
:rtype: Text
"""
# TODO: comment
return self._pod_template_name

def to_flyte_idl(self):
Expand Down
6 changes: 1 addition & 5 deletions tests/flytekit/unit/core/test_python_auto_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_pod_template(default_serialization_settings):
assert pod_spec["volumes"][0] == {"name": "volume"}

#################
# Test pod_teamplte_name
# Test pod_template_name
#################
assert task_with_pod_template.metadata.pod_template_name == "podTemplateA"
assert task_with_pod_template.metadata.retries == 3
Expand Down Expand Up @@ -233,7 +233,6 @@ def test_pod_template(default_serialization_settings):
primary_container_name="primary",
labels={"lKeyA": "lValA"},
annotations={"aKeyA": "aValA"},
pod_spec=V1PodSpec(volumes=[V1Volume(name="volume")], containers=[]),
),
pod_template_name="A",
)
Expand Down Expand Up @@ -280,9 +279,6 @@ def test_minimum_pod_template(default_serialization_settings):
"task_with_minimum_pod_template",
]

volume = k8s_pod.pod_spec["volumes"][0]
assert volume == {"name": "volume"}

config = task_with_minimum_pod_template.get_config(default_serialization_settings)
assert config == {"primary_container_name": "primary"}

Expand Down

0 comments on commit 01b10c0

Please sign in to comment.