Skip to content

Commit

Permalink
adding securityEnabled flag in helm crd
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed Feb 20, 2024
1 parent e259de7 commit 19aa4ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 1 addition & 9 deletions api/v1/aerospikecluster_validating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -1300,17 +1300,9 @@ func validateEnableSecurityConfig(newConfSpec, oldConfSpec *AerospikeConfigSpec)
oldSecFlag, oldEnableSecurityFlagFound := oldSec.(map[string]interface{})["enable-security"]
newSecFlag, newEnableSecurityFlagFound := newSec.(map[string]interface{})["enable-security"]

if oldEnableSecurityFlagFound && oldSecFlag.(bool) && !newEnableSecurityFlagFound {
if oldEnableSecurityFlagFound && oldSecFlag.(bool) && (!newEnableSecurityFlagFound || !newSecFlag.(bool)) {
return fmt.Errorf("cannot disable cluster security in running cluster")
}

if oldEnableSecurityFlagFound && newEnableSecurityFlagFound || !reflect.DeepEqual(
oldSecFlag, newSecFlag,
) {
if oldSecFlag.(bool) && !newSecFlag.(bool) {
return fmt.Errorf("cannot disable cluster security in running cluster")
}
}
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14209,6 +14209,10 @@ spec:
description: PodSpecHash is ripemd160 hash of PodSpec used by
this pod
type: string
securityEnabled:
description: SecurityEnabled is true if security is enabled
in the pod
type: boolean
servicePort:
description: ServicePort is the port Aerospike clients outside
K8s can connect to.
Expand All @@ -14221,6 +14225,7 @@ spec:
- podIP
- podPort
- podSpecHash
- securityEnabled
type: object
description: Pods has Aerospike specific status of the pods. This
is map instead of the conventional map as list convention to allow
Expand Down

0 comments on commit 19aa4ad

Please sign in to comment.