Skip to content

Commit

Permalink
Adding cluster distribution status (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdewinne authored Nov 3, 2023
1 parent f235e40 commit 522fd80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion cli/print/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ var clusterVersionsTmplSrc = `Supported Kubernetes distributions and versions ar
DISTRIBUTION: {{ $d.Name }}
• VERSIONS: {{ range $i, $v := $d.Versions -}}{{if $i}}, {{end}}{{ $v }}{{ end }}
• INSTANCE TYPES: {{ range $i, $it := $d.InstanceTypes -}}{{if $i}}, {{end}}{{ $it }}{{ end }}
• MAX NODES: {{ $d.NodesMax }}
• MAX NODES: {{ $d.NodesMax }}{{if $d.Status}}
• ENABLED: {{ $d.Status.Enabled }}
• STATUS: {{ $d.Status.Status }}
• DETAILS: {{ $d.Status.StatusMessage }}{{end}}
{{ end }}`

Expand Down
15 changes: 11 additions & 4 deletions pkg/types/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ type Cluster struct {
Tags []ClusterTag `json:"tags"`
}

type ClusterDistributionStatus struct {
Enabled bool `json:"enabled"`
Status string `json:"status"`
StatusMessage string `json:"status_message"`
}

type ClusterVersion struct {
Name string `json:"short_name"`
Versions []string `json:"versions"`
InstanceTypes []string `json:"instance_types"`
NodesMax int `json:"nodes_max"`
Name string `json:"short_name"`
Versions []string `json:"versions"`
InstanceTypes []string `json:"instance_types"`
NodesMax int `json:"nodes_max"`
Status *ClusterDistributionStatus `json:"status,omitempty"`
}

0 comments on commit 522fd80

Please sign in to comment.