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

Operator hard-coded dependency on namespace causes deployment failure and inability to correctly configure metrics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.20.z
    • 4.20.z
    • must-gather
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Important
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          When deployed in a non-default namespace, the MustGather fails to start because it cannot find the hard-coded ‘support-log-gather’
      
      The must-gather-operator failed to successfully complete its startup process when deployed to a non-default namespace. The Operator appears to have a hard-coded dependency on the support-log-gather namespace for configuring OSD Metrics (Prometheus). When this namespace doesn't exist, the startup process fails and exits, severely hindering deployments in custom namespaces.

      Version-Release number of selected component (if applicable):

          

      How reproducible:

          

      Steps to Reproduce:

       jitli@RedHat:~/work/src/test/must-gather$ oc new-project must-gather-operator
      Now using project "must-gather-operator" on server "https://api.assulka441.qe.devcluster.openshift.com:6443".
      
      
      You can add applications to this project with the 'new-app' command. For example, try:
      
      
          oc new-app rails-postgresql-example
      
      
      to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:
      
      
          kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.43 -- /agnhost serve-hostname
      
      
      jitli@RedHat:~/work/src/test/must-gather$ oc create -f og.yaml 
      operatorgroup.operators.coreos.com/must-gather-operator-og created
      jitli@RedHat:~/work/src/test/must-gather$ cp catsrc-pr284.yaml catsrc-pr283.yaml
      jitli@RedHat:~/work/src/test/must-gather$ vim catsrc-pr283.yaml 
      jitli@RedHat:~/work/src/test/must-gather$ oc create -f catsrc-pr283.yaml 
      catalogsource.operators.coreos.com/must-gather-operator-catalog created
      jitli@RedHat:~/work/src/test/must-gather$ cat catsrc-pr283.yaml 
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        name: must-gather-operator-catalog
        namespace: must-gather-operator
      spec:
        sourceType: grpc
        image: quay.io/jitli/must-gather-operator-index:pr283
        displayName: Must Gather Operator Catalog
        publisher: Red Hat QE
      jitli@RedHat:~/work/src/test/must-gather$ oc get pods
      NAME                                 READY   STATUS    RESTARTS   AGE
      must-gather-operator-catalog-dmsfv   1/1     Running   0          11s
      jitli@RedHat:~/work/src/test/must-gather$ oc create -f sub
      sub-catsrc.yaml              sub-env.yaml                 sub-support-log-catsrc.yaml  sub.yaml                     
      jitli@RedHat:~/work/src/test/must-gather$ oc create -f sub-support-log-catsrc.yaml 
      subscription.operators.coreos.com/must-gather-operator created
      jitli@RedHat:~/work/src/test/must-gather$ oc get pdos
      error: the server doesn't have a resource type "pdos"
      jitli@RedHat:~/work/src/test/must-gather$ oc get pods
      NAME                                                              READY   STATUS            RESTARTS   AGE
      ee6c41020e8b6d9e9f06cd6ec01ad584ab182ca8a5049954452959c6e4dxb9z   0/1     PodInitializing   0          4s
      must-gather-operator-catalog-j76xn                                1/1     Running           0          82s
      jitli@RedHat:~/work/src/test/must-gather$ oc get pods
      NAME                                                              READY   STATUS      RESTARTS   AGE
      ee6c41020e8b6d9e9f06cd6ec01ad584ab182ca8a5049954452959c6e4dxb9z   0/1     Completed   0          39s
      must-gather-operator-57d4457cc9-fqqdk                             1/1     Running     0          32s
      must-gather-operator-catalog-j76xn                                1/1     Running     0          117s
      jitli@RedHat:~/work/src/test/must-gather$ oc logs must-gather-operator-57d4457cc9-fqqdk
      2025-10-17T12:51:14Z	INFO	cmd	Operator Version: 0.1.1
      2025-10-17T12:51:14Z	INFO	cmd	Go Version: go1.24.4 (Red Hat 1.24.4-2.el9) X:boringcrypto,strictfipsruntime
      2025-10-17T12:51:14Z	INFO	cmd	Go OS/Arch: linux/amd64
      2025-10-17T12:51:14Z	INFO	cmd	Version of operator-sdk: 1.21.0
      2025-10-17T12:51:14Z	INFO	leader	Trying to become the leader.
      2025-10-17T12:51:14Z	DEBUG	leader	Found podname	{"Pod.Name": "must-gather-operator-57d4457cc9-fqqdk"}
      2025-10-17T12:51:14Z	DEBUG	leader	Found Pod	{"Pod.Namespace": "must-gather-operator", "Pod.Name": "must-gather-operator-57d4457cc9-fqqdk"}
      2025-10-17T12:51:14Z	INFO	leader	No pre-existing lock was found.
      2025-10-17T12:51:14Z	INFO	leader	Became the leader.
      2025-10-17T12:51:14Z	INFO	userMetrics	Starting prometheus metrics
      2025-10-17T12:51:14Z	INFO	userMetrics	Port: 8080
      2025-10-17T12:51:14Z	INFO	userMetrics	Generated metrics service object
      2025-10-17T12:51:15Z	INFO	userMetrics	Error getting current metrics service	{"Error": "namespaces \"support-log-gather\" not found"}
      2025-10-17T12:51:15Z	ERROR	cmd	Failed to configure OSD metrics	{"error": "namespaces \"support-log-gather\" not found"}
      main.main
      	src/github.com/openshift/must-gather-operator/main.go:161
      runtime.main
      	/usr/lib/golang/src/runtime/proc.go:283
      2025-10-17T12:51:15Z	INFO	setup	starting manager
      2025-10-17T12:51:15Z	INFO	starting server	{"name": "health probe", "addr": "[::]:8081"}
      2025-10-17T12:51:15Z	INFO	Starting EventSource	{"controller": "mustgather", "controllerGroup": "operator.openshift.io", "controllerKind": "MustGather", "source": "kind source: *v1.Job"}
      2025-10-17T12:51:15Z	INFO	Starting EventSource	{"controller": "mustgather", "controllerGroup": "operator.openshift.io", "controllerKind": "MustGather", "source": "kind source: *v1alpha1.MustGather"}
      2025-10-17T12:51:15Z	INFO	Starting Controller	{"controller": "mustgather", "controllerGroup": "operator.openshift.io", "controllerKind": "MustGather"}
      2025-10-17T12:51:15Z	INFO	Starting workers	{"controller": "mustgather", "controllerGroup": "operator.openshift.io", "controllerKind": "MustGather", "worker count": 1}     

      Actual results:

          

      Expected results:

          

      Additional info:

          

              tgeer@redhat.com Trilok Geer
              rhn-support-jitli Keenon Lee
              None
              None
              Keenon Lee Keenon Lee
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: