Red Hat Bugzilla – Bug 1272003
[devexp_public_692]Inconsistent warning if use letter in completionDeadlineSeconds between create from json file and oc edit
Last modified: 2015-10-23 04:00:39 EDT
Description of problem:
If edit completionDeadlineSeconds to letter like abc in buildconfig to save,below warning will appear:The edited file had a syntax error: unable to load "edited-file": json: cannot unmarshal string into Go value of type int64
But if set it to letter in json file, then create it with oc create or oc new-app, below waring appears which is not clear like above one:
error: invalid character 'a' looking for beginning of value
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. wget https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/build/sourcebuildconfig.json and change completionDeadlineSeconds to abc
2, Create with this file via oc create
3. Check the warning
Unclear warning appears.
It should be like unable to load "edited-file": json: cannot unmarshal string into Go value of type int64
The reason for that is when invoking oc edit you're actually editing yaml file which has slightly different syntax than json. Specifically there a difference how you specify strings vs numbers. The latter is defined in json without " (double quotes). That's why the error is different in both cases. When changing number to letters in json without adding double quotes you'll get validation error as this file is not valid json at all, but if you add double quotes around letter you'll get exactly the same warning as you have when doing oc edit.
Having said that, I'm closing this as not a bug.