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

Refractor source namespace list initialization logic

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • 1.10.0
    • None
    • None
    • None
    • 5
    • False
    • Hide

      None

      Show
      None
    • False
    • GITOPS Sprint 243, GITOPS Sprint 3244

      Story (Required)

      The goal of this story is rewrite the `setManagedSourceNamespaces` function present in argocd_controller in order to account for architectural changes in the operator conducted as part of other stories in this epic 

      Background (Required)

      The `setManagedSourceNamesapces` function is responsible for setting the list of managed source namespaces for a given Argo CD instance. However, there are some problems with the current implementation of it. 
      At the beginning of the reconciliation cycle, the current logic only pulls the list of all labeled namespaces currently on the cluster and defers syncing the actual list of labelled namespaces vs what is expressed in .spec.sourceNamespaces during role reconciliation. There is also some namespace manipulation with deletion/addition of labels to namespaces etc happening during role reconciliation, which goes against the package responsibility philosophy we are trying to implement with the redesign.

      The operator also does not check if a given argo-cd instance is cluster scoped or not before enabling apps-in-any-namespaces

      Out of scope

      any changes to how the feature works externally

      Approach (Required)

      Change logic in setSourceNamespaces such that existing and desired source namespace lists are reconciled and brought in sync entirely within the scope of this function. Also add a check to see if the instance is cluster scoped before setting the final list of source namespaces

      Add kuttl tests to verify that no external changes in behavior occur as a result of this internal code shuffle 

      Dependencies

      none

      Acceptance Criteria (Mandatory)

      • unit tests added to verify function behaviour 

      INVEST Checklist

      Dependencies identified

      Blockers noted and expected delivery timelines set

      Design is implementable

      Acceptance criteria agreed upon

      Story estimated

      Legend

      Unknown

      Verified

      Unsatisfied

      Done Checklist

      • Code is completed, reviewed, documented and checked in
      • Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
      • Continuous Delivery pipeline(s) is able to proceed with new code included
      • Customer facing documentation, API docs etc. are produced/updated, reviewed and published
      • Acceptance criteria are met

              jrao@redhat.com Jaideep Rao
              jrao@redhat.com Jaideep Rao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: