Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1410361 - Value of env variable set from other resource can not be updated automatically while it's hidden for user
Summary: Value of env variable set from other resource can not be updated automaticall...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Jessica Forrester
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-05 10:01 UTC by XiaochuanWang
Modified: 2017-01-05 13:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-05 13:55:24 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description XiaochuanWang 2017-01-05 10:01:28 UTC
Description of problem:
Since env variable could be set from other resource like secret, the value is hidden which could be accept. if user updated the secret (adding/deleting data in key/value pairs), value of env variable should be updated automatically, but now it need to be set again by user.

Version-Release number of selected component (if applicable):
oc/openshift v1.5.0-alpha.1+04db561-37

How reproducible:
Always

Steps to Reproduce:
1. Create a secret: 
cat > secret.yaml << EOF
apiVersion: v1
kind: Secret
metadata:
   name: mysecret
data:
   data-1: dmFsdWUtMQ0K
   data-2: dmFsdWUtMg0KDQo=
EOF
# oc create -f secret.yaml 

2. Create app and set dc env from secret 
# oc process -f  https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json | oc create -f -
# oc set env --from=secret/mysecret dc/database

3. Check dc env from CLI and web-console
cli: # oc set env dc/database --list
web-console: browse/dc/database?tab=environment

4.Add another data of key/value to secret 
# oc edit secret/mysecret (add another data of key/value )
data:
   data-1: dmFsdWUtMQ0K
   data-2: dmFsdWUtMg0KDQo=
   data-3: dmFsdWUtMg0KDQo=
5. Check the env for dc again (repeat step3)

Actual results:
5. From web-console:
DATA_1 | Set to the key data-1 in secret mysecret
DATA_2 | Set to the key data-1 in secret mysecret
From CLI:
# DATA_1 from secret mysecret, key data-1
# DATA_2 from secret mysecret, key data-2

Expected results:
5 dc should update the env automatically
From web-console:
DATA_1 | Set to the key data-1 in secret mysecret
DATA_2 | Set to the key data-1 in secret mysecret
DATA_3 | Set to the key data-1 in secret mysecret
From CLI:
# DATA_1 from secret mysecret, key data-1
# DATA_2 from secret mysecret, key data-2
# DATA_3 from secret mysecret, key data-3

Additional info:

Comment 1 Jessica Forrester 2017-01-05 13:55:24 UTC
This is working as designed, set-env is just a helper that automatically adds the currently existing keys individually to the DC's env.

The behavior you are asking for is a new feature that is coming in kube/origin 1.6 where you can add an entire secret/config map as environment and the keys will all automatically be added when the pod is created.

We are starting work on what this will behave like in the UI as part of https://trello.com/c/gF238DYE but the work can not be finished until the API changes are available when origin is rebased on kube 1.6


Note You need to log in before you can comment on or make changes to this bug.