Add description to delete cluster subcommands

This adds a more detailed description to the `kind delete cluster` and
`kind delete clusters` commands explaining expected delete behavior.

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis
2025-01-05 09:55:43 -06:00
parent 1c5a56b301
commit 2a329ee6d8
2 changed files with 18 additions and 6 deletions

View File

@@ -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)

View File

@@ -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")