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

Print err when serviceAccountName Pointing to a no-exist SA

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 4.21
    • 4.20.z
    • must-gather
    • None
    • False
    • Hide

      None

      Show
      None
    • 3
    • Moderate
    • None
    • None
    • None
    • OAPE Sprint 283
    • 1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          Hi team, When serviceAccountName Pointing to a non-existent SA, Stuck and unable to create pod
      
      serviceAccountName: fake-must-gather-operator
      
      operator pod no err log; mustgather no err log
      
      Misspelled words will increase the difficulty of troubleshooting.
      
      I hope print the err message in status (SA ******* not found in namespace ***)

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

          

      How reproducible:

      Create MustGather with fake SA
      serviceAccountName: fake-must-gather-operator

      Steps to Reproduce:

          1.Create a MG CR with   serviceAccountName: fake 
      
      jitli@jitlideMacBook-Pro:~/work/src/test/must-gather$ cat supportloggather-negative.yaml 
      apiVersion: operator.openshift.io/v1alpha1
      kind: MustGather
      metadata:
        name: support-log-gather-jitli 
        namespace: must-gather-operator 
      spec:
        serviceAccountName: fake
        uploadTarget:
          type: SFTP
         ........
      
          2. no pod be created 
      jitli@jitlideMacBook-Pro:~/work/src/test/must-gather$ oc get pods -n must-gather-operator
      NAME                                    READY   STATUS    RESTARTS   AGE
      must-gather-operator-6b9b84dfb4-rpmtd   1/1     Running   0          11m
      
      
          3.
      jitli@jitlideMacBook-Pro:~/work/src/test/must-gather$ oc logs must-gather-operator-6b9b84dfb4-rpmtd
      2026-01-16T14:26:55Z	INFO	cmd	Operator Version: 0.1.1
      2026-01-16T14:26:55Z	INFO	cmd	Go Version: go1.24.6 (Red Hat 1.24.6-1.el9_6) X:boringcrypto,strictfipsruntime
      2026-01-16T14:26:55Z	INFO	cmd	Go OS/Arch: linux/amd64
      2026-01-16T14:26:55Z	INFO	cmd	Version of operator-sdk: 1.21.0
      .........
      
      2026-01-16T14:38:03Z	INFO	mustgather-controller	Reconciling MustGather	{"Request.Namespace": "must-gather-operator", "Request.Name": "support-log-gather-jitli"}
      2026-01-16T14:38:03Z	INFO	mustgather-controller	Adding Finalizer for the MustGather	{"Request.Namespace": "must-gather-operator", "Request.Name": "support-log-gather-jitli"}
      2026-01-16T14:38:03Z	INFO	metadata.finalizers: "finalizer.mustgathers.operator.openshift.io": prefer a domain-qualified finalizer name including a path (/) to avoid accidental conflicts with other finalizer writers	{"controller": "mustgather", "controllerGroup": "operator.openshift.io", "controllerKind": "MustGather", "MustGather": {"name":"support-log-gather-jitli","namespace":"must-gather-operator"}, "namespace": "must-gather-operator", "name": "support-log-gather-jitli", "reconcileID": "36dfa26b-b1a6-4874-8f35-c57dcbe7433b"}
      2026-01-16T14:38:03Z	INFO	mustgather-controller	Reconciling MustGather	{"Request.Namespace": "must-gather-operator", "Request.Name": "support-log-gather-jitli"}
      2026-01-16T14:38:03Z	INFO	mustgather-controller	Reconciling MustGather	{"Request.Namespace": "must-gather-operator", "Request.Name": "support-log-gather-jitli"}     

      Actual results:

          jitli@jitlideMacBook-Pro:~/work/src/test/must-gather$ oc get mustgather support-log-gather-jitli -o yaml
      apiVersion: operator.openshift.io/v1alpha1
      kind: MustGather
      metadata:
        creationTimestamp: "2026-01-13T07:58:03Z"
        finalizers:
        - finalizer.mustgathers.operator.openshift.io
        generation: 1
        name: support-log-gather-jitli
        namespace: must-gather-operator
        resourceVersion: "108536"
        uid: 6a30dab7-7a2a-4bed-9c95-58af7d80e960
      spec:
        audit: false
        retainResourcesOnCompletion: false
        serviceAccountName: fake                      // fake SA name 
        uploadTarget:
          sftp:
            caseID: "04230315"
            caseManagementAccountSecretRef:
              name: mustgather-creds
            host: sftp.access.redhat.com
            internalUser: true
          type: SFTP
      status:
        completed: false
        conditions:
        - lastTransitionTime: "2026-01-13T07:58:03Z"
          message: ""
          observedGeneration: 1
          reason: LastReconcileCycleSucceded
          status: "True"
          type: ReconcileSuccess
      

      Stuck and unable to create pod

      Expected results:

          I hope print the err message in status (SA ******* not found in namespace ***)

      Additional info:

      Although the operator pod's warnings are close to suggesting a SA issue, they are not direct.    

              rh-ee-nkumari Neha Kumari
              rhn-support-jitli Keenon Lee
              Keenon Lee Keenon Lee
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: