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 description to delete cluster subcommands #3838

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkg/cmd/kind/delete/cluster/deletecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@ type flagpole struct {
func NewCommand(logger log.Logger, streams cmd.IOStreams) *cobra.Command {
flags := &flagpole{}
cmd := &cobra.Command{
Args: cobra.NoArgs,
// TODO(bentheelder): more detailed usage
Args: cobra.NoArgs,
Use: "cluster",
Short: "Deletes a cluster",
Long: "Deletes a resource",
Long: `Deletes a Kind cluster from the system.

This is an idempotent operation, meaning it may be called multiple times without
failing (like "rm -f"). If the cluster resources exist they will be deleted, and
if the cluster is already gone it will just return success.

Errors will only occur if the cluster resources exist and are not able to be deleted.
`,
RunE: func(cmd *cobra.Command, args []string) error {
cli.OverrideDefaultName(cmd.Flags())
return deleteCluster(logger, flags)
Expand Down
12 changes: 9 additions & 3 deletions pkg/cmd/kind/delete/clusters/deleteclusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ type flagpole struct {
func NewCommand(logger log.Logger, streams cmd.IOStreams) *cobra.Command {
flags := &flagpole{}
cmd := &cobra.Command{
Args: cobra.MinimumNArgs(0),
// TODO(bentheelder): more detailed usage
Args: cobra.MinimumNArgs(0),
Use: "clusters",
Short: "Deletes one or more clusters",
Long: "Deletes a resource",
Long: `Deletes one or more Kind clusters from the system.

This is an idempotent operation, meaning it may be called multiple times without
failing (like "rm -f"). If the cluster resources exist they will be deleted, and
if the cluster is already gone it will just return success.

Errors will only occur if the cluster resources exist and are not able to be deleted.
`,
RunE: func(cmd *cobra.Command, args []string) error {
if !flags.All && len(args) == 0 {
return errors.New("no cluster names provided")
Expand Down
Loading