Skip to content

Commit

Permalink
Merge pull request #240 from aquasecurity/lihiz_ke_replicas
Browse files Browse the repository at this point in the history
SLK-82520: Fix KE replicas not being set
  • Loading branch information
tikolsky authored Aug 7, 2024
2 parents f754539 + 7203e86 commit 4109212
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ func (enf *AquaKubeEnforcerHelper) CreateKEDeployment(cr *operatorv1alpha1.AquaK
Annotations: annotations,
},
Spec: appsv1.DeploymentSpec{
//Replicas: extra.Int32Ptr(int32(2)),
Replicas: extra.Int32Ptr(int32(cr.Spec.KubeEnforcerService.Replicas)),
Selector: &metav1.LabelSelector{
MatchLabels: selectors,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func (r *AquaKubeEnforcerReconciler) addKEDeployment(cr *operatorv1alpha1.AquaKu
_ = r.Client.Status().Update(context.Background(), cr)
} else {
currentState := cr.Status.State
if !k8s.IsDeploymentReady(found, 1) {
if !k8s.IsDeploymentReady(found, int(cr.Spec.KubeEnforcerService.Replicas)) {
if !reflect.DeepEqual(operatorv1alpha1.AquaEnforcerUpdateInProgress, currentState) &&
!reflect.DeepEqual(operatorv1alpha1.AquaDeploymentStatePending, currentState) {
cr.Status.State = operatorv1alpha1.AquaEnforcerUpdateInProgress
Expand Down

0 comments on commit 4109212

Please sign in to comment.