Skip to content

Commit

Permalink
Support both old and new finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
hangyan committed Dec 13, 2019
1 parent 0456fc5 commit 49fff56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/helmrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ func (c *Controller) deleteHelmRequest(hr *v1alpha1.HelmRequest) error {

// removeFinalizer remove all the finalizers of this HelmRequest
func (c *Controller) removeFinalizer(helmRequest *v1alpha1.HelmRequest) error {
if funk.Contains(helmRequest.Finalizers, util.FinalizerName) {
// captain.alauda.io is the old finalizer, this should provide some backword compatibility
if funk.Contains(helmRequest.Finalizers, util.FinalizerName) || funk.Contains(helmRequest.Finalizers, "captain.alauda.io"){
klog.Infof("found finalizers for helmrequest: %s", helmRequest.Name)
data := `{"metadata":{"finalizers":null}}`
// ? only patch can work?
Expand Down

0 comments on commit 49fff56

Please sign in to comment.