-
Notifications
You must be signed in to change notification settings - Fork 894
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
Rejecting valid Environment Variable Names #47
Comments
@DarqueWarrior the env key not support name: "a:b", but value can set value: "a:b". |
According to POSIX:
Which let's me believe that we should allow "other characters". Also, try this:
I don't see anything wrong there. |
Fixed in 1.8 |
kubernetes/kubernetes#47460 doesn't fix this issue with |
It seems kubectl doesn't like @shiywang Do have bandwidth to verify if this is a bug in Cobra or in kubectl code? |
/assign |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@shiywang Any update? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
I wanted to learn more about kubernetes and thus started investigating this issue out of interest. @mengqiy , I found that the issue is not in Cobra but in kubectl code. Cobra is parsing arguments properly but kubectl is not allowing ":" in environment name. Allowed characters in environment are [-._a-zA-Z][-._a-zA-Z0-9]* as per this code. Is it ok if I take up this issue and raise PR for the fix? |
@vithati Please, feel free to open a PR for this! Thanks (and please assign me). |
/sig cli |
/assign @vithati |
@seans3: GitHub didn't allow me to assign the following users: vithati. Note that only kubernetes members and repo collaborators can be assigned. 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. |
/priority P1 |
Please see kubernetes/kubernetes#53201 |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
I tried resolving this here: kubernetes/kubernetes#78910 |
There is already a proposal to fix it in kubernetes/kubernetes#69415, and it's not that easy. Though it seems like it's been abandoned. so I'd be happy to see someone pick it up |
Woah yeah it looks like this had much more history than I expected, and that I'm probably wrong haha. Would you happen to know why my solution is not good? I basically found that line was the culprit and ran some |
Your code is perfectly fine. The problem is with backward compatibility. If we start inserting these newly permitted object in the database, it might be a problem when you have multiple masters running at the same time (and not being updated at the same time), or if you fallback your master upgrade to a former version. Then those objects are no longer valid (this is an API change) and will be "stuck" in etcd. |
That was an amazing explanation. Thanks a lot for taking the time to post that, I can now see that my solution was pretty naive because, in its current state, I can't imagine it being backwards compatible. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
/close |
@liggitt: 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. |
Kubernetes version:
Environment:
What happened:
I was invoking the following command:
kubectl run myname --image=myimage:86 --port=80 --env="ConnectionStrings:DefaultConnection=Data Source=tcp:mySqlServer,1433;Initial Catalog=myDB;User Id=myUser;Password=mypassword;"
I got errors about invalid env:
error: invalid env: ConnectionStrings:DefaultConnection=Data Source=tcp:mySqlServer
I tried this with a YAML file as well and got a better error message stating I was using invalid characters for my name. However, : is valid the only values not allowed in names is "=". To work around this I removed the : then I got an error because it split my value on "," between my server and port.
What you expected to happen:
I expected a new environment variable to be created with the following information:
How to reproduce it (as minimally and precisely as possible):
Just try and set the environment variable name to something that includes a ":" and have a value that contains a ",". The splitting should not split on "," in the value of the environment variable.
Anything else we need to know:
I am using .NET Core and it allows you to create nested configurations that are built using a : in the environment variable name. I was able to use this just fine with docker run commands against my own host because docker and Linux does support the string as I originally submitted it. This only breaks because of the validation of values and parsing logic of kubectl.
The text was updated successfully, but these errors were encountered: