github.com/argoproj-labs/argocd-operator@v0.10.0/tests/k8s/1-006_validate-managed-by-chain/10-check-secret.yaml (about)

     1  # This test step ensures that the cluster secret only contains the installation
     2  # namespace and test-1-12-custom2 after managed-by label has been removed from other-managed-namespace
     3  apiVersion: kuttl.dev/v1beta1
     4  kind: TestStep
     5  commands:
     6  - script: |
     7      should="$NAMESPACE,test-1-12-custom2"
     8      namespaces=$(kubectl get secret -n $NAMESPACE argocd-default-cluster-config -o jsonpath='{.data.namespaces}' | base64 -d)
     9      if test "$namespaces" != "$should"; then
    10        echo "Assertion for cluster secret failed! '$namespaces' != '$should'"
    11        # 1.2.0 doesn't reconcile the cluster secret on namespace deletion
    12        if test GITOPS_TARGET_VERSION = "1.2.0"; then
    13          exit 0
    14        else
    15          exit 1
    16        fi
    17      fi
    18      exit 0