Skip to content

Commit

Permalink
SLK-82520: Fix KE replicas not being set
Browse files Browse the repository at this point in the history
  • Loading branch information
Lihi Zitzer committed Aug 6, 2024
1 parent f754539 commit 7203e86
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 7203e86

Please sign in to comment.