-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update oc annotate to allow use of --resource-version flag with single rsrc #9917
Update oc annotate to allow use of --resource-version flag with single rsrc #9917
Conversation
[test] |
} | ||
|
||
// number of resources found | ||
numResources := len(rInfos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not correct, you need to use the Singular flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting 1 item back from oc get pods
should not trigger this behavior. resource.Builder tracks whether the user asks for oc get pods bar
via the Singular flag.
bf3fbd3
to
b039ed9
Compare
re[test] |
flake re[test] |
1 similar comment
flake re[test] |
re[test] |
…rsion flag with single rsrc
b039ed9
to
23b68f0
Compare
Evaluated for origin test up to 23b68f0 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6611/) |
@fabianofranz Could you please take a look? |
LGTM [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6611/) (Image: devenv-rhel7_4649) |
Evaluated for origin merge up to 23b68f0 |
fixes #9908
Upstream: kubernetes/kubernetes#29319
Related BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1257853
When using annotate with a
--resource-version
on a resource, such asoc annotate pod <pod_name> --resource-version=1820 description='myannotation'
, the command fails with the error:error: --resource-version may only be used with a single resource
.Upon printing the output of
resources
that the annotate command receives from cli args, it prints:Resources:[pod <pod_name>]
. In other words, it treats the name of the resource as a second resource. This PR addresses this issue by using the resource builder Singular flag to determine if only a single resource was passed.