diff --git a/pkg/modules/generators/app_configurations_generator.go b/pkg/modules/generators/app_configurations_generator.go index eaa2019b..dab7cebf 100644 --- a/pkg/modules/generators/app_configurations_generator.go +++ b/pkg/modules/generators/app_configurations_generator.go @@ -217,7 +217,8 @@ func JSONPatch(resources v1.Resources, patcher *v1.Patcher) error { for id, jsonPatcher := range patcher.JSONPatchers { res, ok := resIndex[id] if !ok { - return fmt.Errorf("target patch resource %s not found", id) + log.Warnf("target patch resource %s not found, skipped", id) + continue } target := jsonutil.Marshal2String(res.Attributes) diff --git a/pkg/modules/generators/app_configurations_generator_test.go b/pkg/modules/generators/app_configurations_generator_test.go index b2235062..a32e473d 100644 --- a/pkg/modules/generators/app_configurations_generator_test.go +++ b/pkg/modules/generators/app_configurations_generator_test.go @@ -499,7 +499,7 @@ func TestJsonPatch(t *testing.T) { "notfound": {Type: v1.MergePatch, Payload: []byte(`{"key": "value"}`)}, }, }) - assert.Error(t, err) + assert.Nil(t, err) }) t.Run("MergePatch", func(t *testing.T) {