Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed May 7, 2024
1 parent 0baff72 commit c0a4f5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/v1/aerospikecluster_validating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions controllers/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0a4f5c

Please sign in to comment.