openshift / origin

Conformance test suite for OpenShift
http://www.openshift.org
Apache License 2.0
8.47k stars 4.7k forks source link

oc run --env rejects values with a '=' embedded in value. #7326

Open GrahamDumpleton opened 8 years ago

GrahamDumpleton commented 8 years ago

Appears that you cannot supply environment variables via --env option of oc run which have a '=' embedded within the value.

$ oc run busybox-shell --image busybox --env VAR='A=B'
error: invalid env: VAR=A=B

This was with oc version of:

oc v1.1.1
kubernetes v1.1.0-origin-1107-g4c8e6f4

A quick test of oc new-app didn't appear to have same issue.

$ oc new-app --dry-run busybox --env VAR='A=B'
--> Found Docker image c1bc9b4 (4 weeks old) from Docker Hub for "busybox"
    * An image stream will be created as "busybox:latest" that will track this image
    * This image will be deployed in deployment config "busybox"
    * [WARNING] Image "busybox" runs as the 'root' user which may not be permitted by your cluster administrator
    * The image does not expose any ports - if you want to load balance or send traffic to this component
      you will need to create a service with 'expose dc/busybox --port=[port]' later
--> Creating resources with label app=busybox ...
--> Success (DRY RUN)

Or at least it wasn't rejected straight away on doing a --dry-run.

GrahamDumpleton commented 8 years ago

Perhaps related:

$ oc run busybox-shell --image busybox --env VAR='"' --dry-run
Error: invalid argument "VAR=\"" for --env: line 1, column 4: bare " in non-quoted-field

This latter one only occurs with oc client for 1.1.1. It doesn't appear in oc client for 1.1. The initial problem above with '=' appears with both.

juanvallejo commented 7 years ago

Unable to replicate this issue with version

oc v1.3.0-rc1+df345fa-1358-dirty
kubernetes v1.4.0+776c994
features: Basic-Auth

Server https://10.13.137.149:8443
openshift v1.3.0-rc1
kubernetes v1.3.0+52492b4

I can successfully run the command causing this issue:

$ oc run busybox-shell --image busybox --env VAR='A=B'
deploymentconfig "busybox-shell" created

closing this issue, please re-open if you're still able to replicate

GrahamDumpleton commented 7 years ago

Please comment on the secondary issue I raised. That still occurs:

$ oc run busybox-shell --image busybox --env VAR='"' --dry-run
Error: invalid argument "VAR=\"" for --env: line 1, column 4: bare " in non-quoted-field

Version:

$ oc version
oc v1.3.1
kubernetes v1.3.0+52492b4
features: Basic-Auth

Server https://localhost:8443
openshift v1.3.1
kubernetes v1.3.0+52492b4
openshift-bot commented 6 years ago

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

GrahamDumpleton commented 6 years ago

/lifecycle frozen

GrahamDumpleton commented 6 years ago

Problem still occurs on 3.7.

$ oc run busybox-shell --image busybox --env VAR='"' --dry-run
Error: invalid argument "VAR=\"" for --env: line 1, column 4: bare " in non-quoted-field