Skip to content

Commit

Permalink
removed finalizer from sidecar deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamna committed Dec 12, 2023
1 parent 7186084 commit a8b7e9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 3 additions & 7 deletions internal/controller/basic_authenticator/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,9 @@ func (r *BasicAuthenticatorReconciler) removeInjectedContainers(ctx context.Cont

cleanupDeployments := removeInjectedResources(deployments, secrets, configmaps)
for _, deploy := range cleanupDeployments {
if controllerutil.ContainsFinalizer(deploy, basicAuthenticatorFinalizer) {
if objUpdated := controllerutil.RemoveFinalizer(deploy, basicAuthenticatorFinalizer); objUpdated {
if err := r.Update(ctx, deploy); err != nil {
r.logger.Error(err, "failed to add basicAuthenticator to injected deployment")
return subreconciler.RequeueWithError(err)
}
}
if err := r.Update(ctx, deploy); err != nil {
r.logger.Error(err, "failed to add update cleaned up deployments")
return subreconciler.RequeueWithError(err)
}
}
return subreconciler.ContinueReconciling()
Expand Down
6 changes: 0 additions & 6 deletions internal/controller/basic_authenticator/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,6 @@ func (r *BasicAuthenticatorReconciler) createSidecarAuthenticator(ctx context.Co
return subreconciler.RequeueWithError(err)
}
for _, deploy := range deploymentsToUpdate {
if !controllerutil.ContainsFinalizer(deploy, basicAuthenticatorFinalizer) {
if objUpdated := controllerutil.AddFinalizer(deploy, basicAuthenticatorFinalizer); !objUpdated {
return subreconciler.Requeue()
}
}

err := r.Update(ctx, deploy)
if err != nil {
r.logger.Error(err, "failed to update injected deployments")
Expand Down

0 comments on commit a8b7e9f

Please sign in to comment.