Bug 1402260

Summary: OpenShift webconsole template Edit YAML action still shows JSON format partially
Product: OpenShift Container Platform Reporter: Kenjiro Nakayama <knakayam>
Component: Management ConsoleAssignee: Jessica Forrester <jforrest>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: medium    
Version: 3.3.0CC: aos-bugs, erich, jforrest, jokerman, mmccomas, tdawson, yanpzhan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The object depth to which we would convert JSON format into YAML was limited. Consequence: After a certain point JSON notation would show up in the YAML editor. This was still valid YAML, but it was harder to read and edit. Fix: Removed the depth limitation during JSON to YAML conversion. Result: The entire contents that appears in Edit YAML will be converted from JSON format.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-12 19:17:44 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:
Attachments:
Description Flags
screen shot of JSON format inside YAML through Edit YAML action for tempalte(other Resources)
none
check-template none

Description Kenjiro Nakayama 2016-12-07 07:01:07 UTC
Created attachment 1228900 [details]
screen shot of JSON format inside YAML through Edit YAML action for tempalte(other Resources)

Description of problem:
===
OpenShift webconsole template Edit YAML action still shows JSON format partially.

Version-Release number of selected component (if applicable):
===
OCP 3.3

How reproducible(Steps to Reproduce):
===
1. oc create -f /usr/share/openshift/examples/xpaas-templates/eap64-sso-s2i.json
2. Goto console-> Resources-> Other Resources-> select Template-> eap64-sso-s2i-> Actions->Edit YAML

Actual results:
===
The template partially shows JSON format. Please see attached screenshot. (around livenessProbe and readinessProbe)

Expected results:
===
It should display with YAML format only.

Additional info:
===
Due to issue, users cannot copy&paste the template through web console.

Comment 1 Jessica Forrester 2016-12-07 15:14:18 UTC
JSON embedded in YAML is valid YAML.  There should be nothing wrong with using the template in this format. This is working as intended, once we get to a certain level of nested objects we have the editor switch to embedded JSON.

Comment 3 Jessica Forrester 2016-12-09 21:11:29 UTC
This was originally done because Edit YAML was in a modal dialog and had limited space. We can remove the restriction and have it fully parse into the block model.

Comment 4 openshift-github-bot 2016-12-09 22:09:37 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/bb8691174d7c7033a8dab17d8b47ad9bf73c1f9b
Bug 1402260 remove nesting limitation from json to yaml parsing

Comment 7 Troy Dawson 2017-01-20 23:31:33 UTC
This has been merged into ocp and is in OCP v3.5.0.7 or newer.

Comment 8 Yanping Zhang 2017-01-23 10:43:49 UTC
Created attachment 1243536 [details]
check-template

Comment 9 Yanping Zhang 2017-01-23 10:45:48 UTC
Tested on OCP v3.5.0.7.
1.Create template in project:
oc create -f origin/examples/sample-app/application-template-stibuild.json
2.From other resource page choose template "ruby-helloworld-sample", check edit yaml. There is no JSON embedded in YAML, and even update with JSON embedded in YAML and save, check edit yaml again, it's still in yaml format.

Are these the right steps to check the fix? I upload a screenshot "check-template" as well. If it's not enough, pls help point out the steps, thanks!

Comment 10 Jessica Forrester 2017-01-23 13:46:15 UTC
That sounds like the right verification steps

Comment 11 Yanping Zhang 2017-01-24 06:15:20 UTC
Thanks, Jessica.

Comment 13 errata-xmlrpc 2017-04-12 19:17:44 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-2017:0884