You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support lookup by name or ID for all VM, cluster, and network commands (#543)
* Add support for lookup by name or ID for all VM, cluster, and network commands
Co-Authored-By: [email protected] <[email protected]>
* Fix PR label check by adding required labels
Co-Authored-By: [email protected] <[email protected]>
* Deprecate --name flags in rm commands since name lookup is now supported in arguments
Co-Authored-By: [email protected] <[email protected]>
* Update vm_update and vm_update_ttl commands to support lookup by name
Co-Authored-By: [email protected] <[email protected]>
* Fix handling of multiple resources with the same name in rm commands
Co-Authored-By: [email protected] <[email protected]>
* Update help text to clarify behavior when removing multiple resources with the same name
Co-Authored-By: [email protected] <[email protected]>
* Add ID/name completion for additional commands and fix VM completion function
- Added ID/name lookup to cluster_kubeconfig, cluster_shell, cluster_update, cluster_upgrade, and cluster_addon_create_objectstore commands
- Fixed VM completion function to include resources outside of 'running' state
- Updated help text to clarify behavior with multiple resources with the same name
- Ensured consistent implementation across all commands
Co-Authored-By: [email protected] <[email protected]>
* Address PR comments: add deprecation warnings to --name flags and update error message format
Co-Authored-By: [email protected] <[email protected]>
* Address PR comments: add deprecation warnings to --id flags
Co-Authored-By: [email protected] <[email protected]>
* Update help text to use CLUSTER_ID_OR_NAME consistently across all commands
Co-Authored-By: [email protected] <[email protected]>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
return"", errors.Errorf("Cluster with name or ID '%s' not found", arg)
197
+
case1:
198
+
returnmatchingClusters[0], nil
199
+
default:
200
+
return"", errors.Errorf("Multiple clusters found with name '%s'. Please use the cluster ID instead. Matching clusters: %s. To view all cluster IDs run `replicated cluster ls`",
You can use various subcommands to create, list, remove, or check the status of add-ons on a cluster. This command is useful for adding databases, object storage, monitoring, security, or other specialized tools to your cluster environment.`,
19
19
Example: `# List all add-ons installed on a cluster
Short: "Create an object store bucket for a cluster.",
20
20
Long: `Creates an object store bucket for a cluster, requiring a bucket name prefix. The bucket name will be auto-generated using the format "[BUCKET_PREFIX]-[ADDON_ID]-cmx". This feature provisions an object storage bucket that can be used for storage in your cluster environment.`,
21
21
Example: `# Create an object store bucket with a specified prefix
Long: `The 'cluster addon ls' command allows you to list all add-ons for a specific cluster. This command provides a detailed overview of the add-ons currently installed on the cluster, including their status and any relevant configuration details.
21
21
22
22
This can be useful for monitoring the health and configuration of add-ons or performing troubleshooting tasks.`,
23
23
Example: `# List add-ons for a cluster with default table output
24
-
replicated cluster addon ls CLUSTER_ID
24
+
replicated cluster addon ls CLUSTER_ID_OR_NAME
25
25
26
26
# List add-ons for a cluster with JSON output
27
-
replicated cluster addon ls CLUSTER_ID --output json
27
+
replicated cluster addon ls CLUSTER_ID_OR_NAME --output json
28
28
29
29
# List add-ons for a cluster with wide table output
30
-
replicated cluster addon ls CLUSTER_ID --output wide`,
30
+
replicated cluster addon ls CLUSTER_ID_OR_NAME --output wide`,
Long: `The 'cluster addon rm' command allows you to remove a specific add-on from a cluster by specifying the cluster ID and the add-on ID.
21
+
Long: `The 'cluster addon rm' command allows you to remove a specific add-on from a cluster by specifying the cluster ID or name and the add-on ID.
22
22
23
23
This command is useful when you want to deprovision an add-on that is no longer needed or when troubleshooting issues related to specific add-ons. The add-on will be removed immediately, and you will receive confirmation upon successful removal.`,
24
24
Example: `# Remove an add-on with ID 'abc123' from cluster 'cluster456'
Short: "Download credentials for a test cluster.",
27
27
Long: `The 'cluster kubeconfig' command downloads the credentials (kubeconfig) required to access a test cluster. You can either merge these credentials into your existing kubeconfig file or save them as a new file.
28
28
29
-
This command ensures that the kubeconfig is correctly configured for use with your Kubernetes tools. You can specify the cluster by ID or by name. Additionally, the kubeconfig can be written to a specific file path or printed to stdout.
29
+
This command ensures that the kubeconfig is correctly configured for use with your Kubernetes tools. You can specify the cluster by ID or name directly as an argument, or by using the '--id' or '--name' flags. Additionally, the kubeconfig can be written to a specific file path or printed to stdout.
30
30
31
31
You can also use this command to automatically update your current Kubernetes context with the downloaded credentials.`,
32
32
Example: `# Download and merge kubeconfig into your existing configuration
cmd.Flags().StringVar(&r.args.kubeconfigPath, "output-path", "", "path to kubeconfig file to write to, if not provided, it will be merged into your existing kubeconfig")
58
60
cmd.Flags().BoolVar(&r.args.kubeconfigStdout, "stdout", false, "write kubeconfig to stdout")
Node groups define a set of nodes with specific configurations, such as instance types, node counts, or scaling rules. You can use subcommands to perform various actions on node groups.`,
14
14
Example: `# List all node groups for a cluster
15
-
replicated cluster nodegroup ls CLUSTER_ID`,
15
+
replicated cluster nodegroup ls CLUSTER_ID_OR_NAME`,
Long: `The 'cluster nodegroup ls' command lists all the node groups associated with a given cluster. Each node group defines a specific set of nodes with particular configurations, such as instance types and scaling options.
16
16
17
17
You can view information about the node groups within the specified cluster, including their ID, name, node count, and other configuration details.
18
18
19
-
You must provide the cluster ID to list its node groups.`,
19
+
You must provide the cluster ID or name to list its node groups.`,
20
20
Example: `# List all node groups in a cluster with default table output
21
-
replicated cluster nodegroup ls CLUSTER_ID
21
+
replicated cluster nodegroup ls CLUSTER_ID_OR_NAME
22
22
23
23
# List node groups with JSON output
24
-
replicated cluster nodegroup ls CLUSTER_ID --output json
24
+
replicated cluster nodegroup ls CLUSTER_ID_OR_NAME --output json
25
25
26
26
# List node groups with wide table output
27
-
replicated cluster nodegroup ls CLUSTER_ID --output wide`,
27
+
replicated cluster nodegroup ls CLUSTER_ID_OR_NAME --output wide`,
0 commit comments