Description of problem: When replace resource with --force option,will delete resource, but not re-create with error 'the resource exists'. $oc replace -h --force=false: Delete and re-create the specified resource Version-Release number of selected component (if applicable): devenv-fedora_2940 oc v1.1-428-ged29520 kubernetes v1.1.0-origin-1107-g4c8e6f4 How reproducible: always Steps to Reproduce: 1.Create a hello-openshift pod 2.Output pod to a json file $oc get pod hello-openshift -o json > pod.json 3.Replace resource with --force after modify label info in pod.json $oc replace -f pod.json --force $oc get pod Actual results: $oc replace -f pod.json --force pod "hello-openshift" deleted Error from server: pods "hello-openshift" already exists $ oc get pods $ Expected results: Should delete and re-create resource Additional info:
Reassigning, the 'replace' cmd comes from upstream.
Not a 3.1.1 blocker. There is a workaround: 'oc delete' your resource, use 'oc get' to confirm it's deleted, then 'oc create' it. Alternatively, you can try specifying both --cascade=true and --grace-period=0 (cascade should not be required, but there is a bug in the replace code that makes it required right now). The appropriate fix is to modify the replace code to: - set the grace period to 0 by default when force=true - not require cascade=true when using grace period w/pods - pass grace period to the delete request when cascade=false
I will look to put together an upstream PR.
Modifying severity to low as its not a blocker for the release.
https://bugzilla.redhat.com/show_bug.cgi?id=1285702 relevant
Old bug with a workaround discussed in comment #2. If there are any related issues in 4.x, please open a new bug.