Skip to content

Commit

Permalink
Ray Plugin - Use serviceAccount from Config if set (flyteorg#5928)
Browse files Browse the repository at this point in the history
* Fix YAML (flyteorg#5917)

Signed-off-by: davidmirror-ops <[email protected]>
Signed-off-by: e356161 <[email protected]>

* make change

Signed-off-by: e356161 <[email protected]>

* update tests

Signed-off-by: e356161 <[email protected]>

* revert change

---------

Signed-off-by: davidmirror-ops <[email protected]>
Signed-off-by: e356161 <[email protected]>
Co-authored-by: David Espejo <[email protected]>
  • Loading branch information
peterghaddad and davidmirror-ops authored Nov 11, 2024
1 parent 5d5bbe8 commit be67457
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/k8s/ray/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
IncludeDashboard: true,
DashboardHost: "0.0.0.0",
EnableUsageStats: false,
ServiceAccount: "default",
ServiceAccount: "",
Defaults: DefaultConfig{
HeadNode: NodeConfig{
StartParameters: map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/k8s/ray/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
})
}
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/k8s/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit be67457

Please sign in to comment.