<#3590 [BUG] Wrong primary container name when usi...
# flyte-github
a
#3590 [BUG] Wrong primary container name when using pod template breaks PytorchJob Issue created by fg91 Describe the bug When creating a task with such a pod template passed to
@task
...
Copy code
PodTemplate(
    pod_spec = V1PodSpec(
        containers=[],
        tolerations=[
            V1Toleration(<some toleration>)
        ],
        node_selector=<some nodeselector>
    )
)
... such a Pod is created:
Copy code
apiVersion: v1
kind: Pod
...
spec:
  containers:
  - image: ...
    name: primary
  nodeSelector:
    <some nodeselector>
  tolerations:
  - <some toleration>
The nodeselector and toleration is applied correctly but the primary container name is
primary
instead of the typical task id. For a normal task running in a single Pod, the container name doesn't really matter. However, this leads to problems e.g. with PytorchJobs for which the primary container name is expected to be
pytorch
. Here, a typical task id-based container name would be replaced with
pytorch
, the string
primary
is not. Expected behavior Here, the container name in
target.K8SPod.PodSpec
should not be
primary
. If this were the case, it would correctly be replaced with
pytorch
here. 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