Bug 1270675
| Summary: | oc run '--overrides' option doesn't work, giving "error: json: cannot unmarshal string into Go value of type int" | ||
|---|---|---|---|
| Product: | OKD | Reporter: | Xingxing Xia <xxia> |
| Component: | oc | Assignee: | Fabiano Franz <ffranz> |
| Status: | CLOSED NOTABUG | QA Contact: | Wei Sun <wsun> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.x | CC: | aos-bugs, mmccomas, pruan |
| Target Milestone: | --- | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-10-15 19:57:01 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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
|
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'