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

Add categories to kubectl api-resources wide output and add --categories flag #111096

Merged

Conversation

brianpursley
Copy link
Member

@brianpursley brianpursley commented Jul 12, 2022

What type of PR is this?

/kind feature
/kind cleanup

What this PR does / why we need it:

Some resources have one or more categories to which they belong (ie. all, api-extensions). However, there is not a good way for people to discover those categories.

Additionally, this leads to confusion about commands like kubectl get all where it seems that the all is some kind of magic keyword, when in reality it is simply a category name that is being resolved.

This PR does the following:

  • Adds a "Categories" column to the wide output (kubectl api-resources -o wide)
  • Adds a --categories flag that lets you filter on category, just like you can filter on verb.
  • Changes how the verbs column is displayed, so that it is comma-separated, which is how short names are displayed already and how categories will now be displayed, so every multi-value column will be displayed consistently.

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added categories column to the `kubectl api-resources` command's wide output (`-o wide`).
Added `--categories` flag to the `kubectl api-resources` command, which can be used to filter the output to show only resources belonging to one or more categories.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Add categories column to show which categories each
resource type belongs to.

Add --categories flag to allow filtering the output to
a specific category or set of categories.

Change verbs column to display verbs in a comma-delimited
list, consistent with other multi-value columns in the output.
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 12, 2022
@brianpursley
Copy link
Member Author

/hold
for review

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 12, 2022
@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 12, 2022
@brianpursley
Copy link
Member Author

/retest

1 similar comment
@brianpursley
Copy link
Member Author

/retest

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 12, 2022
@seans3
Copy link
Contributor

seans3 commented Oct 12, 2022

/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 12, 2022
Copy link
Contributor

@seans3 seans3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good--thanks for adding this functionality. One small nit-pick: is it possible to update the Release Notes to display the two items (-o wide & --categories) instead of one long item. I think the new --categories would be more discoverable.

@seans3
Copy link
Contributor

seans3 commented Oct 12, 2022

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brianpursley, seans3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@brianpursley
Copy link
Member Author

This looks good--thanks for adding this functionality. One small nit-pick: is it possible to update the Release Notes to display the two items (-o wide & --categories) instead of one long item. I think the new --categories would be more discoverable.

Thanks, @seans3

I updated the release notes... I assume it is OK to have two separate lines in the release note block.

PTAL and let me know if you have any improvements to suggest.

@seans3
Copy link
Contributor

seans3 commented Oct 14, 2022

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 14, 2022
@seans3
Copy link
Contributor

seans3 commented Oct 14, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 14, 2022
@k8s-ci-robot k8s-ci-robot merged commit afbce89 into kubernetes:master Oct 14, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants