Bug 1270675 - oc run '--overrides' option doesn't work, giving "error: json: cannot unmarshal string into Go value of type int"
Summary: oc run '--overrides' option doesn't work, giving "error: json: cannot unmarsh...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-12 06:19 UTC by Xingxing Xia
Modified: 2015-10-16 07:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-15 19:57:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xingxing Xia 2015-10-12 06:19:38 UTC
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'

Comment 1 Fabiano Franz 2015-10-15 19:19:48 UTC
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} }'

Comment 2 Peter Ruan 2015-10-15 19:57:01 UTC
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


Note You need to log in before you can comment on or make changes to this bug.