Skip to content

Commit

Permalink
Incorporate review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekdwivedi3060 committed May 17, 2024
1 parent 728c781 commit 63927fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
7 changes: 3 additions & 4 deletions api/v1/aerospikecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,10 @@ type AerospikeClusterStatusSpec struct { //nolint:govet // for readability
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Enable Dynamic Config Update"
EnableDynamicConfigUpdate *bool `json:"enableDynamicConfigUpdate,omitempty"`

// IsClusterReadinessEnabled determines if the cluster is readiness enabled i.e. readiness probe is
// present in all pods.
// This field is used to determine if PodDisruptionBudget should be created for the Aerospike cluster or not.
// IsReadinessProbeEnabled tells whether the readiness probe is present in all pods or not.
// Moreover, PodDisruptionBudget should be created for the Aerospike cluster only when this field is enabled.
// +optional
IsClusterReadinessEnabled bool `json:"isClusterReadinessEnabled"`
IsReadinessProbeEnabled bool `json:"isClusterReadinessEnabled"`
// Define resources requests and limits for Aerospike Server Container.
// Please contact aerospike for proper sizing exercise
// Only Memory and Cpu resources can be given
Expand Down
7 changes: 3 additions & 4 deletions config/crd/bases/asdb.aerospike.com_aerospikeclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9619,10 +9619,9 @@ spec:
description: Aerospike server image
type: string
isClusterReadinessEnabled:
description: IsClusterReadinessEnabled determines if the cluster is
readiness enabled i.e. readiness probe is present in all pods. This
field is used to determine if PodDisruptionBudget should be created
for the Aerospike cluster or not.
description: IsReadinessProbeEnabled tells whether the readiness probe
is present in all pods or not. Moreover, PodDisruptionBudget should
be created for the Aerospike cluster only when this field is enabled.
type: boolean
k8sNodeBlockList:
description: K8sNodeBlockList is a list of Kubernetes nodes which
Expand Down
2 changes: 1 addition & 1 deletion controllers/poddistruptionbudget.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *SingleClusterReconciler) deletePDB() error {
func (r *SingleClusterReconciler) createOrUpdatePDB() error {
// Check for cluster readiness status only when it's false.
// Once enabled it won't be disabled.
if !r.IsStatusEmpty() && !r.aeroCluster.Status.IsClusterReadinessEnabled {
if !r.IsStatusEmpty() && !r.aeroCluster.Status.IsReadinessProbeEnabled {
clusterReadinessEnabled, err := r.getClusterReadinessStatus()
if err != nil {
return fmt.Errorf("failed to get cluster readiness status: %v", err)
Expand Down
6 changes: 3 additions & 3 deletions controllers/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ func (r *SingleClusterReconciler) updateStatus() error {
newAeroCluster.Status.AerospikeClusterStatusSpec = *specToStatus
newAeroCluster.Status.Phase = asdbv1.AerospikeClusterCompleted

// If IsClusterReadinessEnabled is not enabled, then only check for cluster readiness.
// If IsReadinessProbeEnabled is not enabled, then only check for cluster readiness.
// This is to avoid checking cluster readiness for every reconcile as once it is enabled, it will not be disabled.
if !newAeroCluster.Status.IsClusterReadinessEnabled {
if !newAeroCluster.Status.IsReadinessProbeEnabled {
clusterReadinessEnable, gErr := r.getClusterReadinessStatus()
if gErr != nil {
return fmt.Errorf("failed to get cluster readiness status: %v", gErr)
}

newAeroCluster.Status.IsClusterReadinessEnabled = clusterReadinessEnable
newAeroCluster.Status.IsReadinessProbeEnabled = clusterReadinessEnable
}

err = r.patchStatus(newAeroCluster)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9619,10 +9619,9 @@ spec:
description: Aerospike server image
type: string
isClusterReadinessEnabled:
description: IsClusterReadinessEnabled determines if the cluster is
readiness enabled i.e. readiness probe is present in all pods. This
field is used to determine if PodDisruptionBudget should be created
for the Aerospike cluster or not.
description: IsReadinessProbeEnabled tells whether the readiness probe
is present in all pods or not. Moreover, PodDisruptionBudget should
be created for the Aerospike cluster only when this field is enabled.
type: boolean
k8sNodeBlockList:
description: K8sNodeBlockList is a list of Kubernetes nodes which
Expand Down

0 comments on commit 63927fe

Please sign in to comment.