diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go index d19c047ca6..07b0c2842a 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go @@ -32,6 +32,6 @@ func TestLoadDefaultServiceAccountConfig(t *testing.T) { t.Run("serviceAccount", func(t *testing.T) { config := GetConfig() - assert.Equal(t, config.ServiceAccount, "default") + assert.Equal(t, config.ServiceAccount, "") }) } diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go index 95a87f4efa..9b10719033 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go @@ -190,7 +190,7 @@ func constructRayJob(taskCtx pluginsCore.TaskExecutionContext, rayJob plugins.Ra } serviceAccountName := flytek8s.GetServiceAccountNameFromTaskExecutionMetadata(taskCtx.TaskExecutionMetadata()) - if len(serviceAccountName) == 0 { + if len(serviceAccountName) == 0 || cfg.ServiceAccount != "" { serviceAccountName = cfg.ServiceAccount }