@@ -40,31 +40,31 @@ type command struct {
4040
4141// StatusOutput represents the instance status for JSON/YAML output
4242type StatusOutput struct {
43- InstanceID string `json:"instanceId" yaml:"instanceId"`
44- Name string `json:"name" yaml:"name"`
45- Provider string `json:"provider" yaml:"provider"`
46- Status string `json:"status" yaml:"status"`
47- CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
48- Age string `json:"age" yaml:"age"`
49- CacheFile string `json:"cacheFile" yaml:"cacheFile"`
50- Cluster * ClusterStatusOutput `json:"cluster,omitempty" yaml:"cluster,omitempty"`
51- LiveHealth * LiveHealthOutput `json:"liveHealth,omitempty" yaml:"liveHealth,omitempty"`
43+ InstanceID string `json:"instanceId" yaml:"instanceId"`
44+ Name string `json:"name" yaml:"name"`
45+ Provider string `json:"provider" yaml:"provider"`
46+ Status string `json:"status" yaml:"status"`
47+ CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
48+ Age string `json:"age" yaml:"age"`
49+ CacheFile string `json:"cacheFile" yaml:"cacheFile"`
50+ Cluster * ClusterStatusOutput `json:"cluster,omitempty" yaml:"cluster,omitempty"`
51+ LiveHealth * LiveHealthOutput `json:"liveHealth,omitempty" yaml:"liveHealth,omitempty"`
5252}
5353
5454// ClusterStatusOutput represents cluster configuration and status
5555type ClusterStatusOutput struct {
56- Region string `json:"region" yaml:"region"`
57- ControlPlaneCount int32 `json:"controlPlaneCount" yaml:"controlPlaneCount"`
58- ControlPlaneType string `json:"controlPlaneType" yaml:"controlPlaneType"`
59- ControlPlaneMode string `json:"controlPlaneMode" yaml:"controlPlaneMode"`
60- WorkerCount int32 `json:"workerCount,omitempty" yaml:"workerCount,omitempty"`
61- WorkerType string `json:"workerType,omitempty" yaml:"workerType,omitempty"`
62- HighAvailability * HAOutput `json:"highAvailability,omitempty" yaml:"highAvailability,omitempty"`
63- Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
64- TotalNodes int32 `json:"totalNodes,omitempty" yaml:"totalNodes,omitempty"`
65- ReadyNodes int32 `json:"readyNodes,omitempty" yaml:"readyNodes,omitempty"`
66- ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty" yaml:"controlPlaneEndpoint,omitempty"`
67- LoadBalancerDNS string `json:"loadBalancerDNS,omitempty" yaml:"loadBalancerDNS,omitempty"`
56+ Region string `json:"region" yaml:"region"`
57+ ControlPlaneCount int32 `json:"controlPlaneCount" yaml:"controlPlaneCount"`
58+ ControlPlaneType string `json:"controlPlaneType" yaml:"controlPlaneType"`
59+ ControlPlaneMode string `json:"controlPlaneMode" yaml:"controlPlaneMode"`
60+ WorkerCount int32 `json:"workerCount,omitempty" yaml:"workerCount,omitempty"`
61+ WorkerType string `json:"workerType,omitempty" yaml:"workerType,omitempty"`
62+ HighAvailability * HAOutput `json:"highAvailability,omitempty" yaml:"highAvailability,omitempty"`
63+ Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
64+ TotalNodes int32 `json:"totalNodes,omitempty" yaml:"totalNodes,omitempty"`
65+ ReadyNodes int32 `json:"readyNodes,omitempty" yaml:"readyNodes,omitempty"`
66+ ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty" yaml:"controlPlaneEndpoint,omitempty"`
67+ LoadBalancerDNS string `json:"loadBalancerDNS,omitempty" yaml:"loadBalancerDNS,omitempty"`
6868 Nodes []NodeStatusOutput `json:"nodes,omitempty" yaml:"nodes,omitempty"`
6969}
7070
@@ -207,7 +207,7 @@ func (m command) run(c *cli.Context, instanceID string) error {
207207
208208 // Add cluster status from cache
209209 if env .Status .Cluster != nil {
210- statusOutput .Cluster .Phase = string ( env .Status .Cluster .Phase )
210+ statusOutput .Cluster .Phase = env .Status .Cluster .Phase
211211 statusOutput .Cluster .TotalNodes = env .Status .Cluster .TotalNodes
212212 statusOutput .Cluster .ReadyNodes = env .Status .Cluster .ReadyNodes
213213 statusOutput .Cluster .ControlPlaneEndpoint = env .Status .Cluster .ControlPlaneEndpoint
@@ -222,7 +222,7 @@ func (m command) run(c *cli.Context, instanceID string) error {
222222 InstanceID : node .InstanceID ,
223223 PublicIP : node .PublicIP ,
224224 PrivateIP : node .PrivateIP ,
225- Phase : string ( node .Phase ) ,
225+ Phase : node .Phase ,
226226 })
227227 }
228228 }
@@ -273,6 +273,8 @@ func (m command) run(c *cli.Context, instanceID string) error {
273273}
274274
275275// printTableFormat outputs status in the original human-readable format
276+ //
277+ //nolint:errcheck // stdout writes
276278func (m command ) printTableFormat (s * StatusOutput ) error {
277279 fmt .Printf ("Instance ID: %s\n " , s .InstanceID )
278280 fmt .Printf ("Name: %s\n " , s .Name )
0 commit comments