From cf460d51c38b458fb8491972855188edf8f0f8d7 Mon Sep 17 00:00:00 2001 From: Sean Blong Date: Thu, 8 Feb 2024 18:03:42 -0800 Subject: [PATCH] Ignore missing path error in conditional match Signed-off-by: Sean Blong --- changelogs/unreleased/7410-seanblong | 1 + internal/resourcemodifiers/resource_modifiers.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/7410-seanblong diff --git a/changelogs/unreleased/7410-seanblong b/changelogs/unreleased/7410-seanblong new file mode 100644 index 0000000000..ffc340d2bc --- /dev/null +++ b/changelogs/unreleased/7410-seanblong @@ -0,0 +1 @@ +Ignore missing path error in conditional match diff --git a/internal/resourcemodifiers/resource_modifiers.go b/internal/resourcemodifiers/resource_modifiers.go index d4ae93e717..2546e0d664 100644 --- a/internal/resourcemodifiers/resource_modifiers.go +++ b/internal/resourcemodifiers/resource_modifiers.go @@ -172,7 +172,7 @@ func matchConditions(u *unstructured.Unstructured, rules []MatchRule, _ logrus.F p := &JSONPatcher{patches: fixed} _, err := p.applyPatch(u) if err != nil { - if errors.Is(err, jsonpatch.ErrTestFailed) { + if errors.Is(err, jsonpatch.ErrTestFailed) || errors.Is(err, jsonpatch.ErrMissing) { return false, nil } return false, err