From 6f29877f119f48e2db17ec7ed0936353c6464abb Mon Sep 17 00:00:00 2001 From: Oren Cohen Date: Wed, 9 Feb 2022 20:09:51 +0200 Subject: [PATCH] Fix a bug in deletion of webhook service for replacement (#2606) The condition that checks for an error with the webhook service deletion is based on the wrong variable, and the return statement is never reached, which leads to a continuous error when OLM tries to replace the webhook service on certain conditions Signed-off-by: orenc1 Upstream-repository: operator-lifecycle-manager Upstream-commit: e9aef37a1f293bbbf833206f2037a2f36ffe2673 --- .../pkg/controller/install/certresources.go | 2 +- .../pkg/controller/install/certresources.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/operator-lifecycle-manager/pkg/controller/install/certresources.go b/staging/operator-lifecycle-manager/pkg/controller/install/certresources.go index efa77bff40..69de687462 100644 --- a/staging/operator-lifecycle-manager/pkg/controller/install/certresources.go +++ b/staging/operator-lifecycle-manager/pkg/controller/install/certresources.go @@ -243,7 +243,7 @@ func (i *StrategyDeploymentInstaller) installCertRequirementsForDeployment(deplo // Delete the Service to replace deleteErr := i.strategyClient.GetOpClient().DeleteService(service.GetNamespace(), service.GetName(), &metav1.DeleteOptions{}) - if err != nil && !k8serrors.IsNotFound(deleteErr) { + if deleteErr != nil && !k8serrors.IsNotFound(deleteErr) { return nil, nil, fmt.Errorf("could not delete existing service %s", service.GetName()) } } diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install/certresources.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install/certresources.go index efa77bff40..69de687462 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install/certresources.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install/certresources.go @@ -243,7 +243,7 @@ func (i *StrategyDeploymentInstaller) installCertRequirementsForDeployment(deplo // Delete the Service to replace deleteErr := i.strategyClient.GetOpClient().DeleteService(service.GetNamespace(), service.GetName(), &metav1.DeleteOptions{}) - if err != nil && !k8serrors.IsNotFound(deleteErr) { + if deleteErr != nil && !k8serrors.IsNotFound(deleteErr) { return nil, nil, fmt.Errorf("could not delete existing service %s", service.GetName()) } }