-
Notifications
You must be signed in to change notification settings - Fork 952
Special characters like & not handled correctly in --docker-password when creating secrets using kubectl create secret #1709
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
Comments
This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The 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-sigs/prow repository. |
I investigated the issue related to Docker registry passwords containing special characters (like &) being incorrectly encoded when creating a Kubernetes secret using the |
To resolve this, I manually created the Step2: Base64 encode the content Step4: Apply the secret |
Hope this help as it seems that We need to address this behavior in future updates to |
/close |
@mpuckett159: 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-sigs/prow repository. |
I’m facing an issue when trying to create a Secret in Kubernetes with a password that contains the special character & using the kubectl create secret command. The password is either being encoded incorrectly or not handled properly when the special character is included.
Here’s the command I’m trying to execute:
kubectl create secret docker-registry docker-login-secret10
--docker-server=
registry.example.com
--docker-username=mke_prod
--docker-password="5a6g(07hl9gsv&QzF9Fgcrz@6rnHA4h7"
--docker-email=[email protected]
--namespace=default
The secret creation seems to work correctly, but when I decode the .dockerconfigjson field, the password appears in the format
"password": "5a6g(07hl9gsv\u0026QzF9Fgcrz@6rnHA4h7"
Expected result:
"password": "5a6g(07hl9gsv&QzF9Fgcrz@6rnHA4h7"
Actual result:
"password": "5a6g(07hl9gsv&QzF9Fgcrz@6rnHA4h7"
"&" character is being encoded as \u0026 or another incorrect value, which is not the expected behavior.
What I’ve tried:
Escaped the & using & in the command, but it didn't work.
Tried using single and double quotes around the password, but the issue persists.
Checked the base64 encoding, but the special character seems to be handled incorrectly.
The text was updated successfully, but these errors were encountered: