-
Bug
-
Resolution: Unresolved
-
Major
-
4.20.z, 4.22.0, 4.21.z
Description of problem:
HyperShift Operator showed panicing logs during e2e runs on different jobs due to a code path that doesn't do a proper nil pointer check.
Version-Release number of selected component (if applicable):
How reproducible:
Difficult to reproduce, it showed up on e2e-aks.
Actual results:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x3f5d4d7] goroutine 1045 [running]: github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster/metrics.(*hostedClustersMetricsCollector).Collect(0xc000f03bc0, 0xc000356d20) /hypershift/hypershift-operator/controllers/hostedcluster/metrics/metrics.go:492 +0x27b7 github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1() /hypershift/vendor/github.com/prometheus/client_golang/prometheus/registry.go:456 +0x178 created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather in goroutine 1025 /hypershift/vendor/github.com/prometheus/client_golang/prometheus/registry.go:548 +0xd14
Expected results:
The panic should never occur.
Additional info:
OCP Release Oversight thread: