Skip to content

Commit 9b52ce3

Browse files
svghadialkakumari016anandrkskd
authored
fix: Redis SCC fix (#1862)
* bug: fix redis ha proxy pod fails to restart after upgrade (#1860) Signed-off-by: Alka Kumari <alkumari@redhat.com> * fix redis pod failing to start after upgrade (#1841) Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> --------- Signed-off-by: Alka Kumari <alkumari@redhat.com> Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> Co-authored-by: Alka Kumari <48486620+alkakumari016@users.noreply.github.com> Co-authored-by: Anand Kumar Singh <anandrkskd@gmail.com>
1 parent f0f08d1 commit 9b52ce3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

controllers/argocd/deployment.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,15 @@ func (r *ReconcileArgoCD) reconcileRedisDeployment(cr *argoproj.ArgoCD, useTLS b
598598
changed = true
599599
}
600600

601+
if !reflect.DeepEqual(deploy.Spec.Template.Spec.SecurityContext, existing.Spec.Template.Spec.SecurityContext) {
602+
existing.Spec.Template.Spec.SecurityContext = deploy.Spec.Template.Spec.SecurityContext
603+
if changed {
604+
explanation += ", "
605+
}
606+
explanation += "pod security context"
607+
changed = true
608+
}
609+
601610
if !reflect.DeepEqual(deploy.Spec.Template.Spec.ServiceAccountName, existing.Spec.Template.Spec.ServiceAccountName) {
602611
existing.Spec.Template.Spec.ServiceAccountName = deploy.Spec.Template.Spec.ServiceAccountName
603612
if changed {
@@ -914,6 +923,14 @@ func (r *ReconcileArgoCD) reconcileRedisHAProxyDeployment(cr *argoproj.ArgoCD) e
914923
explanation += "container security context"
915924
changed = true
916925
}
926+
if !reflect.DeepEqual(deploy.Spec.Template.Spec.SecurityContext, existing.Spec.Template.Spec.SecurityContext) {
927+
existing.Spec.Template.Spec.SecurityContext = deploy.Spec.Template.Spec.SecurityContext
928+
if changed {
929+
explanation += ", "
930+
}
931+
explanation += "pod security context"
932+
changed = true
933+
}
917934
if changed {
918935
argoutil.LogResourceUpdate(log, existing, "updating", explanation)
919936
return r.Client.Update(context.TODO(), existing)

0 commit comments

Comments
 (0)