Description of problem: Updated the annotation for one pod with --resource-version the command is `oc annotate pods nodejs-ex-1-mh39j description='my frontend running nginx' --resource-version=947` , but always got the prompt "error: --resource-version may only be used with a single resource". But in my command,I was updating the annotation on one resource. Version-Release number of selected component (if applicable): $ oc version oc v1.0.5-49-gf7b6723 kubernetes v1.1.0-alpha.0-1605-g44c91b1 How reproducible: Always Steps to Reproduce: 1.Get the resourceVersion of the pod $oc get pods nodejs-ex-1-mh39j -o yaml |grep resource kubernetes.io/created-by: '{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicationController","namespace":"wsuntest","name":"nodejs-ex-1","uid":"8f251832-4d5a-11e5-861c-22000baa04f0","apiVersion":"v1","resourceVersion":"809"}}' resourceVersion: "947" resources: {} 2.Update the annotation on one pod with --resource-version $ oc annotate pods nodejs-ex-1-mh39j description='my frontend running nginx' --resource-version=947 Actual results: 2.$ oc annotate pods nodejs-ex-1-mh39j description='my frontend running nginx' --resource-version=947 error: --resource-version may only be used with a single resource see 'oc annotate -h' for help. Expected results: 2.Should work well when I update the annotation on one pod with --resource-version. Additional info: Run `oc annotate -h`,could see: // Update pod 'foo' only if the resource is unchanged from version 1. $ oc annotate pods foo description='my frontend running nginx' --resource-version=1 --resource-version='': If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.
FYI, though the bug is a problem, it is found that the Type/Name format works: $ oc annotate pod --resource-version=1820 database-1-fi08h description='my anno' error: --resource-version may only be used with a single resource See 'oc annotate -h' for help and examples. $ oc annotate pod/database-1-fi08h --resource-version=1820 description='my anno' pod "database-1-fi08h" annotated $ oc get pod database-1-fi08h -o yaml | grep description description: my anno
Related PR: https://github.com/openshift/origin/pull/9917
Verified in: # openshift version openshift v1.3.0-alpha.2+0369166 kubernetes v1.3.0+57fb9ac etcd 2.3.0+git # oc annotate pod/hello-openshift --resource-version=1530 desc='my anno' pod "hello-openshift" annotated Issue is fixed.
# oc annotate pod hello-openshift --resource-version=1662 description='my anno' pod "hello-openshift" annotated Both formats "Type/Name" and "Type Name" work in oc annotate.