K8SVersion, velaCorePodUsage, and velaCLusterGatewayPodUsage in
references/cli/top/model/info.go called kubernetes.NewForConfig /
metrics.NewForConfig without checking for a nil *rest.Config first.
client-go panics with a nil-pointer dereference in that case instead
of returning an error, so vela top crashes instead of showing
Unknown/N/A for those fields.
Confirmed via two independent call paths that both panicked before
this fix: InfoBoard.Init (references/cli/top/component) and
App.Init (references/cli/top/view).
Added regression tests for all three functions with a nil config.
Signed-off-by: sakirr05 <sakirahmed75531@gmail.com>
Co-authored-by: sakirr05 <sakirahmed75531@gmail.com>
newly added system info including:
1. Cluster num
2. App running num
3. cpu and mem usage condition of vela-core
4. cpu and mem usage condition of vela-core cluster gateway
Signed-off-by: HanMengnan <1448189829@qq.com>
Signed-off-by: HanMengnan <1448189829@qq.com>