Skip to content
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

--set-literal does not allow backslash escaping in NAME #12981

Open
anbrsap opened this issue Apr 24, 2024 · 1 comment
Open

--set-literal does not allow backslash escaping in NAME #12981

anbrsap opened this issue Apr 24, 2024 · 1 comment
Labels
bug Categorizes issue or PR as related to a bug. unconfirmed

Comments

@anbrsap
Copy link

anbrsap commented Apr 24, 2024

Problem

Helm option --set-literal does not perform backslash escaping for value names.

Example: --set-literal 'a.b\.b\.b.c=x,\[]{}x' has the same effect as using the following values file:

a:
  b\\:
    b\\:
      b:
        c: 'x,\[]{}x'

This does not make any sense, because it prevents setting values with special characters in the name.

Expected Behavior

--set-literal should allow to set values whose name contains characters with special meanings in a path (e.g. . or [) using the same backslash escaping rules as used for other ---set* options.

Example: --set-literal 'a.b\.b\.b.c=x,\[]{}x' should have the same effect as using the following values file:

a:
  b.b.b:
    c: 'x,\[]{}x'

Additional Info

Output of helm version:

version.BuildInfo{Version:"v3.14.4", GitCommit:"81c902a123462fd4052bc5e9aa9c513c4c8fc142", GitTreeState:"clean", GoVersion:"go1.21.9"}
@gjenkins8 gjenkins8 added feature and removed feature labels May 2, 2024
@gjenkins8
Copy link
Contributor

If --set-literal 'a.b\.b\.b.c={}' behaves differently to e.g. --set-json 'a.b.b.b.c={}' for the key set. Then yeah, this seems like a bug (but it might be hard to change the existing behavior without backwards compatibility concerns)

@gjenkins8 gjenkins8 added bug Categorizes issue or PR as related to a bug. unconfirmed labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug. unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants