Bug 1986631

Summary: BuildConfig Environment tab: different errors when the form is not filled completely
Product: OpenShift Container Platform Reporter: Christoph Jerolimov <cjerolim>
Component: Dev ConsoleAssignee: Christoph Jerolimov <cjerolim>
Status: CLOSED ERRATA QA Contact: Abhinandan Das <abhindas>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: abhindas, aos-bugs, nmukherj
Target Milestone: ---   
Target Release: 4.9.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: 2021-10-18 17:42:48 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:
Bug Depends On:    
Bug Blocks: 1993236    

Description Christoph Jerolimov 2021-07-27 23:04:47 UTC
Description of problem:
When the user makes changes to a BuildConfig (or Pod) with the environment page or tab this could result in different errors:

Usability error: When the user doesn't enter a name this entries are just dropped when the form is saved.

Crash: When the user enters a name but do not enter a ConfigMap or Secret value the form crashs after saving. (The data are saved and the form will crash now when the user opens the tab.)


Version-Release number of selected component (if applicable):
4.9

How reproducible:
Always

Steps to Reproduce the usability error:
1. Open developer perspective
2. Navigate to Builds
3. Click on "Create BuildConfig" button
4. Just create the BuildConfig without additional changes
5. Switch to the "Environment" tab
6. Press "Add variable" or "Add from ConfigMap or Secret", enter an value or select a resource WITHOUT adding a name
7. Press "Save" (environment variable without a name is just dropped)

Steps to Reproduce the crash:
1. Open developer perspective
2. Navigate to Builds
3. Click on "Create BuildConfig" button
4. Just create the BuildConfig without additional changes
5. Switch to the "Environment" tab
6. Press "Add from ConfigMap or Secret", add a name but DO NOT selecting a ConfigMap or Secret
7. Press "Save"

Actual results:
1. Usability error: Environment variables without a name are just dropped
2. Crash: Crash 

Expected results:
1. Usability error: The name should be marked as required. The form should disable the create button when a value is entered or selected without a name.
2. Crash: No crash 

Additional info:
None

Comment 2 Abhinandan Das 2021-08-10 14:44:52 UTC
Verified on 

OpenShift version 4.9.0-0.nightly-2021-08-07-175228
Kubernetes version v1.21.1+8268f88
Channel stable-4.8
Cluster ID e9fa972c-364f-4e0d-a5f1-93d57e6adff6

Comment 5 errata-xmlrpc 2021-10-18 17:42:48 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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), 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/RHSA-2021:3759