From c0a4f5c5edd7293f62c24117b44c5e5b14f84e07 Mon Sep 17 00:00:00 2001 From: Tanmay Jain Date: Tue, 7 May 2024 15:08:08 +0530 Subject: [PATCH] bug fix --- api/v1/aerospikecluster_validating_webhook.go | 6 +++--- controllers/configmap.go | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/v1/aerospikecluster_validating_webhook.go b/api/v1/aerospikecluster_validating_webhook.go index 7b12a700e..8d6478b0b 100644 --- a/api/v1/aerospikecluster_validating_webhook.go +++ b/api/v1/aerospikecluster_validating_webhook.go @@ -1341,7 +1341,7 @@ func validateSecurityContext( if !ivflag && ovflag { isSecurityEnabledPodExist, err := isSecurityEnabledPodExist(podStatus) if err != nil { - return fmt.Errorf("cannot disable cluster security in running cluster, %s", err.Error()) + return fmt.Errorf("cannot disable cluster security, %s", err.Error()) } if isSecurityEnabledPodExist { @@ -1353,8 +1353,8 @@ func validateSecurityContext( } func isSecurityEnabledPodExist(podStatus map[string]AerospikePodStatus) (bool, error) { - if podStatus == nil { - return false, fmt.Errorf("podStatus is nil") + if len(podStatus) == 0 { + return false, fmt.Errorf("pod status is unknown") } for pod := range podStatus { diff --git a/controllers/configmap.go b/controllers/configmap.go index 1514a63ba..c2b4ad69c 100644 --- a/controllers/configmap.go +++ b/controllers/configmap.go @@ -144,6 +144,10 @@ func (r *SingleClusterReconciler) createConfigMapData(rack *asdbv1.Rack) ( string(podSpecStr), "\"aerospikeInitContainer\":{},", "", )) + podSpecStr = []byte(strings.ReplaceAll( + string(podSpecStr), "\"multiPodPerHost\":false,", "", + )) + podSpecHash, err := utils.GetHash(string(podSpecStr)) if err != nil { return nil, err