Bug 1280216
| Summary: | Setting env vars via Web UI not visible in the assemble phase of STI build (https://github.com/openshift/origin/issues/5817) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Miheer Salunke <misalunk> | ||||
| Component: | Management Console | Assignee: | Jessica Forrester <jforrest> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Yadan Pei <yapei> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 3.1.0 | CC: | aos-bugs, bleanhar, bparees, jialiu, jokerman, mmccomas, wsun, xtian | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2016-01-26 19:17:19 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: | |||||||
| Attachments: |
|
||||||
|
Description
Miheer Salunke
2015-11-11 08:50:04 UTC
There is no option to provide BuildConfig env variables via the webconsole when defining a new build. The GUI allows you to supply DeploymentConfig env variables. So this is not a bug. If you want the ability to define env variables via the GUI flow, this should be converted to an RFE. Fixed in https://github.com/openshift/origin/pull/5893 you can independently specify build env vars and deployment env vars in the console during create. The one thing to note is that build env vars are also available at runtime due to underlying system behavior. Verified on devenv-rhel7_2717
Lines in my .sti/bin/assemble scripts:
echo "---> Displaying ENV vars"
echo $(env)
ImageStream:
nodejs:0.10
1) On web console, create application with imageStream and sourceCode
2) On the creation page, set ENV vars in Build Configuration and Deployment Configuration
Environment Variables in Build Configuration are:
Name: TestBCOne Value:value1
Name: TestBCTwo Value:value2
Environment Variables in Deployment Configuration are:
Name: TestDCOne Value:dcvalue1
Name: TestDCTwo Value:dcvalue2
3) Create application
4) Check Build page
Environment Variables set in creation step are displayed in build page
5) Check Logs tab of Build page
Already on 'master'
---> Displaying ENV vars
MANPATH=/opt/rh/v8314/root/usr/share/man:/opt/rh/nodejs010/root/usr/share/man: ......TestBCTwo=value2 X_SCLS=v8314 nodejs010 ....TestBCOne=value1
---> Installing application source
---> Building your Node application from source
E1117 05:50:12.979093 1 util.go:85] npm info it worked if it ends with ok
.........
6) Check ENV vars in bc
# oc get bc -o yaml
source:
git:
ref: master
uri: https://github.com/yapei/nodejs-ex.git
type: Git
strategy:
sourceStrategy:
env:
- name: TestBCOne
value: value1
- name: TestBCTwo
value: value2
from:
kind: ImageStreamTag
name: nodejs:0.10
namespace: yapei-test
7) Check ENV vars in container
# oc rsh nodejs-ex-1-0qgk7
bash-4.2$ env | grep Test
TestDCOne=dcvalue1
TestBCTwo=value2
TestBCOne=value1
TestDCTwo=dcvalue2
bash-4.2$
Environment Variables defined on web console can be available in assemble phase of STI build, it works well
Will verify on Openshift Enterprise and Atomic Enterprise once merged on them Will check again once fix merged on OSE, change to "MODIFIED" Checked on 3.1.1.0 openshift v3.1.1.0 kubernetes v1.1.0-origin-1107-g4c8e6f4 etcd 2.1.2 This fix had been merged 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/RHSA-2016:0070 |