Skip to content

Commit dd55c2c

Browse files
author
Benjamin Sergeant
committed
/etc/redis_password -> /data/redis_password
1 parent 7494848 commit dd55c2c

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
@@ -260,7 +260,7 @@ func redisServerContainer(cluster *redisv1alpha1.DistributedRedisCluster, passwo
260260
Lifecycle: &corev1.Lifecycle{
261261
PostStart: &corev1.Handler{
262262
Exec: &corev1.ExecAction{
263-
Command: []string{"/bin/sh", "-c", "echo ${REDIS_PASSWORD} > /etc/redis_password"},
263+
Command: []string{"/bin/sh", "-c", "echo ${REDIS_PASSWORD} > /data/redis_password"},
264264
},
265265
},
266266
PreStop: &corev1.Handler{

0 commit comments

Comments
 (0)