Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-77034

HyperShift Operator panicing due to nil pointer derference

    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • Proposed
    • None
    • In Progress
    • Bug Fix
    • Fixed a potential panic in the metrics collector when a HostedCluster has no AWS platform configuration.
    • None
    • None
    • None
    • None

      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:

              rh-ee-aabdelre Ahmed Abdalla Abdelrehim
              rh-ee-aabdelre Ahmed Abdalla Abdelrehim
              None
              None
              Yu Li Yu Li
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: