-
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
ConfigMapGenerator drops quotes from quoted fields #3412
Comments
Thanks. If setting the flag is a problem, use https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv3.8.9 instead which defaults the flag to false. Changing See also: Need to check a round trip of a configmap |
Changing "3306" to 3306 is also a problem, because that's a number, and when you then send the CM to the environment, it'll complain? |
Another test case, this time for booleans: kustomization.yaml configMapGenerator:
- name: test-map
literals:
- INITIAL=true
- name: test-map
behavior: merge
literals:
- MERGED=false Results:
|
This issue also occurs when Files to reproduce base/kustomization.yml
base/base.properties
replace-overlay/kustomization.yml
replace-overlay/replace.properties
merge-overlay/kustomization.yml
merge-overlay/merge.properties
kustomize@3.8.9 gives
kustomize@3.9.1 gives
|
see kubernetes-sigs/kustomize#3412 this broke some customer pipelines.
see kubernetes-sigs/kustomize#3412 this broke some customer pipelines.
kubernetes-sigs/kustomize#3412 Should remove the legacy flag when the bug is fixed.
I have a similar quoting issue trying to use jmespath but it's on 3.8.4 and 3.9.1 with or without the kyaml option. kustomization.yaml:
kustomize 3.8.4, 3.9.1 with kyaml enabled or disabled (NOTE the final single quote is missing)
|
I'll fix this today |
I can confirm that this is still an issue for us in 4.1.3. |
I'm also seeing this with 4.4.1. If you have a regular config map and don't use the generators you can have If you use Kustomize and the config map generator with the same set up you end up with Edit: For anyone reading this in the future, there is a good workaround for having a basic set up. Instead of using literals you can do: configMapGenerator:
- name: "yay"
env: ".env" Then your SOMETHING=nice
WITH_QUOTES="yep this works" This will generate the same result of what you would get without using Kustomize and hand rolled your own config map using the style of variables at the start of this reply. |
This is still an issue - commented details in #4845 |
the problem occured today, so only version 3.9.1 should be affected.
When a ConfigMap in merged with the configMapGenerator the output will result in invalid values for the data field.
The surrounding quotation marks are stripped away (which converts some strings to int64), or in the case of an empty string it is converted to null
setting the flag --enable_kyaml=false fixed the issue
Files that can reproduce the issue
Example:
kustomization.yaml
resources.yaml
Expected output
Actual output
Kustomize version: kustomize/v3.9.1
Platform
The text was updated successfully, but these errors were encountered: