Bug 1510346

Summary: Secret of null key-value displays messy code when Reveal Secret
Product: OpenShift Container Platform Reporter: Xingxing Xia <xxia>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: medium    
Version: 3.7.0CC: aos-bugs, jokerman, mmccomas, spadgett
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, secrets with null values would display incorrectly when values were revealed on the secret details page. Now the web console will correctly display the secret key as having "No value."
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 22:21:49 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:
Attachments:
Description Flags
the messy code none

Description Xingxing Xia 2017-11-07 09:30:32 UTC
Created attachment 1348877 [details]
the messy code

Description of problem:
Secret of null key-value displays messy code when Reveal Secret

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

How reproducible:
Always

Steps to Reproduce:
1. $ oc secret new secretone /dev/null
2. Go to secret page of "secretone", click "Reveal Secret"
3. In Environment tab of DC page, select above secret under "Environment From" part, then click "View Details" on the right --> "Reveal Secret"

Actual results:
2 & 3: both display messy code, see attachment

Expected results:
2 & 3: display well

Additional info:

Comment 2 openshift-github-bot 2017-11-07 20:53:44 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/13b215c971758db8ba73ef1fefeba1abe4d12e0a
Bug 1510346 - Handle null secret values

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

https://github.com/openshift/origin-web-console/commit/eb4047d1b20a27e162b2abc1ae7d9b225ac69fd9
Merge pull request #2465 from spadgett/secret-value-null

Automatic merge from submit-queue.

Bug 1510346 - Handle null secret values

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

/kind bug
/assign @jwforres

Comment 4 Xingxing Xia 2017-11-08 10:05:18 UTC
Tested in v3.7.0-0.198.0, now does not show messy code, only shows empty box.
But, copy something like "aaaa" and click Copy to Clipboard button, it shows Copied, then paste somewhere, it is still "aaaa". Not sure if it is worthy to refine this?

Comment 5 Samuel Padgett 2017-11-08 13:06:08 UTC
For me, it doesn't copy anything. It keeps whatever was on my clipboard previously. Although arguably that is a bug, too.

Comment 6 Samuel Padgett 2017-11-08 13:11:42 UTC
Follow on PR that removes the copy to clipboard button when the value is empty:

https://github.com/openshift/origin-web-console/pull/2478

Comment 7 openshift-github-bot 2017-11-08 14:00:35 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/599890b25ae67749e802ccffc6fdcf49a506098d
Bug 1510346 - Don't let users copy empty secret value

Instead of using copy-to-clipboard with an empty value, show "No value" when a
secret value is null.

Follow on fix for https://bugzilla.redhat.com/show_bug.cgi?id=1510346

https://github.com/openshift/origin-web-console/commit/501c413f3f9925923d88af83f15cf0f18222a9b7
Merge pull request #2478 from spadgett/blank-secret

Automatic merge from submit-queue.

Bug 1510346 - Don't let users copy empty secret value

Instead of using copy-to-clipboard with an empty value, show "No value" when a
secret value is null.

Follow on fix for https://bugzilla.redhat.com/show_bug.cgi?id=1510346

/kind bug
/assign @jwforres

Comment 8 Xingxing Xia 2017-11-09 06:30:54 UTC
Thanks, verified in v3.7.4, now both step 2 and step 3 work well (step 2 shows No value without the copy button, step 3 shows empty box, it is OK for me). Regression test of other non-null secrets has no regression issue

Comment 11 errata-xmlrpc 2017-11-28 22:21:49 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/RHSA-2017:3188