Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/controller/distributedrediscluster/sync_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ func (r *ReconcileDistributedRedisCluster) resetClusterPassword(ctx *syncContext
}
defer admin.Close()

// Update the password recorded in the file /etc/redis_password, redis pod preStop hook
// need /etc/redis_password do CLUSTER FAILOVER
cmd := fmt.Sprintf("echo %s > /etc/redis_password", newPassword)
// Update the password recorded in the file /data/redis_password, redis pod preStop hook
// need /data/redis_password do CLUSTER FAILOVER
cmd := fmt.Sprintf("echo %s > /data/redis_password", newPassword)
if err := r.execer.ExecCommandInPodSet(podSet, "/bin/sh", "-c", cmd); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/configmaps/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ failover() {
echo "Master: ${masterID}"
slave=$(cat ${CLUSTER_CONFIG} | grep ${masterID} | grep "slave" | awk 'NR==1{print $2}' | sed 's/:6379@16379//')
echo "Slave: ${slave}"
password=$(cat /etc/redis_password)
password=$(cat /data/redis_password)
if [[ -z "${password}" ]]; then
redis-cli -h ${slave} CLUSTER FAILOVER
else
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/statefulsets/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func redisServerContainer(cluster *redisv1alpha1.DistributedRedisCluster, passwo
Lifecycle: &corev1.Lifecycle{
PostStart: &corev1.Handler{
Exec: &corev1.ExecAction{
Command: []string{"/bin/sh", "-c", "echo ${REDIS_PASSWORD} > /etc/redis_password"},
Command: []string{"/bin/sh", "-c", "echo ${REDIS_PASSWORD} > /data/redis_password"},
},
},
PreStop: &corev1.Handler{
Expand Down