Bug 1502914

Summary: Deploymentconfig page failed to add, update, delete and move order for environment variables
Product: OpenShift Container Platform Reporter: XiaochuanWang <xiaocwan>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.7.0CC: aos-bugs, jfiala, jokerman, mmccomas, rcwwilliams07
Target Milestone: ---Keywords: Regression
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-31 12:56:51 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:

Description XiaochuanWang 2017-10-17 03:39:17 UTC
Description of problem:
From deploymentconfig page, try to add environment variables and it pop up error. After added environment variables by cli, try to update and delete it, it also pop up error.

Version-Release number of selected component (if applicable):
Openshift v3.7.0-0.155.0

How reproducible:
Always

Steps to Reproduce:
1. # oc run mydc --image=aosqe/hello-openshift
2. Go to dc env page "/console/project/myproject/browse/dc/mydc?tab=environment", then add a pair of env variable and click "Save"
3. Added env variable by cli "oc set env dc/mydc -e DCone=dcvalue1 DCtwo=dcvalue2" then refresh browser
4. Try to update, delete, move order for environment variables

Actual results:
2. Error message shows as below """
An error occurred updating environment variables for deployment config mydc.
Reason: DeploymentConfig "mydc" is invalid: spec.template.spec.containers[0].envFrom: Invalid value: "": must specify one of: `configMapRef` or `secretRef`
"""

4. Error message shows in any updating operation as below """
An error occurred updating environment variables for deployment config mydc.
Reason: DeploymentConfig "mydc" is invalid: spec.template.spec.containers[0].envFrom: Invalid value: "": must specify one of: `configMapRef` or `secretRef`
"""

Expected results:
Web console should add/update/delete/move order for env variables successfully.

Additional info:

Comment 2 openshift-github-bot 2017-10-17 15:18:22 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/80b9671b14ebf50a23bd2bb3e4ea7e813a4f072d
Bug 1502914 - Compact empty envFrom entries

Don't include empty `envFrom` entries when updating environment
variables. This causes a validation failure.

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

https://github.com/openshift/origin-web-console/commit/de72b67bedeaa3ac67dfd51d818bbc49c4c939af
Merge pull request #2275 from spadgett/fix-edit-env

Automatic merge from submit-queue.

Bug 1502914 - Compact empty envFrom entries

Don't include empty `envFrom` entries when updating environment variables. This causes a validation failure.

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

@jwforres PTAL

Comment 4 XiaochuanWang 2017-10-31 05:54:20 UTC
This is verified on Openshift  v3.7.0-0.184.0
Environment variables could be updated successfully.