Instance-namespace utility endpoints.

This commit is contained in:
2025-10-14 21:04:40 +00:00
parent 8d19fbd549
commit 393306de12
3 changed files with 24 additions and 11 deletions

View File

@@ -24,13 +24,16 @@ var versionCmd = &cobra.Command{
// If connected to daemon, show cluster versions
if apiClient != nil {
resp, err := apiClient.Get("/api/v1/utilities/version")
inst, err := getInstanceName()
if err == nil {
if k8s, ok := resp.Data["kubernetes"].(string); ok {
fmt.Printf("Kubernetes: %s\n", k8s)
}
if talos, ok := resp.Data["talos"].(string); ok && talos != "" {
fmt.Printf("Talos: %s\n", talos)
resp, err := apiClient.Get(fmt.Sprintf("/api/v1/instances/%s/utilities/version", inst))
if err == nil {
if k8s, ok := resp.Data["kubernetes"].(string); ok {
fmt.Printf("Kubernetes: %s\n", k8s)
}
if talos, ok := resp.Data["talos"].(string); ok && talos != "" {
fmt.Printf("Talos: %s\n", talos)
}
}
}
}