-
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
double quote disappear #3485
Comments
The same issue here
end up as
^^ both, on kubectl apply throws
Some discussin here: Required
|
@monopole Is this the same with other quotes issues? |
Same here, had to downgrade because it was messing up with annotations. I did not find any workaround though. |
Same here... bit weird |
4.0.1 still has problem. I think this should have more priority as this will hinder people from upgrading. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
kustomization.yaml apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- redis.yaml
- deployment.yaml
vars:
- name: REDIS_HOST
objref:
apiVersion: v1
kind: Service
name: redis
fieldref:
fieldpath: metadata.name
- name: REDIS_PORT
objref:
apiVersion: v1
kind: Service
name: redis
fieldref:
fieldpath: spec.ports.0.port deployment.yaml apiVersion: apps/v1
kind: Deployment
metadata:
name: quote-app
spec:
template:
spec:
containers:
- name: app-container
env:
- name: REDIS_HOST
value: $(REDIS_HOST)
- name: REDIS_PORT
value: "$(REDIS_PORT)" redis.yaml apiVersion: v1
kind: Service
metadata:
name: redis
spec:
ports:
- protocol: TCP
port: 80
targetPort: 6379 and build output
problem still persist as we have integer value for environment variable. tested on windows 10 with kustomize cli(installed via chocolatey
|
/remove-lifecycle stale |
We are planning to deprecate vars and this will not be fixed. Please see #2052. /close |
@eddiezane: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Same issue with port number and password which contains special characters. Solutions proposed in #3412 doesn't work in our case.
Workaround we use: kustomize kubectl kustomize k8s/overlays/test | envsubst secrets.yml apiVersion: v1
kind: Secret
metadata:
name: db
type: Opaque
stringData:
DB_PORT: |
${DB_PORT} result apiVersion: v1
kind: Secret
metadata:
name: db
namespace: db
stringData:
DB_PORT: |
443 container echo $DB_PORT
443 Another option to be considered is to use sed to replace the variable with the value and it should be quoted in the yml. |
Describe the bug
vars variable is surrounded by double quotes
""
after build, double quotes disappear.
Files that can reproduce the issue
kustomization.yaml loads redis port using vars
quote-patch.yaml patches deployment. put redis port into environment variable.
REDIS_PORT
var inside double quote.Expected output
kustomize version 3.9.1 build output
Actual output
kustomize version 3.9.2 build output
Kustomize version
3.9.1 works as expected
3.9.2 removes double quotes surrounding var
Platform
macOS, kustomize cli upgraded via homebrew. regression test performed by download release from this github
Additional context
The text was updated successfully, but these errors were encountered: