Skip to content

Commit

Permalink
Resloved conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: win5923 <[email protected]>
  • Loading branch information
win5923 committed Jan 17, 2025
1 parent a1fdb1a commit 5cadced
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 182 deletions.
3 changes: 3 additions & 0 deletions ray-operator/controllers/ray/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ func configureGCSFaultTolerance(podTemplate *corev1.PodTemplateSpec, instance ra
})
}
} else {
// If users directly set the `redis-username` in `rayStartParams` instead of referring
// to a K8s secret, we need to set the `REDIS_USERNAME` env var so that the Redis cleanup
// job can connect to Redis using the username.
if !utils.EnvVarExists(utils.REDIS_USERNAME, container.Env) {
// setting the REDIS_USERNAME env var from the params
redisUsernameEnv := corev1.EnvVar{Name: utils.REDIS_USERNAME}
Expand Down
8 changes: 7 additions & 1 deletion ray-operator/controllers/ray/common/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ func TestConfigureGCSFaultToleranceWithAnnotations(t *testing.T) {
isHeadPod: false,
},
{
// The most common case.
name: "GCS FT enabled with redis username and password env and ray start params referring to env",
gcsFTEnabled: true,
redisUsernameEnv: "test-username",
Expand All @@ -389,6 +388,9 @@ func TestConfigureGCSFaultToleranceWithAnnotations(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
// Validate the test input
if test.redisUsernameEnv != "" && test.redisUsernameRayStartParams != "" {
assert.True(t, test.redisUsernameRayStartParams == "$REDIS_USERNAME")
}
if test.redisPasswordEnv != "" && test.redisPasswordRayStartParams != "" {
assert.True(t, test.redisPasswordRayStartParams == "$REDIS_PASSWORD")
}
Expand Down Expand Up @@ -475,6 +477,10 @@ func TestConfigureGCSFaultToleranceWithAnnotations(t *testing.T) {
assert.Equal(t, podTemplate.Annotations[utils.RayExternalStorageNSAnnotationKey], test.storageNS)
assert.True(t, utils.EnvVarExists(utils.RAY_EXTERNAL_STORAGE_NS, container.Env))
}
if test.redisUsernameEnv != "" {
env := getEnvVar(container, utils.REDIS_USERNAME)
assert.Equal(t, env.Value, test.redisUsernameEnv)
}
if test.redisPasswordEnv != "" {
env := getEnvVar(container, utils.REDIS_PASSWORD)
assert.Equal(t, env.Value, test.redisPasswordEnv)
Expand Down
181 changes: 0 additions & 181 deletions ray-operator/ray-cluster.external-redis.yaml

This file was deleted.

0 comments on commit 5cadced

Please sign in to comment.