Bug 1331665 - [userinterface_public_546]Cannot process yaml format in From File page
Summary: [userinterface_public_546]Cannot process yaml format in From File page
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-29 07:49 UTC by Xingxing Xia
Modified: 2016-09-19 13:50 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:50:18 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.