<#3613 [BUG] Setting service_account_name in task ...
# flyte-github
a
#3613 [BUG] Setting service_account_name in task PodTemplate does not work Issue created by hamersaw Describe the bug Creating a task with the definition:
Copy code
@task(
        pod_template=PodTemplate(
            pod_spec=V1PodSpec(
                service_account_name="trainer-service",
                containers=[],
    )
attempts to manually set the service account of the k8s
Pod
to
trainer-service
. However, the result is that Flyte overrides this variable, setting the service account to 'default' (by default). This seems to be because the
PodPlugin
always overrides the
ServiceAccount
in this logic. However, previous implementation first checked if the
ServiceAccount
was empty first. The latter seems to be the correct implementation. Expected behavior Users should be able to override the k8s
Pod
service account using the
PodTemplate
. Additional context to reproduce Create a task with a service account, run it, and note the manually set service account is overridden. Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte