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

✨ clusterctl: add command groups #7769

Merged

Conversation

oscr
Copy link
Contributor

@oscr oscr commented Dec 15, 2022

What this PR does / why we need it:

Improves the clusterctl command overview by grouping the commands. I opted to create two groups: "Management commands" and "Other commands". I welcome any feedback regarding the names.

This feature would also allow the flattening of the command structure in the future. For example the alpha commands could be placed under a "Alpha commands" group and displayed immediately under the help command.

New clusterctl output:

Cluster Management Commands:
  delete      Delete one or more providers from the management cluster
  generate    Generate yaml using clusterctl yaml processor
  get         Get info from a management or workload cluster
  init        Initialize a management cluster
  move        Move Cluster API objects and all dependencies between management clusters
  upgrade     Upgrade core and provider components in a management cluster

Troubleshooting and Debugging Commands:
  describe    Describe workload clusters

Other Commands:
  alpha       Commands for features in alpha
  completion  Output shell completion code for the specified shell (bash or zsh)
  config      Display clusterctl configuration
  help        Help about any command
  version     Print clusterctl version

Old clusterctl output:

Available Commands:
  alpha       Commands for features in alpha.
  backup      Backup Cluster API objects and all dependencies from a management cluster.
  completion  Output shell completion code for the specified shell (bash or zsh)
  config      Display clusterctl configuration.
  delete      Delete one or more providers from the management cluster.
  describe    Describe workload clusters.
  generate    Generate yaml using clusterctl yaml processor.
  get         Get info from a management or a workload cluster
  help        Help about any command
  init        Initialize a management cluster.
  move        Move Cluster API objects and all dependencies between management clusters.
  restore     Restore Cluster API objects from file by glob. Object files are searched in config directory
  upgrade     Upgrade core and provider components in a management cluster.
  version     Print clusterctl version.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 15, 2022
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@oscr that's a nice improvement, thanks!
added a few of suggestions, let's hear also other opinions
cc @ykakarap and @Jont828

cmd/clusterctl/cmd/root.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/alpha.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/root.go Show resolved Hide resolved
cmd/clusterctl/cmd/config.go Outdated Show resolved Hide resolved
@oscr oscr force-pushed the clusterctl-add-command-groups branch from 64ae7b5 to 47ac8f9 Compare December 18, 2022 23:28
@oscr oscr force-pushed the clusterctl-add-command-groups branch from 47ac8f9 to d49f2aa Compare December 19, 2022 10:35
@fabriziopandini
Copy link
Member

/lgtm

@ykakarap @Jont828 PTAL

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2022
Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

/lgtm

This is great. Thank you!

Right now the alpha commands are a bucket of everything. Example alpha rollout would best suite "Cluster Management Commands" group and alpha topology plan would best suite "Troubleshooting and Debugging Commands" group. But since in this itearation we are only doing top level grouping the current grouping we have makes sense.

@fabriziopandini
Copy link
Member

Great Stuff!
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 22, 2022
@k8s-ci-robot k8s-ci-robot merged commit d593684 into kubernetes-sigs:main Dec 22, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Dec 22, 2022
@oscr
Copy link
Contributor Author

oscr commented Dec 22, 2022

@ykakarap @fabriziopandini Would you like me to also make prs for 1.3 and 1.2?

@sbueringer
Copy link
Member

In general we don't backport features https://github.com/kubernetes-sigs/cluster-api/blob/main/CONTRIBUTING.md#backporting-a-patch

@oscr oscr deleted the clusterctl-add-command-groups branch December 22, 2022 13:07
@sbueringer
Copy link
Member

Nice feature, thx!!

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants