-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetFieldValue doesn't work with fields that contain dots(.) #4487
Comments
/triage accepted There are these path splitters in api that allow escaping delimiters, with a TODO to move them to kyaml. Part of this issue would to be to finally do that TODO, and use it in Edit: Forgot to link the path splitters: https://github.com/kubernetes-sigs/kustomize/blob/master/api/internal/utils/pathsplitter.go#L8 |
Is there an example of something that was migrated over from In hindsight I guess it makes sense |
It's used in the replacements filter here:
The purpose is to traverse a path that looks like
|
hello! I'm interested in this issue. please guide me. |
@natasha41575 So I think there is no need to make any changes in the repo since it is not a bug, am I right ? |
See my comment above: #4487 (comment). This explains the work that needs to be done to resolve this issue. |
Describe the bug
rnode.GetFieldValue
doesn't work correctly when the target field contains a.
For example when I call
rnode.GetFieldValue("foo.bar")
this function will try to find field "bar" within field "foo" instead of finding the field "foo.bar"Files that can reproduce the issue
Expected output
labelRNode.GetFieldValue("foo.appname")
should returnhello-world-app
Actual output
labelRNode.GetFieldValue("foo.appname")
returns an error because there is no fieldfoo
Kustomize version
Additional context
If my pod was defined as:
then it would have "worked" but it would have returned
wtf
instead ofhello-world-app
.Workaround
I can still use
rnode.Pipe(yaml.Lookup("foo.appname"))
and I can also usem, err := rnode.Map()
followed bym["foo.appname"]
, it just caught me offguardThe text was updated successfully, but these errors were encountered: