mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
The binary, its directory, its config directory and its environment variables take the new name. For one release the previous names still work: every NVKECTL_* setting is also read under its NKECTL_* name with a deprecation warning (the NKECTL_CWE_* names of the generation before are no longer read), a config file left under nkectl/ is read and copied to nvkectl/ once, and releases publish both nvkectl-<os>-<arch> and nkectl-<os>-<arch>, to GitHub and to S3 under the existing prefix. The e2e helper package, the e2e test, the smoke and fetch scripts and the bootstrap e2e workflow follow the binary; the fetch script accepts a release that carries only the old asset name. The CLI's own documents and the two installation documents that print the download URLs change with it. Kept on purpose: the NVCR repository name until an nvkectl repository exists in the NGC org, the S3 prefix the publishing role's policy names, and the prose in the other documents. BREAKING CHANGE: the CLI is installed and invoked as nvkectl. The previous binary name, environment variable names and config directory are honoured for one release, as described above. Closes #1455 Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package clusters
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// NewDeleteCmd returns the "nvkectl delete cluster <name>" subcommand.
|
|
func NewDeleteCmd(clientFn ControllerClientFn) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "cluster <name>",
|
|
Aliases: []string{"clusters"},
|
|
Short: "Delete a tenant cluster",
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
name := args[0]
|
|
client, err := clientFn()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
cluster, err := client.FindClusterByName(cmd.Context(), name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := client.DeleteCluster(cmd.Context(), cluster.ID); err != nil {
|
|
return err
|
|
}
|
|
fmt.Fprintf(cmd.OutOrStdout(), "Cluster %q deletion started (id: %s)\n", cluster.Name, cluster.ID)
|
|
fmt.Fprintf(cmd.OutOrStdout(), "Deletion is async — run 'nvkectl get clusters' to check status.\n")
|
|
return nil
|
|
},
|
|
}
|
|
return cmd
|
|
}
|