Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-5876

Refactor Argo CD operator to report errors via .status.conditions

XMLWordPrintable

    • GitOps Scarlet - Sprint 7/3266

      Story (Required)

      See parent epic/feature for details.

      This epic would add a new .status.conditions field to ArgoCD CR, which would contain a single condition of 'Type: Reconciled' for any error that occurs.

      We implemented this behaviour in Argo Rollouts operator (and AppStudio GitOps Service), and the API would look similar in ArgoCD CR:

      kind: ArgoCD
      spec: 
        # (...)
      status:
        conditions:
          - type: Reconciled
            reason: "ErrorOccurred" or "Success" # "ErrorOccurred" if an error occurred, or "Success" if not error.
            # Later on, if we wanted, we could add more reasons values (besides generic "ErrorOcccurred"), for more specific errors. But, IMHO, just a generic reason of "ErrorOccurred" is fine as a first step.
          
            message: "(...)" # Empty "" if no error, or "(... some user-facing error message describing the error ...)" if a message occur.
            # Note: error messages contained in the message field should make sense to end users: they should NOT be generic developer-focused debug statements. 
            # - For example:
            #   - Bad: "Error on retrieving 'argocd-secret'"
            #   - Good: "Unable to retrieve 'argocd-secret' reference in .spec.someField.Secret. Verify the Secret specified in this field exists."  	
            status: # true / false: True means the controller successfully reconciled the request, false means an error occurred.
      
          # (no other supported conditions, and there will only ever be 0 or 1 conditions)
      

      Acceptance Criteria:

      • Refactor existing Argo CD operator code: when reconciliation of 'ArgoCD' CR stops due to an error, we should return that error and ensure it is set on .status.conditions[type: "Reconciled] of ArgoCD CR\
        • Likewise, when no error occurs on reconcile, the condition should be set to success.
        • Likely can follow the same pattern we used with Argo Rollouts operator
      • API as above
      • Error messages are user friendly, rather than messages which are only useful to us as developers
      • Unit/E2E tests

              jparsai Jayendra Parsai
              jgwest Jonathan West
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: