mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 09:02:53 +00:00
Added code for fields with dots(.) in their names work as needed (#4591)
* Added code for fields with dots(.) in their names work as needed Co-authored-by: sarjamil <sjamil@salesforce.com> * Fixed imports Co-authored-by: sarjamil <sjamil@salesforce.com> * Removed comments Co-authored-by: sarjamil <sjamil@salesforce.com> * Fix filter method Co-authored-by: sarjamil <sjamil@salesforce.com> * Fixed failing tests Co-authored-by: sarjamil <sjamil@salesforce.com> * Remove comments Add co-author to PR. Co-authored-by: sarjamil <sjamil@salesforce.com> * Add co-author to PR. Co-authored-by: sarjamil sjamil@salesforce.com Co-authored-by: sarjamil <sjamil@salesforce.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||
"sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml"
|
||||
"sigs.k8s.io/kustomize/kyaml/sliceutil"
|
||||
"sigs.k8s.io/kustomize/kyaml/utils"
|
||||
"sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/labels"
|
||||
)
|
||||
|
||||
@@ -1207,7 +1208,7 @@ func (rn *RNode) GetString(path string) (string, error) {
|
||||
// assuming we keep the var feature in kustomize.
|
||||
// The other end of this is: refvar.go:updateNodeValue.
|
||||
func (rn *RNode) GetFieldValue(path string) (interface{}, error) {
|
||||
fields := convertSliceIndex(strings.Split(path, "."))
|
||||
fields := convertSliceIndex(utils.SmarterPathSplitter(path, "."))
|
||||
rn, err := rn.Pipe(Lookup(fields...))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user