Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: oc run '--overrides' doesn't work, giving "error: json: cannot unmarshal string into Go value of type int" Version-Release number of selected component (if applicable): oc/openshift v1.0.6-519-g86b63be kubernetes v1.1.0-alpha.1-653-g86b4e77 How reproducible: Always Steps to Reproduce: 1. Start openshift 2. oc login, create new project, and then run: $ oc run webapp --image=training/webapp --overrides='{ "apiVersion": "v1", "spec": { "replicas": "2"} }' Actual results: 2. Failed with error: error: json: cannot unmarshal string into Go value of type int Expected results: 2. Should succeed Additional info: 'oc run -h' has the example illustrating '--overrides'
From the error message it seems to me that you are providing "replicas" as a string in the json, while it expects an integer. Without the commas it should work: oc run webapp --image=training/webapp --overrides='{ "apiVersion": "v1", "spec": { "replicas": 2} }'
confirmed with Fabiano's comment with an actual run. oc run webapp1 --image=training/webapp --overrides='{ "apiVersion": "v1", "spec": { "replicas": 2} }' --config=/Users/pruan/workdir/dhcp-16-138-pruan/ose_user1.kubeconfig NAME TRIGGERS LATEST VERSION webapp1 ConfigChange 0