From 0260e9dcb1c7f8900d48f30ff7e7e9ed594071e3 Mon Sep 17 00:00:00 2001 From: Rahul Anand Date: Tue, 7 Jun 2022 20:08:35 +0530 Subject: [PATCH] skip envoyfilter deletion if not present already --- controllers/apim/ratelimitpolicy_controller.go | 1 + controllers/apim/ratelimitpolicy_finalizers.go | 1 + 2 files changed, 2 insertions(+) diff --git a/controllers/apim/ratelimitpolicy_controller.go b/controllers/apim/ratelimitpolicy_controller.go index 8e2913b..a8c207f 100644 --- a/controllers/apim/ratelimitpolicy_controller.go +++ b/controllers/apim/ratelimitpolicy_controller.go @@ -293,6 +293,7 @@ func (r *RateLimitPolicyReconciler) cleanUpOrphanWASMPlugins(ctx context.Context logger.V(1).Info("cleanUpOrphanWASMPlugins: get EnvoyFilter", "envoyfilter", efKey, "err", err) if apierrors.IsNotFound(err) { logger.Info("cleanUpOrphanWASMPlugins: envoyfilter not found", "envoyFilter", efKey) + continue } err = r.DeleteResource(ctx, ef) if err != nil { diff --git a/controllers/apim/ratelimitpolicy_finalizers.go b/controllers/apim/ratelimitpolicy_finalizers.go index 843c2ce..a6d9d22 100644 --- a/controllers/apim/ratelimitpolicy_finalizers.go +++ b/controllers/apim/ratelimitpolicy_finalizers.go @@ -81,6 +81,7 @@ func (r *RateLimitPolicyReconciler) finalizeWASMPlugins(ctx context.Context, rlp logger.V(1).Info("finalizeWASMPlugins: get EnvoyFilter", "envoyfilter", efKey, "err", err) if apierrors.IsNotFound(err) { logger.Info("finalizeWASMPlugins: envoyfilter not found", "envoyFilter", efKey) + continue } err = r.DeleteResource(ctx, ef) if err != nil {