Skip to content

Commit

Permalink
enable ray external storage namespace (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonwang371 authored Jul 25, 2022
1 parent 2826b10 commit d2e79f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ray-operator/controllers/ray/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ func setContainerEnvVars(pod *v1.Pod, rayContainerIndex int, rayNodeType rayiov1
}
container.Env = append(container.Env, port)
}
if !envVarExists(RAY_EXTERNAL_STORAGE_NS, container.Env) {
// setting the RAY_EXTERNAL_STORAGE_NS env var from the params
if pod.Annotations != nil {
if v, ok := pod.Annotations[RayExternalStorageNSAnnotationKey]; ok {
storageNS := v1.EnvVar{Name: RAY_EXTERNAL_STORAGE_NS, Value: v}
container.Env = append(container.Env, storageNS)
}
}
}
}

func envVarExists(envName string, envVars []v1.EnvVar) bool {
Expand Down

0 comments on commit d2e79f4

Please sign in to comment.