Skip to content

Commit 522fd80

Browse files
authored
Adding cluster distribution status (#339)
1 parent f235e40 commit 522fd80

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

cli/print/clusters.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ var clusterVersionsTmplSrc = `Supported Kubernetes distributions and versions ar
2121
DISTRIBUTION: {{ $d.Name }}
2222
• VERSIONS: {{ range $i, $v := $d.Versions -}}{{if $i}}, {{end}}{{ $v }}{{ end }}
2323
• INSTANCE TYPES: {{ range $i, $it := $d.InstanceTypes -}}{{if $i}}, {{end}}{{ $it }}{{ end }}
24-
• MAX NODES: {{ $d.NodesMax }}
24+
• MAX NODES: {{ $d.NodesMax }}{{if $d.Status}}
25+
• ENABLED: {{ $d.Status.Enabled }}
26+
• STATUS: {{ $d.Status.Status }}
27+
• DETAILS: {{ $d.Status.StatusMessage }}{{end}}
2528
2629
{{ end }}`
2730

pkg/types/cluster.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ type Cluster struct {
3737
Tags []ClusterTag `json:"tags"`
3838
}
3939

40+
type ClusterDistributionStatus struct {
41+
Enabled bool `json:"enabled"`
42+
Status string `json:"status"`
43+
StatusMessage string `json:"status_message"`
44+
}
45+
4046
type ClusterVersion struct {
41-
Name string `json:"short_name"`
42-
Versions []string `json:"versions"`
43-
InstanceTypes []string `json:"instance_types"`
44-
NodesMax int `json:"nodes_max"`
47+
Name string `json:"short_name"`
48+
Versions []string `json:"versions"`
49+
InstanceTypes []string `json:"instance_types"`
50+
NodesMax int `json:"nodes_max"`
51+
Status *ClusterDistributionStatus `json:"status,omitempty"`
4552
}

0 commit comments

Comments
 (0)