Skip to content

Commit 8da8556

Browse files
committed
feat: allowNoTargetMatch feature for PatchTransformer and Path6902Transformer
This commit makes use of the new PatchArgs type and the new Patch option `allowNoTargetMatch`. This option, if true, allows rendering kustomization even if no resource is matched against the given target, while printing a warning to stderr. By default this option is set to false meaning that if no resource is matched against the given target an error is raised. This commit includes the extra tests to test this new feature.
1 parent 10986a0 commit 8da8556

File tree

5 files changed

+377
-62
lines changed

5 files changed

+377
-62
lines changed

api/internal/builtins/PatchJson6902Transformer.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/internal/builtins/PatchTransformer.go

Lines changed: 46 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/internal/target/kusttarget_configplugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
250250
return
251251
}
252252
var c struct {
253-
Path string `json:"path,omitempty" yaml:"path,omitempty"`
254-
Patch string `json:"patch,omitempty" yaml:"patch,omitempty"`
255-
Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"`
253+
Path string `json:"path,omitempty" yaml:"path,omitempty"`
254+
Patch string `json:"patch,omitempty" yaml:"patch,omitempty"`
255+
Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"`
256256
Options *types.PatchArgs `json:"options,omitempty" yaml:"options,omitempty"`
257257
}
258258
for _, pc := range kt.kustomization.Patches {

0 commit comments

Comments
 (0)