<#5220 [BUG] `PythonAutoContainerTask.get_k8s_pod(...
# flytekit
a
#5220 [BUG] `PythonAutoContainerTask.get_k8s_pod()` fails if `pod_template` has no container image and `ImageConfig` has no default Issue created by Tom-Newton Describe the bug The following code fails
Copy code
@task(container_image="<http://random-cr.io/0:fake-tag|random-cr.io/0:fake-tag>", pod_template=create_empty_pod_template())
def empty_task():
    pass

empty_task.get_k8s_pod(SerializationSettings(
    project="p", domain="d", version="v", image_config=ImageConfig(None, None),
))
Copy code
│ /home/tomnewton/.cache/bazel/_bazel_tomnewton/42c16ffd77e5609f5305655cb167357d/execroot/WayveCode/bazel-out/k8-opt/bin/wayve/services/data/pipelines/flyte/common/test.runfiles/WayveCode/wayve/services/data/pipelines/flyte/common/test.py:11 in <module>                   │
│                                                                                                                                                                                                                                                                               │
│ ❱ 11 empty_task.get_k8s_pod(                                                                                                                                                                                                                                                  │
│                                                                                                                                                                                                                                                                               │
│ /home/tomnewton/.cache/bazel/_bazel_tomnewton/42c16ffd77e5609f5305655cb167357d/execroot/WayveCode/bazel-out/k8-opt/bin/wayve/services/data/pipelines/flyte/common/test.runfiles/pip-svc_flytekit/site-packages/flytekit/core/python_auto_container.py:213 in get_k8s_pod      │
│                                                                                                                                                                                                                                                                               │
│ ❱ 213 │   │   │   pod_spec=_serialize_pod_spec(self.pod_template, self._get_container(settings                                                                                                                                                                                │
│                                                                                                                                                                                                                                                                               │
│ /home/tomnewton/.cache/bazel/_bazel_tomnewton/42c16ffd77e5609f5305655cb167357d/execroot/WayveCode/bazel-out/k8-opt/bin/wayve/services/data/pipelines/flyte/common/test.runfiles/pip-svc_flytekit/site-packages/flytekit/core/utils.py:167 in _serialize_pod_spec              │
│                                                                                                                                                                                                                                                                               │
│ ❱ 167 │   │   resolved_image = get_registerable_container_image(container.image, settings.imag                                                                                                                                                                                │
│                                                                                                                                                                                                                                                                               │
│ /home/tomnewton/.cache/bazel/_bazel_tomnewton/42c16ffd77e5609f5305655cb167357d/execroot/WayveCode/bazel-out/k8-opt/bin/wayve/services/data/pipelines/flyte/common/test.runfiles/pip-svc_flytekit/site-packages/flytekit/core/python_auto_container.py:307 in                  │
│ get_registerable_container_image                                                                                                                                                                                                                                              │
│                                                                                                                                                                                                                                                                               │
│ ❱ 307 │   │   raise ValueError("An image is required for PythonAutoContainer tasks")                                                                                                                                                                                          │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: An image is required for PythonAutoContainer tasks
Expected behavior
container_image
is set so it should not try to derive the
container_image
from the
container.image
in the
pod_template
. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte