Skip to content

Asymmetry in PolicyBinding naming upon creation and deletion #13549

Closed

Description

@methadata

When creating a policybinding within a project:

$ oc create policybinding my_policybinding

The actual name of the PolicyBinding object is $PROJECTNAME:$POLICYBINDINGNAME:default, as can be seen with:

$ oc get policybinding 
NAME                       ROLE BINDINGS                                                          LAST MODIFIED
:default                   admin, system:deployers, system:image-builders, system:image-pullers   2017-03-27 15:56:53 +0200 CEST
my_policybinding:default                                                                          0001-01-01 00:00:00 +0000 UTC

However, if I want to delete that PolicyBinding, I need to specify the name with :$POLICYBINDINGNAME:default (note the extra :default suffix).

It seems to me that both commands expect the same object (PolicyBinding) in an inconsistent way, ie: $POLICYBINDINGNAME for creation vs $POLICYBINDINGNAME:default for deletion.

Also, note that oc describe policybinding accepts both $PROJECTNAME:$POLICYBINDINGNAME:default and $PROJECTNAME:$POLICYBINDINGNAME

Thus, I suggest to make both calls consistent by:

  1. Having to specify :default when creating the PolicyBinding, or
  2. Not having to specify that suffix on deletion
Version

oc v1.4.1+3f9807a
openshift v1.4.1+3f9807a

Activity

  1. self-assigned this
    on Jun 26, 2017
  2. added a commit that references this issue on Aug 17, 2017
    edf3ff5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions