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

Log Create/Update/Deletion actions performed by Argo CD operator

XMLWordPrintable

      Story (Required)

      See parent epic for details.

      Background and Approach (Required)

      In all cases in the argocd-operator codebase, when we are creating or deleting a resource, or modifying a (non-.status) field of a resource, we should log that via an Info level log statement.

      Our goal is that it should be obvious what specific actions the operator by examining the log files at any given time.

      We are already doing this in the Argo Rollouts operator, and thus Rollouts operator is a good existing example.

      Acceptance Criteria (Mandatory)

      • This story is scoped to argocd-operator only (not gitops-operator)
      • Go through the argocd-operator code, and identify cases where we are creating/deleting/modifying K8s resources.
        • To find all the references, you can probably search the code for '.Create', '.Update' and, '.Delete' calls to K8s client API.
      • Add (or ensure there exists) a log statement for each case.
      • Where possible, the log statement message can include:
        • What is being created/modified/deleted (e.g. 'Creating ConfigMap')
        • Where it makes sense, the description can include some simple context on why ('ConfigMap does not exist, creating', or 'Updating ConfigMap as it does not match the expected state). No need to go overboard here, just cases where it is obviously beneficial.
      • DON'T add logs for .status updates, or test code
      • No unit or E2E tests needed AFAICT, we just need to pass the existing ones

              Unassigned Unassigned
              jgwest Jonathan West
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: