Bug 1402468

Summary: [RFE] Environment Variables in BuildConfig
Product: OpenShift Container Platform Reporter: Steven Walter <stwalter>
Component: RFEAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: Xiaoli Tian <xtian>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: aos-bugs, bparry, jokerman, mepley, mmccomas, rromerom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
documented RFE, not a bug.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-26 14:27:06 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-12-07 15:45:00 UTC
1. Proposed title of this feature request
Environment Variables in BuildConfig

3. What is the nature and description of the request?
"I want to set an environment variable from a secret in a Build Config"
 

4. Why does the customer need this? (List the business requirements here)
Customer wants to be able to set secure information like passwords into environment variables, and does not want them as plaintext outside of the pod (thus needs the secret)
 

5. How would the customer like to achieve this? (List the functional requirements here)
They want to set in buildconfig something like:

strategy:
  sourceStrategy:
    env:
    - name: MAVEN_OPTS
       valueFrom:
          secretKeyRef:
            key: mvnopts
            name: mvnopts

Currently when doing this they get:

* spec.strategy.sourceStrategy.env[2].valueFrom: Invalid value: {"secretKeyRef":{"Name":"mvnopts","key":"mvnopts"}}: valueFrom is not supported in build strategy environment variables
 

6. For each functional requirement listed in question 5, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
Make a bc referencing a secret for valueFrom
 

7. Is there already an existing RFE upstream or in Red Hat bugzilla?
http://kubernetes.io/docs/user-guide/secrets/#using-secrets-as-environment-variables

10. List any affected packages or components.
builds, secrets

Comment 3 Michael Epley 2017-05-26 04:26:24 UTC
Should also support config map references; currently fails with similar error:

(spec.strategy.dockerStrategy.env[1].valueFrom: Invalid value: {"configMapKeyRef":{"Name":"name","key":"key"}}: valueFrom is not supported in build strategy environment variables

Works for standard env values, i.e. spec.strategy.dockerStrategy.env[1].value

Comment 4 Ben Parees 2017-05-26 04:34:34 UTC
That is covered in the referenced trello card.

Comment 5 alex toderita 2017-06-26 12:07:11 UTC
Would you have any updates regarding this feature request?

Comment 6 Ben Parees 2017-06-26 14:27:06 UTC
for everything except pipeline strategies, this is being delivered as part of v3.6.