opencompose
opencompose copied to clipboard
Return better error in case of invalid input resource
This is how opencompose errors when invalid input resource is passed -
[opencompose]$ opencompose convert -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-custombuild.json --output-dir -
ERROR: could not find decoder for resource 'https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-custombuild.json': unsupported version ""
This is how oc errors when an invalid input resource is passed -
[opencompose]$ oc create -f https://raw.githubusercontent.com/redhat-developer/opencompose/master/examples/hello-nginx.yaml
error: unable to decode "https://raw.githubusercontent.com/redhat-developer/opencompose/master/examples/hello-nginx.yaml": Object 'Kind' is missing in '{"services":[{"containers":[{"image":"tomaskral/nonroot-nginx","ports":[{"port":8080}]}],"name":"helloworld"}],"version":"0.1-dev"}'
We should improve the error, like we should return the reason why the resource is invalid and also return the resource in part or full.
@containscafeine oc error is not visible, i think there seems to be some problem in formatting?
@surajssd fixed