From 49fff561777532eceeeb929b30ea50effc6883fa Mon Sep 17 00:00:00 2001 From: Hang Yan Date: Fri, 13 Dec 2019 16:26:38 +0800 Subject: [PATCH] Support both old and new finalizer --- pkg/controller/helmrequest.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/helmrequest.go b/pkg/controller/helmrequest.go index 68eb126f..d98bcfef 100644 --- a/pkg/controller/helmrequest.go +++ b/pkg/controller/helmrequest.go @@ -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?