Bug 1551991 - Should not allow update bc env from configmap/secret without update key
Summary: Should not allow update bc env from configmap/secret without update key
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.9.z
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-06 10:01 UTC by Yanping Zhang
Modified: 2018-08-09 22:14 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-08-09 22:13:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
update-env (62.59 KB, image/png)
2018-03-06 10:01 UTC, Yanping Zhang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2335 0 None None None 2018-08-09 22:14:25 UTC

Description Yanping Zhang 2018-03-06 10:01:53 UTC
Created attachment 1404719 [details]
update-env

Description of problem:
Add env on bc env tab using "Add Value from Config Map or Secret", select the first configmap and select key, after save successfully, update the env, in the "Select a resource" input, change the name from first configmap to the second configmap, but don't change the key in "Select key" input. Click "Save", it save successfully. It shouldn't save successfully.

Version-Release number of selected component (if applicable):
v3.9.2 

How reproducible:
Always

Steps to Reproduce:
1.Create app "phptest" from image php on web console. And create 2 configmap
2.On bc "phptest" env tab, add env by "Add Value from Config Map or Secret", choose the first configmap, select a key, click "Save".
3.Update the env, change the first configmap to the second configmap, but don't change the key, click "Save'.
4.Add other normal value again.

Actual results:
2.Env was added successfully.
3.Env was update successfully. But the key part is empty.
4.The "Save' button is disabled, could not add new env now.

Expected results:
3.Should forbid updating the env without update the key. 


Additional info:
Same update action on dc env tab is forbidden, and has error info:
Reason: DeploymentConfig "hello-openshift" is invalid: spec.template.spec.containers[0].env[0].valueFrom.configMapKeyRef.key: Required value

Comment 2 openshift-github-bot 2018-03-06 14:56:18 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/0b38b75f3d8258cb88c4564846b9954fd9abc44e
Bug 1551991 - Make env name required when valueFrom item selected

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1551991

https://github.com/openshift/origin-web-console/commit/0051b1fbb88133b5c441fc5b36c53ad6435c3150
Merge pull request #2873 from spadgett/key-required-value-from

Automatic merge from submit-queue.

Bug 1551991 - Make env name required when valueFrom item selected

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1551991

/assign @rhamilto

Comment 3 Samuel Padgett 2018-03-06 14:59:42 UTC
3.9 fix: https://github.com/openshift/origin-web-console/pull/2876

Comment 5 Yadan Pei 2018-03-09 06:55:41 UTC
Build env updates recording: http://recordit.co/yH7gbrzOm3
Deployment env updates recording: http://recordit.co/JkmezX46Y2

We could see when changing configmap name without re-selecting keys referenced, it will throw error for deployment, but didn't give error message for builds.

Today checked on v3.9.4(already includes the fix PR #2876)
[yapei@dhcp-140-3 origin-web-console-server]$ git log --pretty="%h %cd - %s (%an)" --date=local atomic-openshift-web-console-3.9.4-1 -1
8f043688 Fri Mar 9 06:27:23 2018 - bump origin-web-console 026c62a (Justin Pierce)
[yapei@dhcp-140-3 origin-web-console]$ git log --pretty="%h %cd - %s"   026c62a | grep '#2876'
a27297d0 Tue Mar 6 07:46:41 2018 -0800 - Merge pull request #2876 from openshift-cherrypick-robot/cherry-pick-2873-to-enterprise-3.9

The issue reported still exists.

The fix in #2876 ensures we must set env name when valueFrom is selected, but it's a different issue.

Comment 6 Samuel Padgett 2018-03-09 13:39:03 UTC
Ah, I only fixed the bug where you could select a config map without typing in the env var name. I see now there's a second problem.

Comment 7 Samuel Padgett 2018-03-09 21:06:46 UTC
Follow up fix: https://github.com/openshift/origin-web-console/pull/2888

Comment 8 openshift-github-bot 2018-03-12 16:11:30 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/26b69690d05d22e70eb6226850a260d7e9e0077b
Bug 1551991 - Correctly clear key when another valueFrom resource selected

In our key/value editor, correctly clear the valueFrom key when a different
resource reference is selected.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1551991

https://github.com/openshift/origin-web-console/commit/41f70ae4eed8ca12fb88ad20effeb823d90053e8
Merge pull request #2888 from spadgett/bc-value-from-no-key

Automatic merge from submit-queue.

Bug 1551991 - Correctly clear key when another valueFrom resource selected

In our key/value editor, correctly clear the valueFrom key when a different
resource reference is selected.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1551991
/assign @benjaminapetersen

Comment 9 Samuel Padgett 2018-03-12 16:34:57 UTC
Changes have merged to the master branch.

3.9.z fix: https://github.com/openshift/origin-web-console/pull/2889

Comment 11 Yadan Pei 2018-05-04 08:42:42 UTC
Fixes has been merged in v3.9.27


1. Create two configmaps, configmap1 and configmap2
2. Add one key of configmap1 as build env
3. Update build env and select a different resource configmap/configmap2, it will clear keys info, user has to re-select keys in configmap/configmap2 to save the changes.

This is working as expected

QE could verify when move to ON_QA

Comment 14 Yanping Zhang 2018-07-26 07:30:47 UTC
According to Comment 11, the bug has been fixed, move it to Verified.

Comment 16 errata-xmlrpc 2018-08-09 22:13:46 UTC
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-2018:2335


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