Skip to content

Commit 44ab84a

Browse files
committed
OCM-13946 | feat: HCP autoscaler simpler describe output
1 parent b04d131 commit 44ab84a

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

cmd/describe/autoscaler/cmd.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ func DescribeAutoscalerRunner() rosa.CommandRunner {
6262
if output.HasFlag() {
6363
output.Print(autoscaler)
6464
} else {
65-
fmt.Print(clusterautoscaler.PrintAutoscaler(autoscaler))
65+
if cluster.Hypershift().Enabled() {
66+
fmt.Print(clusterautoscaler.PrintHypershiftAutoscaler(autoscaler))
67+
} else {
68+
fmt.Print(clusterautoscaler.PrintAutoscaler(autoscaler))
69+
}
6670
}
6771
return nil
6872
}

pkg/clusterautoscaler/output.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,25 @@ func PrintAutoscaler(a *cmv1.ClusterAutoscaler) string {
8787

8888
return out
8989
}
90+
91+
func PrintHypershiftAutoscaler(a *cmv1.ClusterAutoscaler) string {
92+
93+
out := "\n"
94+
95+
if a.MaxNodeProvisionTime() != "" {
96+
out += fmt.Sprintf("Maximum Node Provision Time: %s\n",
97+
a.MaxNodeProvisionTime())
98+
}
99+
100+
out += fmt.Sprintf("Maximum Pod Grace Period: %d\n",
101+
a.MaxPodGracePeriod())
102+
out += fmt.Sprintf("Pod Priority Threshold: %d\n",
103+
a.PodPriorityThreshold())
104+
105+
//Resource Limits
106+
out += "Resource Limits:\n"
107+
out += fmt.Sprintf(" - Maximum Nodes: %d\n",
108+
a.ResourceLimits().MaxNodesTotal())
109+
110+
return out
111+
}

0 commit comments

Comments
 (0)