Ignore missing path error in conditional match

Signed-off-by: Sean Blong <seanblong@gmail.com>
pull/7410/head
Sean Blong 2024-02-08 18:03:42 -08:00 committed by Sean Blong
parent 3b8370e13c
commit cf460d51c3
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Ignore missing path error in conditional match

View File

@ -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