diff --git a/common/.gitignore b/common/.gitignore index adc3fb8..765c0dd 100644 --- a/common/.gitignore +++ b/common/.gitignore @@ -2,6 +2,6 @@ *.swp *.swo values-secret.yaml -.*-expected.yaml +.*.expected.yaml pattern-vault.init vault.init diff --git a/common/Makefile b/common/Makefile index f9d313b..a46aabf 100644 --- a/common/Makefile +++ b/common/Makefile @@ -8,7 +8,7 @@ HUBCLUSTER_APPS_DOMAIN=$(shell oc get ingresses.config/cluster -o jsonpath={.spe # --set values always take precedence over the contents of -f HELM_OPTS=-f values-global.yaml -f $(SECRETS) --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) --set main.options.bootstrap=$(BOOTSTRAP) --set global.hubClusterDomain=$(HUBCLUSTER_APPS_DOMAIN) -TEST_OPTS= -f common/examples/values-secret.yaml -f values-global.yaml --set global.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.revision=main --set main.options.bootstrap=$(BOOTSTRAP) --set global.valuesDirectoryURL="https://github.com/pattern-clone/mypattern/raw/main" --set global.pattern="mypattern" --set global.namespace="pattern-namespace" +TEST_OPTS= -f common/examples/values-secret.yaml -f values-global.yaml --set global.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.revision=main --set main.options.bootstrap=$(BOOTSTRAP) --set global.valuesDirectoryURL="https://github.com/pattern-clone/mypattern/raw/main" --set global.pattern="mypattern" --set global.namespace="pattern-namespace" --set global.hubClusterDomain=hub.example.com --set global.localClusterDomain=region.example.com PATTERN_OPTS=-f common/examples/values-example.yaml # Makefiles that use this target must provide: diff --git a/common/tests/acm-normal.expected.yaml b/common/tests/acm-normal.expected.yaml index 8b3be6f..dcfbef6 100644 --- a/common/tests/acm-normal.expected.yaml +++ b/common/tests/acm-normal.expected.yaml @@ -135,6 +135,10 @@ spec: value: mypattern - name: global.valuesDirectoryURL value: https://github.com/pattern-clone/mypattern/raw/main + - name: global.hubClusterDomain + value: hub.example.com + - name: global.localClusterDomain + value: '{{ (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain }}' - name: clusterGroup.isHubCluster value: "false" destination: diff --git a/common/tests/clustergroup-naked.expected.yaml b/common/tests/clustergroup-naked.expected.yaml index f48965d..e897228 100644 --- a/common/tests/clustergroup-naked.expected.yaml +++ b/common/tests/clustergroup-naked.expected.yaml @@ -79,6 +79,7 @@ spec: --set global.targetRevision=$ARGOCD_APP_SOURCE_TARGET_REVISION --set global.namespace=$ARGOCD_APP_NAMESPACE --set global.pattern=common + --set global.hubClusterDomain= --set global.valuesDirectoryURL=https://github.com/pattern-clone/common/raw/main --post-renderer ./kustomize\"] \ \n" @@ -100,6 +101,7 @@ spec: cpu: 500m memory: 2Gi dex: + openShiftOAuth: true resources: limits: cpu: 500m diff --git a/common/tests/clustergroup-normal.expected.yaml b/common/tests/clustergroup-normal.expected.yaml index 2580b37..c82ac3a 100644 --- a/common/tests/clustergroup-normal.expected.yaml +++ b/common/tests/clustergroup-normal.expected.yaml @@ -124,6 +124,10 @@ spec: value: mypattern - name: global.valuesDirectoryURL value: https://github.com/pattern-clone/mypattern/raw/main + - name: global.hubClusterDomain + value: hub.example.com + - name: global.localClusterDomain + value: region.example.com ignoreDifferences: [ { "group": "internal.open-cluster-management.io", @@ -168,6 +172,10 @@ spec: value: mypattern - name: global.valuesDirectoryURL value: https://github.com/pattern-clone/mypattern/raw/main + - name: global.hubClusterDomain + value: hub.example.com + - name: global.localClusterDomain + value: region.example.com syncPolicy: automated: {} # selfHeal: true @@ -199,6 +207,7 @@ spec: --set global.targetRevision=$ARGOCD_APP_SOURCE_TARGET_REVISION --set global.namespace=$ARGOCD_APP_NAMESPACE --set global.pattern=mypattern + --set global.hubClusterDomain=hub.example.com --set global.valuesDirectoryURL=https://github.com/pattern-clone/mypattern/raw/main --post-renderer ./kustomize\"] \ \n" @@ -220,6 +229,7 @@ spec: cpu: 500m memory: 2Gi dex: + openShiftOAuth: true resources: limits: cpu: 500m @@ -287,32 +297,6 @@ spec: targetNamespaces: - application-ci --- -# Source: pattern-clustergroup/templates/subsciptions.yaml -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: advanced-cluster-management - namespace: open-cluster-management -spec: - name: advanced-cluster-management - source: redhat-operators - sourceNamespace: openshift-marketplace - channel: release-2.3 - installPlanApproval: Automatic ---- -# Source: pattern-clustergroup/templates/subsciptions.yaml -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: openshift-pipelines-operator-rh - namespace: openshift-operators -spec: - name: openshift-pipelines-operator-rh - source: redhat-operators - sourceNamespace: openshift-marketplace - channel: stable - installPlanApproval: Automatic ---- # Source: pattern-clustergroup/templates/subscriptions.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription diff --git a/common/tests/install-naked.expected.yaml b/common/tests/install-naked.expected.yaml index 8ec1e71..4ed9b44 100644 --- a/common/tests/install-naked.expected.yaml +++ b/common/tests/install-naked.expected.yaml @@ -38,6 +38,8 @@ spec: value: https://github.com/pattern-clone/mypattern/raw/main - name: global.pattern value: install + - name: global.hubClusterDomain + value: syncPolicy: automated: {} --- @@ -55,3 +57,7 @@ spec: name: openshift-gitops-operator source: redhat-operators sourceNamespace: openshift-marketplace + config: + env: + - name: ARGOCD_CLUSTER_CONFIG_NAMESPACES + value: install-default,openshift-gitops diff --git a/common/tests/install-normal.expected.yaml b/common/tests/install-normal.expected.yaml index 6f2fdc0..42c6541 100644 --- a/common/tests/install-normal.expected.yaml +++ b/common/tests/install-normal.expected.yaml @@ -38,6 +38,8 @@ spec: value: https://github.com/pattern-clone/mypattern/raw/main - name: global.pattern value: install + - name: global.hubClusterDomain + value: hub.example.com syncPolicy: automated: {} --- @@ -55,3 +57,7 @@ spec: name: openshift-gitops-operator source: redhat-operators sourceNamespace: openshift-marketplace + config: + env: + - name: ARGOCD_CLUSTER_CONFIG_NAMESPACES + value: install-example,openshift-gitops