From c02d5a65e4e752eea8869b4c73e00acbaebd0022 Mon Sep 17 00:00:00 2001 From: teocns <59549574+teocns@users.noreply.github.com> Date: Mon, 6 May 2024 21:46:41 -0600 Subject: [PATCH] fix: runtime panic when `storage` param is empty (#887) * fix runtime panic when storage param is empty Signed-off-by: Teo * Update redis-cluster.go * remove blank * Update redis-cluster.go --------- Signed-off-by: Teo Co-authored-by: yangw --- k8sutils/redis-cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8sutils/redis-cluster.go b/k8sutils/redis-cluster.go index 8c182a20d..d16b9308c 100644 --- a/k8sutils/redis-cluster.go +++ b/k8sutils/redis-cluster.go @@ -38,7 +38,6 @@ func generateRedisClusterParams(cr *redisv1beta2.RedisCluster, replicas int32, e Replicas: &replicas, ClusterMode: true, ClusterVersion: cr.Spec.ClusterVersion, - NodeConfVolume: cr.Spec.Storage.NodeConfVolume, NodeSelector: params.NodeSelector, PodSecurityContext: cr.Spec.PodSecurityContext, PriorityClassName: cr.Spec.PriorityClassName, @@ -58,6 +57,7 @@ func generateRedisClusterParams(cr *redisv1beta2.RedisCluster, replicas int32, e } if cr.Spec.Storage != nil { res.PersistentVolumeClaim = cr.Spec.Storage.VolumeClaimTemplate + res.NodeConfVolume = cr.Spec.Storage.NodeConfVolume res.NodeConfPersistentVolumeClaim = cr.Spec.Storage.NodeConfVolumeClaimTemplate } if externalConfig != nil {