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

OC CLI: Environment variable with a DOT in them. #8771

Closed
gt-tech opened this issue May 6, 2016 · 15 comments · Fixed by #19688
Closed

OC CLI: Environment variable with a DOT in them. #8771

gt-tech opened this issue May 6, 2016 · 15 comments · Fixed by #19688
Assignees
Labels
area/usability component/cli kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/P3

Comments

@gt-tech
Copy link

gt-tech commented May 6, 2016

I am creating a new application using "oc new-app" CLI command and need to pass environment variables, one of my environment variable happens to be of the format of a.b.c.d=value, please see exact command below.

I get an error:

error: environment variables must be of the form key=value: spring.cloud.consul.host=http://192.168.18.132
error: environment variables must be of the form key=value: spring.cloud.consul.port=18500

Version
oc version
oc v1.2.0-rc1
kubernetes v1.2.0-36-g4a3f9c5

Steps To Reproduce
  1. Create any application using "oc new-app" and try to pass an environment variable that looks like spring.cloud.consul.host=http://192.168.18.132

My sample command was -
oc new-app openshift/openshift/wildfly-100-centos7~https://codehub.myorg.com/my-lab/ose-sample-idp.git#master -e env=dev -e tenant=oid -e "spring.cloud.consul.host"="http://192.168.18.132" -e "spring.cloud.consul.port"="18500" -e MAVEN_ARGS="-s -f boot-war-pom.xml -am -pl api clean package install -Popenshift -DskipTests -B"

Current Result

Error on environment variables with DOT in them

Expected Result

With enclosed in quotes, it should work?

@mfojtik mfojtik added area/usability kind/bug Categorizes issue or PR as related to a bug. component/cli priority/P3 labels May 9, 2016
@mfojtik
Copy link
Contributor

mfojtik commented May 9, 2016

@smarterclayton this is pretty easy to fix in our CLI, but will require fix in k8s to allow dots in env vars. Do you have any other concerns about this except the variables wont export in bash? Also docker run -e foo.test=bar works, so I don't see the reason it should not work in k8s.

@bparees bparees self-assigned this Jul 7, 2016
@christian-posta
Copy link

Can't you just use FOO_BAR_COFFEE ? ditch the '.' characters since http://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names

@bparees
Copy link
Contributor

bparees commented Aug 5, 2016

closing since periods are not valid in env variable identifiers, at least in bash.

@bparees bparees closed this as completed Aug 5, 2016
@smarterclayton
Copy link
Contributor

Hold on - just because they're not in bash doesn't mean they aren't valid to pass to the container.

@smarterclayton smarterclayton reopened this Aug 5, 2016
@smarterclayton
Copy link
Contributor

We distinguish between Posix and Bash - it should be valid to define env vars with periods in them via the container interfaces in Kube and the OpenShift APIs. Some contexts we may not allow them to be set, but only if the only interface to them is bash.

@bparees
Copy link
Contributor

bparees commented Aug 5, 2016

@smarterclayton well k8s doesn't allow it, so unless we're going to get k8s to allow them, we can't fix this.

@bparees
Copy link
Contributor

bparees commented Aug 5, 2016

spec.template.spec.containers[0].env[0].name: Invalid value: "FOO.BAR": must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName"

@smarterclayton
Copy link
Contributor

Probably something we'll have to fix in Kube.

On Thu, Aug 4, 2016 at 11:38 PM, Ben Parees [email protected]
wrote:

spec.template.spec.containers[0].env[0].name: Invalid value: "FOO.BAR": must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName"


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8771 (comment),
or mute the thread
https:/notifications/unsubscribe-auth/ABG_pyUd-hsbekddUcptGoNOGSSdb81Bks5qcrArgaJpZM4IY1Rt
.

@smarterclayton
Copy link
Contributor

Please spawn a Kube issue.

On Thu, Aug 4, 2016 at 11:40 PM, Clayton Coleman [email protected]
wrote:

Probably something we'll have to fix in Kube.

On Thu, Aug 4, 2016 at 11:38 PM, Ben Parees [email protected]
wrote:

spec.template.spec.containers[0].env[0].name: Invalid value: "FOO.BAR": must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName"


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8771 (comment),
or mute the thread
https:/notifications/unsubscribe-auth/ABG_pyUd-hsbekddUcptGoNOGSSdb81Bks5qcrArgaJpZM4IY1Rt
.

@bparees
Copy link
Contributor

bparees commented Aug 5, 2016

@bparees bparees changed the title OC CLI: Environment variable with a DOT in them. [BLOCKED] OC CLI: Environment variable with a DOT in them. Aug 5, 2016
@liggitt liggitt added the blocked label Aug 5, 2016
@bparees bparees changed the title [BLOCKED] OC CLI: Environment variable with a DOT in them. OC CLI: Environment variable with a DOT in them. Aug 5, 2016
@maiconbaumx
Copy link

Any news about this issue? I'm having the same problem here.. I want to deploy an Apache Zuul from NetflixOSS, but, it appears to need a env variable with "dot", like this: origin.zuul.client.DeploymentContextBasedVipAddresses=HELLO-NETFLIX-OSS

https:/Netflix-Skunkworks/zerotodocker/wiki/Running-the-Images

@bparees
Copy link
Contributor

bparees commented Apr 26, 2017

it's blocked by the upstream issue i linked above: kubernetes/kubernetes#30120

i haven't seen any movement on that issue.

@xiaods
Copy link
Contributor

xiaods commented Oct 23, 2017

it'll only be available in 1.8.

@bparees bparees removed the blocked label Jan 18, 2018
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 18, 2018
@bparees
Copy link
Contributor

bparees commented May 10, 2018

looks like this is resolved so we might actually be able to fix this now: kubernetes/kubernetes#2707
/remove-lifecycle stale
/lifecycle frozen

@openshift-ci-robot openshift-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 10, 2018
@bparees bparees removed their assignment May 10, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 11, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 11, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 11, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 11, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 11, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 15, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 15, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 15, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 15, 2018
wozniakjan pushed a commit to wozniakjan/origin that referenced this issue May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability component/cli kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/P3
Projects
None yet
Development

Successfully merging a pull request may close this issue.