SKip the empty resource/base item in a kustomization file and set the

defaultBranch if needed
This commit is contained in:
Haiyan Meng
2020-01-06 11:53:27 -08:00
parent 5f8a8b545b
commit 142c105500
2 changed files with 14 additions and 0 deletions

View File

@@ -78,6 +78,9 @@ func (doc *KustomizationDocument) GetResources() ([]*Document, error) {
res := make([]*Document, 0, len(k.Resources))
for _, r := range k.Resources {
if strings.TrimSpace(r) == "" {
continue
}
next, err := doc.Document.FromRelativePath(r)
if err != nil {
fmt.Printf("GetResources error: %v\n", err)