ContainerPatch supports all common workload paths

This commit is contained in:
Katrina Verey
2021-08-10 16:08:28 -07:00
parent 7a41e479c9
commit f0b4cc4581
11 changed files with 232 additions and 2 deletions

View File

@@ -168,8 +168,7 @@ func (cpt ContainerPatchTemplate) apply(matches []*yaml.RNode) error {
}
for i := range matches {
// TODO(knverey): Make this work for more Kinds and expose the helper for doing so.
containers, err := matches[i].Pipe(yaml.Lookup("spec", "template", "spec", "containers"))
containers, err := matches[i].Pipe(yaml.LookupFirstMatch(yaml.ConventionalContainerPaths))
if err != nil {
return errors.Wrap(err)
}