Bug 1357107
| Summary: | Custom Image Environment Variables With '=' Character Are Truncated | |||
|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Steven Walter <stwalter> | |
| Component: | Management Console | Assignee: | Jessica Forrester <jforrest> | |
| Status: | CLOSED ERRATA | QA Contact: | Yadan Pei <yapei> | |
| Severity: | low | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 3.2.0 | CC: | aos-bugs, jforrest, jokerman, mmccomas, tdawson, trogers | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: |
Cause: During the Add to Project workflow when picking a source builder image, the environment variables coming from the builder image were being split into key value pairs using the '=' character, but only the first two parts were being kept as the key and value.
Consequence: Environment variable values that contained an '=' character were being truncated. In 3.2 this meant that an env var was getting stored that actually overrode the env var to the truncated version. In 3.3 and later this was just being shown visually since we no longer stored env vars on the deployment configuration that were already coming from the builder image.
Fix: The environment variable key and value are only split on the first '=' character and everything after the first one is considered part of the value.
Result: The environment variable key and value are correctly split and not truncated when the value contains a '=' character.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1429550 (view as bug list) | Environment: | ||
| Last Closed: | 2017-04-12 19:06:03 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
|
Description
Steven Walter
2016-07-15 18:58:32 UTC
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 |