Skip to content
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

cannot delete role via selector filter #12450

Closed
jmazzitelli opened this issue Jan 11, 2017 · 1 comment
Closed

cannot delete role via selector filter #12450

jmazzitelli opened this issue Jan 11, 2017 · 1 comment
Assignees
Labels
area/usability component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P2

Comments

@jmazzitelli
Copy link

Try to "oc delete" a clusterrole using --selector and it doesn't work.

Version

$ oc version
oc v1.5.0-alpha.0+3b2bbe5
kubernetes v1.4.0+776c994
features: Basic-Auth

Server https://192.168.1.15:8443
openshift v1.5.0-alpha.0+3b2bbe5
kubernetes v1.4.0+776c994

Steps To Reproduce

Create a cluster role called "my-role" with a label "my-label-name=my-label-value" and try to delete it with --selector:

$ oc get --show-kind --show-labels clusterrole my-role
NAME LABELS
clusterroles/my-role my-label-name=my-label-value

$ oc delete clusterroles --selector my-label-name=my-label-value
No resources found

$ oc get --show-kind --show-labels clusterrole my-role
NAME LABELS
clusterroles/my-role my-label-name=my-label-value

But if I just delete it "by name" it works:

$ oc delete clusterroles my-role
clusterrole "my-role" deleted

$ oc get --show-kind --show-labels clusterrole my-role
No resources found.
Error from server: clusterrole "my-role" not found

Current Result

Does not delete the role.

Expected Result

Deletes the role.

Additional Information

See mailing list thread where Clayton thinks this might not have been implemented yet:

https://lists.openshift.redhat.com/openshift-archives/users/2017-January/msg00039.html

Just to make sure I had the syntax correct, I tried to use the following arguments but nothing works:

  • --selector my-label-name=my-label-value
  • --selector=my-label-name=my-label-value
  • -l my-label-name=my-label-value
@jmazzitelli
Copy link
Author

Are you sure that PR fixes this problem? Because I just pulled master, rebuilt, and it still doesn't work - I cannot delete the clusterrole using --selector (note: this is for DELETING a clusterrole, not just merely listing it - the PR mentions "when listing clusterroles" but this issue is really for deleting clusterroles):

$ pwd
/home/mazz/source/go/openshift/src/github.com/openshift/origin/_output/local/bin/linux/amd64
$ git rev-parse HEAD
5211b11bcc90fb3c5e2b1a27fe841e9ca1771f6f
$ ls -l oc
-rwxrwxr-x 1 mazz mazz 91172288 Jan 14 15:44 oc
$ ./oc get --show-kind --show-labels clusterrole hawkular-openshift-agent
NAME                                    LABELS
clusterroles/hawkular-openshift-agent   metrics-infra=agent
$ ./oc delete clusterroles --selector metrics-infra=agent
No resources found
$ ./oc get --show-kind --show-labels clusterrole hawkular-openshift-agent
NAME                                    LABELS
clusterroles/hawkular-openshift-agent   metrics-infra=agent
$ ./oc version
oc v1.5.0-alpha.1+5211b11-245
kubernetes v1.5.0-beta.2+225eecc
features: Basic-Auth

Server https://192.168.1.15:8443
openshift v1.5.0-alpha.1+71d3fa9
kubernetes v1.4.0+776c994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P2
Projects
None yet
Development

No branches or pull requests

3 participants