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

"oc label --help output" is not enough to understand how to remove label. #5868

Closed
Jooho opened this issue Nov 12, 2015 · 5 comments
Closed
Assignees
Labels
area/documentation component/cli lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/P3

Comments

@Jooho
Copy link

Jooho commented Nov 12, 2015

Hi all,

The "oc label --help" output should also describe how to do this. In addition, there should probably be a "remove" argument to the "oc label" command for a more comprehensive user experience.

"-" option end of label key can remove the key but it is a little bit difficult to understand only with the --help output. Hence, adding "remove" is a good idea.

Thanks in advance.
Jooho Lee.

@0xmichalis
Copy link
Contributor

$ oc label --help
Update the labels on one or more resources

A valid label value is consisted of letters and/or numbers with a max length of 63
characters. If --overwrite is true, then existing labels can be overwritten, otherwise
attempting to overwrite a label will result in an error. If --resource-version is
specified, then updates will use this resource version, otherwise the existing
resource-version will be used.

Usage:
  oc label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version] [options]

Examples:
  # Update pod 'foo' with the label 'unhealthy' and the value 'true'.
  $ oc label pods foo unhealthy=true

  # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value.
  $ oc label --overwrite pods foo status=unhealthy

  # Update all pods in the namespace
  $ oc label pods --all status=unhealthy

  # Update pod 'foo' only if the resource is unchanged from version 1.
  $ oc label pods foo status=unhealthy --resource-version=1

  # Update pod 'foo' by removing a label named 'bar' if it exists.
  # Does not require the --overwrite flag.
  $ oc label pods foo bar-

Last example is about removing. I don't think we should add an extra flag since KEY- is supported but we may have to document it better?

@fabianofranz
Copy link
Member

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 5, 2018
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 7, 2018
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation component/cli lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/P3
Projects
None yet
Development

No branches or pull requests

6 participants