Bug 1633285

Summary: No secrets dropdown in buildconfig edit page if any of the secrets has no data
Product: OpenShift Container Platform Reporter: Sergio G. <sgarciam>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.9.0CC: aos-bugs, jhadvig, jokerman, mmccomas, spadgett, wsun, yanpzhan, yapei
Target Milestone: ---   
Target Release: 3.9.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Accessing undefined key on the secrets object. Consequence: Javascript runtime error caused by accessing undefined key on the object. Fix: Using lodash _.get() method which wont error out if accessing undefined key on the secrets object. Result: The secrets dropdown is visible event if there is secret without any data
Story Points: ---
Clone Of:
: 1656657 1656659 1656660 1656661 (view as bug list) Environment:
Last Closed: 2018-12-13 19:27:05 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: 1656657, 1656660    
Attachments:
Description Flags
Screenshot where the dropdown is missing
none
Javascript error in the browser console none

Description Sergio G. 2018-09-26 15:19:59 UTC
Created attachment 1487301 [details]
Screenshot where the dropdown is missing

Description of problem:
When editing a buildConfig using the UI, there's no secrets dropdown under some circumstances.

Version-Release number of selected component (if applicable):
3.7  - not affected
3.9  - affected
3.10 - affected

How reproducible:
Always

Steps to Reproduce:
$ oc new-project sgarcia-test1
$ oc new-app https://github.com/openshift/nodejs-ex.git
$ cat >secret.yaml <<EOF
apiVersion: v1
data:
kind: Secret
metadata:
  name: my-secret
type: Opaque
EOF
$ oc create -f secret.yaml

Actual results:
Can't see the secrets dropdown (attachment 1 [details]) and there's an error in the developer console appears (attachment 2 [details]).

Expected results:
See the secrets dropdown

Comment 1 Sergio G. 2018-09-26 15:20:50 UTC
Created attachment 1487302 [details]
Javascript error in the browser console

Comment 6 Yanping Zhang 2018-11-29 03:35:04 UTC
Checked on OCP 3.9 env and 3.10 env with version:
--------------------------
openshift v3.9.55
kubernetes v1.9.1+a0ce1bc657
--------------------------
openshift v3.10.79
kubernetes v1.10.0+b81c8f8
--------------------------

Steps to test:
1. Create app in project:
# oc new-app https://github.com/openshift/nodejs-ex.git
2. Create secret in project:
$ cat >secret.yaml <<EOF
apiVersion: v1
data:
kind: Secret
metadata:
  name: my-secret
type: Opaque
EOF
$ oc create -f secret.yaml
3. Check on bc edit page, there is secret dropdown list under each type of secret, eg, "Source Secret", "Pull Secret", "Push Secret", "Build Secret".

The bug has been fixed on OCP 3.9 and OCP 3.10.

Comment 10 Yadan Pei 2018-12-06 02:12:46 UTC
Move to VERIFIED per comment 6 and comment 9

Comment 12 errata-xmlrpc 2018-12-13 19:27:05 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:3748

Comment 13 openshift-github-bot 2019-01-24 16:16:41 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/e2ba330ef0dd3fe227367509798ef0ab7f5ad368
Bug 1633285 - No secrets dropdown in buildconfig edit page if any of the secrets has no data

https://github.com/openshift/origin-web-console/commit/4534d447667d928ed08b8eed3ce7b1a450d9a2d8
Merge pull request #3083 from jhadvig/BZ1633285-master

Bug 1633285 - No secrets dropdown in buildconfig edit page if any of the secrets has no data