Red Hat Bugzilla – Bug 1357107
Custom Image Environment Variables With '=' Character Are Truncated
Last modified: 2017-07-24 10:11 EDT
Description of problem: When using a custom image and setting an environment variable with an '=' character in the value, the environment variable is truncated out. Version-Release number of selected component (if applicable): OSE 3.2.0, OSE 3.1.1, Docker 1.9.1 How reproducible: Reproduced in 3.2.0 with Docker 1.9.1, reported but untested with OSE 3.1.0 Steps to Reproduce: Make a docker file with contents: ~~~ FROM registry.access.redhat.com/jboss-eap-6/eap64-openshift:latest ENV JVM_ARG_TEST_CASE="-Dname1=value1 -Dname2=value2" ~~~ docker build docker tag <resulting image> <internal registry ip>:<port>/openshift/testimage docker push <ip>:<port>/openshift/testimage Go to web console, "add to project", select the image stream previous steps created. Then go to "Show advance routing, build and deployment options", look at environment variables. Actual results: JVM_ARG_TEST_CASE -Dname1 Expected results: JVM_ARG_TEST_CASE -Dname1=value1 -Dname2=value2 Additional info: There is a way for this particular use case using CATALINA_OPTS_APPEND as discussed in http://post-office.corp.redhat.com/archives/openshift-sme/2016-July/msg00201.html but the issue could occur for other potential cases
Jessica starting w/ you, but I guess it's also possible the image metadata itself is incorrect/being stripped, in which case it should go to platform management.
I'll check into this.
@bpeterse looking at the source I can see we definitely have a bug here, we are splitting the dockerImageMetadata.Config.Env on "=" and assuming that will only result in two parts. See createFromImage.js where we set scope.DCEnvVarsFromImage Please fix that, and then we will need to determine if that is the only issue or if there is also a problem with the metadata being imported.
This has been merged into ocp and is in OCP v3.5.0.7 or newer.
Tested with OCP v3.5.0.7 and docker 1.12.6 1.Build images Make a docker file with contents: ~~~ FROM registry.access.redhat.com/jboss-eap-6/eap64-openshift:latest ENV JVM_ARG_TEST_CASE="-Dname1=value1 -Dname2=value2" ~~~ docker build docker tag <resulting image> <internal registry ip>:<port>/openshift/testimage docker push <ip>:<port>/openshift/testimage 2.Visit https://<master>:<port>/console/project/<your_project>/create/fromimage?imageStream=testimage&imageTag=test&namespace=openshift 3.Click to Show advanced options 4.Click "Show Image Environment Variables" in Deployment Configuration section, environment variables are shown as JVM_ARG_TEST_CASE -Dname1=value1 -Dname2=value2 Move to VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0884