Skip to content

Commit cb8f12e

Browse files
authored
Merge pull request #50 from bsergean/feature/openshift-password-pb
Operator not working on OpenShift
2 parents d9debd9 + dd55c2c commit cb8f12e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/controller/distributedrediscluster/sync_handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,9 @@ func (r *ReconcileDistributedRedisCluster) resetClusterPassword(ctx *syncContext
352352
}
353353
defer admin.Close()
354354

355-
// Update the password recorded in the file /etc/redis_password, redis pod preStop hook
356-
// need /etc/redis_password do CLUSTER FAILOVER
357-
cmd := fmt.Sprintf("echo %s > /etc/redis_password", newPassword)
355+
// Update the password recorded in the file /data/redis_password, redis pod preStop hook
356+
// need /data/redis_password do CLUSTER FAILOVER
357+
cmd := fmt.Sprintf("echo %s > /data/redis_password", newPassword)
358358
if err := r.execer.ExecCommandInPodSet(podSet, "/bin/sh", "-c", cmd); err != nil {
359359
return err
360360
}

pkg/resources/configmaps/configmap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ failover() {
2929
echo "Master: ${masterID}"
3030
slave=$(cat ${CLUSTER_CONFIG} | grep ${masterID} | grep "slave" | awk 'NR==1{print $2}' | sed 's/:6379@16379//')
3131
echo "Slave: ${slave}"
32-
password=$(cat /etc/redis_password)
32+
password=$(cat /data/redis_password)
3333
if [[ -z "${password}" ]]; then
3434
redis-cli -h ${slave} CLUSTER FAILOVER
3535
else

pkg/resources/statefulsets/statefulset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func redisServerContainer(cluster *redisv1alpha1.DistributedRedisCluster, passwo
287287
Lifecycle: &corev1.Lifecycle{
288288
PostStart: &corev1.Handler{
289289
Exec: &corev1.ExecAction{
290-
Command: []string{"/bin/sh", "-c", "echo ${REDIS_PASSWORD} > /etc/redis_password"},
290+
Command: []string{"/bin/sh", "-c", "echo ${REDIS_PASSWORD} > /data/redis_password"},
291291
},
292292
},
293293
PreStop: &corev1.Handler{

0 commit comments

Comments
 (0)