Bug 1368917

Summary: It's better to remove blank env name/value when BC has no env vars defined
Product: OKD Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: bpeterse
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, jforrest, mmccomas
Target Milestone: ---   
Target Release: ---   
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: 2016-09-19 13:54:26 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 Yadan Pei 2016-08-22 06:13:52 UTC
Description of problem:
When saving buildconfig changes, validation checking on blank env name/value will fail, this will block us from save updates successfully, it's better to remove blank env name/value row, user could click "Add environment variable" to add

Version-Release number of selected component (if applicable):
openshift v1.3.0-alpha.3+7b3e38d
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git

How reproducible:
Always

Steps to Reproduce:
1.Create a ruby app without environment variables
$ oc new-build openshift/ruby:latest --code=http://github.com/openshift/ruby-hello-world.git
2.Access BuildConfig edit page
3.Didn't change anything, only update Run Policy from 'Serial' to 'Serial latest only'

Actual results:
3. It will give error info:
< An error occurred updating the build ruby-hello-worldBuild ConfigBuildConfig "ruby-hello-world" is invalid: spec.strategy.sourceStrategy.env[0].name: Required value >
Changes could not be saved correctly, you have to delete the blank env name/value row to save the changes

Expected results:
3. It's better to remove the blank env name/value when BC has no environment variables, user could click "Add environment variable" to add. 

Additional info:

Comment 1 Yadan Pei 2016-08-22 06:18:45 UTC
This is general issue for key-value-editor

Comment 2 Jessica Forrester 2016-08-22 12:20:35 UTC
We chose to have the blank row there for ease of adding your first key/value pair.  The real issue is that a completely blank row should not block form validation in the BC GUI editor, Route editor / creator, or create from image / template.  Ben please check any of the forms using the KVE other than the Enivronment tabs.

Comment 3 bpeterse 2016-08-22 13:35:04 UTC
Will do.

Comment 4 bpeterse 2016-08-22 20:34:14 UTC
PR merged that should fix this: https://github.com/openshift/origin-web-console/pull/445

Comment 5 Jessica Forrester 2016-08-22 23:02:32 UTC
and in origin in https://github.com/openshift/origin/pull/10580

Comment 6 Yadan Pei 2016-08-23 03:04:28 UTC
Checked against latest origin-web-console(manually vendor into origin since origin PR is not merged yet)

On edit/builds page, blank key-value-edtior will not block saving other changes.


Move to VERIFIED