Skip to content

Commit 0e058e8

Browse files
authored
Merge pull request #3838 from stmcginnis/delete-description
Add description to delete cluster subcommands
2 parents 78cdad2 + 2a329ee commit 0e058e8

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

pkg/cmd/kind/delete/cluster/deletecluster.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ type flagpole struct {
3838
func NewCommand(logger log.Logger, streams cmd.IOStreams) *cobra.Command {
3939
flags := &flagpole{}
4040
cmd := &cobra.Command{
41-
Args: cobra.NoArgs,
42-
// TODO(bentheelder): more detailed usage
41+
Args: cobra.NoArgs,
4342
Use: "cluster",
4443
Short: "Deletes a cluster",
45-
Long: "Deletes a resource",
44+
Long: `Deletes a Kind cluster from the system.
45+
46+
This is an idempotent operation, meaning it may be called multiple times without
47+
failing (like "rm -f"). If the cluster resources exist they will be deleted, and
48+
if the cluster is already gone it will just return success.
49+
50+
Errors will only occur if the cluster resources exist and are not able to be deleted.
51+
`,
4652
RunE: func(cmd *cobra.Command, args []string) error {
4753
cli.OverrideDefaultName(cmd.Flags())
4854
return deleteCluster(logger, flags)

pkg/cmd/kind/delete/clusters/deleteclusters.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ type flagpole struct {
3737
func NewCommand(logger log.Logger, streams cmd.IOStreams) *cobra.Command {
3838
flags := &flagpole{}
3939
cmd := &cobra.Command{
40-
Args: cobra.MinimumNArgs(0),
41-
// TODO(bentheelder): more detailed usage
40+
Args: cobra.MinimumNArgs(0),
4241
Use: "clusters",
4342
Short: "Deletes one or more clusters",
44-
Long: "Deletes a resource",
43+
Long: `Deletes one or more Kind clusters from the system.
44+
45+
This is an idempotent operation, meaning it may be called multiple times without
46+
failing (like "rm -f"). If the cluster resources exist they will be deleted, and
47+
if the cluster is already gone it will just return success.
48+
49+
Errors will only occur if the cluster resources exist and are not able to be deleted.
50+
`,
4551
RunE: func(cmd *cobra.Command, args []string) error {
4652
if !flags.All && len(args) == 0 {
4753
return errors.New("no cluster names provided")

0 commit comments

Comments
 (0)