{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/6903","labels_url":"https://api.github.com/repos/openshift/origin/issues/6903/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/6903/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/6903/events","html_url":"https://github.com/openshift/origin/issues/6903","id":129797152,"number":6903,"title":"Processed templates:  Should never be invalid json encodings.","user":{"login":"jayunit100","id":826111,"avatar_url":"https://avatars.githubusercontent.com/u/826111?v=3","gravatar_id":"","url":"https://api.github.com/users/jayunit100","html_url":"https://github.com/jayunit100","followers_url":"https://api.github.com/users/jayunit100/followers","following_url":"https://api.github.com/users/jayunit100/following{/other_user}","gists_url":"https://api.github.com/users/jayunit100/gists{/gist_id}","starred_url":"https://api.github.com/users/jayunit100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayunit100/subscriptions","organizations_url":"https://api.github.com/users/jayunit100/orgs","repos_url":"https://api.github.com/users/jayunit100/repos","events_url":"https://api.github.com/users/jayunit100/events{/privacy}","received_events_url":"https://api.github.com/users/jayunit100/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-29T15:28:20Z","updated_at":"2016-01-29T15:30:27Z","closed_at":null,"body":"Im finding that in 3.1.1.6\r\n```ec2-user@ip-172-18-14-244 openshift_scalability]$ oc version\r\noc v3.1.1.6\r\nkubernetes v1.1.0-origin-1107-g4c8e6f4```\r\n\r\nIf I try to create the following invalid template:\r\n\r\n```\r\nsudo oc process -f ./content/deploymentConfigTemplate.json\r\n```\r\n\r\nis capable of creating a json file which is inconsumable via `oc` itself:\r\n\r\n```\r\n{\r\n    \"kind\": \"List\",\r\n    \"apiVersion\": \"v1\",\r\n    \"metadata\": {},\r\n    \"items\": [\r\n        {\r\n            \"apiVersion\": \"v1\",\r\n            \"data\": {\r\n                \"ca.crt\": \"asdf\",\r\n                \"token\": \"qweqrer\"\r\n            },\r\n            \"kind\": \"Secret\",\r\n            \"metadata\": {\r\n                \"labels\": {\r\n                    \"name\": \"na\"\r\n                }\r\n            },\r\n            \"type\": \"kubernetes.io/service-account-token\"\r\n        }\r\n    ]\r\n}\r\n```\r\nTL;DR --- I would say that,  `oc process` should ensure that a template's result is valid json before returning it.  I understand that due to annotations all schemas cant be validated maybe, but at a bare minimum, we should be returning json that is encoded properly or else, if not possible do to a bad template, we should die."},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/176816453","html_url":"https://github.com/openshift/origin/issues/6903#issuecomment-176816453","issue_url":"https://api.github.com/repos/openshift/origin/issues/6903","id":176816453,"user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T15:30:27Z","updated_at":"2016-01-29T15:30:27Z","body":"The attached snippet is valid JSON... "}}