Skip to content

Commit

Permalink
Merge pull request #140 from iamniting/scc
Browse files Browse the repository at this point in the history
fix: fix ensureDeleted of openshiftSccs via returning an error
  • Loading branch information
openshift-merge-robot authored Apr 4, 2022
2 parents 41db655 + 0713745 commit b5dc6f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions controllers/scc.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ func (c openshiftSccs) ensureDeleted(r *LVMClusterReconciler, ctx context.Contex
for _, scc := range sccs {
err = r.SecurityClient.SecurityContextConstraints().Delete(ctx, scc.Name, metav1.DeleteOptions{})
if err != nil {
if errors.IsNotFound(err) {
r.Log.Info("SecurityContextConstraint is already deleted", "SecurityContextConstraint", scc.Name)
return nil
} else {
if !errors.IsNotFound(err) {
r.Log.Error(err, "failed to delete SecurityContextConstraint", "SecurityContextConstraint", scc.Name)
return err
}
r.Log.Info("SecurityContextConstraint is already deleted", "SecurityContextConstraint", scc.Name)
}
}
}
Expand Down

0 comments on commit b5dc6f1

Please sign in to comment.