Skip to content

Commit

Permalink
updated error message according to new discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
laxmikantbpandhare committed Jul 23, 2023
1 parent ef768e2 commit 0c5e93e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 5 additions & 6 deletions api/internal/builtins/PatchTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions plugin/builtin/patchtransformer/PatchTransformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func (p *plugin) transformStrategicMerge(m resmap.ResMap, patch *resource.Resour
return err
}

if len(selected) == 0 {
return fmt.Errorf("patches target not found for %s", p.Target.ResId)
if p.Options["allowNoTargetMatch"] {
log.Println("Warning: patches target not found for Target")
}

return m.ApplySmPatch(resource.MakeIdSet(selected), patch)
Expand All @@ -119,8 +119,8 @@ func (p *plugin) transformJson6902(m resmap.ResMap, patch jsonpatch.Patch) error
return err
}

if len(resources) == 0 {
return fmt.Errorf("patches target not found for %s", p.Target.ResId)
if p.Options["allowNoTargetMatch"] {
log.Println("Warning: patches target not found for Target")
}

for _, res := range resources {
Expand Down

0 comments on commit 0c5e93e

Please sign in to comment.