Avoid to index a document if FetchDcoument or SetCreated fails

This commit is contained in:
Haiyan Meng
2019-12-16 11:39:54 -08:00
parent 12fc8f41c7
commit 8c89f0946c
3 changed files with 25 additions and 16 deletions

View File

@@ -116,6 +116,8 @@ func (doc *KustomizationDocument) readBytes() ([]map[string]interface{}, error)
return configs, nil
}
// ParseYAML parses doc.Document and sets the following fields of doc:
// Kinds, Values, Identifiers.
func (doc *KustomizationDocument) ParseYAML() error {
doc.Identifiers = make([]string, 0)
doc.Values = make([]string, 0)