mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Add secret generator.
This commit is contained in:
@@ -90,3 +90,17 @@ func (fs *UnstructAdapter) GetFieldValue(path string) (string, error) {
|
||||
}
|
||||
return "", fmt.Errorf("no field named '%s'", path)
|
||||
}
|
||||
|
||||
// GetStringSlice returns value at the given fieldpath.
|
||||
func (fs *UnstructAdapter) GetStringSlice(path string) ([]string, error) {
|
||||
fields, err := parseFields(path)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
}
|
||||
s, found, err := unstructured.NestedStringSlice(
|
||||
fs.UnstructuredContent(), fields...)
|
||||
if found || err != nil {
|
||||
return s, err
|
||||
}
|
||||
return []string{}, fmt.Errorf("no field named '%s'", path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user