Hide Forgot
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:
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 ?
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"
The PR has been merged, please use the master for testing.
Hi tested against devenv-rhel7_4117, now YAML format file could be process and created successfully Move to VERIFIED