cmd/config run scoping and path defaulting

- default the path and index for Resources generated by functions
- scope functions to only operate against resources in subdirectories
This commit is contained in:
Phillip Wittrock
2020-01-08 22:11:57 -08:00
parent 9fe9a2500a
commit 2f5be62387
7 changed files with 994 additions and 50 deletions

View File

@@ -31,7 +31,8 @@ type LocalPackageWriter struct {
var _ Writer = LocalPackageWriter{}
func (r LocalPackageWriter) Write(nodes []*yaml.RNode) error {
if err := kioutil.ErrorIfMissingAnnotation(nodes, requiredResourcePackageAnnotations...); err != nil {
// set the path and index annotations if they are missing
if err := kioutil.DefaultPathAndIndexAnnotation("", nodes); err != nil {
return err
}