Bug 1331665

Summary: [userinterface_public_546]Cannot process yaml format in From File page
Product: OKD Reporter: Xingxing Xia <xxia>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
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: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 13:50:18 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 Xingxing Xia 2016-04-29 07:49:58 UTC
Description of problem:
In the tab 'From File' of create page, upload yaml file (or paste its content) then click 'Create', it fails to process and show message: Failed to process the resource. But it works well for json file.

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

How reproducible:
Always

Steps to Reproduce:
1. oc login and create project
2. Prepare resource files with yaml/json format in local PC
$ wget https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json
$ oc create -f application-template-stibuild.json
$ oc export -f application-template-stibuild.json -o yaml > template.yaml

3. Login to Openshift web console, click Add to project --> From File --> Browse, select the yaml file, upload, then click 'Create'
4. Repeat step 3, but upload json file, then Create

Actual results:
3. It shows: Failed to process the resource
4. It succeeds to pop up a window and let you select create resources or template

Expected results:
3. Should deal with yaml successfully

Additional info:

Comment 1 Jakub Hadvig 2016-05-02 11:25:49 UTC
So the problem is that the YAML can not parse the outputted YAML since its not a valid YAML. When you try to paste the the outputted yaml into any online YAML validator you will get its invalid. The parsing of a valid YAML will work without any issues.
Eg. after step 2. check the yaml output and check lines 7.-8., there you can see that the 'description' is split into two lines. Also the indentation is wrong, since from line 14. should be an extra indentation till end of the file. Probably the will be more issues.

The thing here is that then you create a Template from the exported YAML, OpenShift will create it without any error/warning, even with problems mentioned before.

So the issue itself is in the YAML library that cannot parse the YAML. Shall we try to replace the YAML lib with some other, or do a better error handling ?

Comment 2 Xingxing Xia 2016-05-04 05:37:40 UTC
Seems not concern "invalid" yaml. Tried other yaml file such as:
$ cat pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: hello-openshift
spec:
  containers:
  - image: openshift/hello-openshift
    name: hello-openshift
    ports:
    - containerPort: 8080
      protocol: TCP

And https://raw.githubusercontent.com/openshift/origin/master/examples/project-quota/pod-without-resources.yaml

Also cannot process these yaml with message "Failed to process the resource"

Comment 3 Jakub Hadvig 2016-05-04 07:44:16 UTC
The PR has been merged, please use the master for testing.

Comment 4 Yadan Pei 2016-05-06 03:23:01 UTC
Hi tested against devenv-rhel7_4117, now YAML format file could be process and created successfully

Move to VERIFIED