From 3740cb53f2f7648dfe5e6b0018767322e68e6654 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Mon, 16 Oct 2023 23:16:24 +0200 Subject: [PATCH 1/9] Push localClusterName to remote clusters too Use the same approach e use in the operator to obtain the short-name of the cluster https://github.com/validatedpatterns/patterns-operator/blob/main/controllers/argo.go#L77 Tested on MCG and observed that values.localClusterName was `sno1` on the hub and `sno2` on the regional cluster. --- acm/templates/policies/application-policies.yaml | 2 ++ tests/acm-industrial-edge-hub.expected.yaml | 2 ++ tests/acm-medical-diagnosis-hub.expected.yaml | 2 ++ tests/acm-normal.expected.yaml | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/acm/templates/policies/application-policies.yaml b/acm/templates/policies/application-policies.yaml index d854ae72..e2e717ca 100644 --- a/acm/templates/policies/application-policies.yaml +++ b/acm/templates/policies/application-policies.yaml @@ -69,6 +69,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ `{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}` }}' + - name: global.localClusterName + value: '{{ `{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}` }}' - name: global.clusterPlatform value: {{ $.Values.global.clusterPlatform }} - name: clusterGroup.name diff --git a/tests/acm-industrial-edge-hub.expected.yaml b/tests/acm-industrial-edge-hub.expected.yaml index a474b4e3..6bb30bac 100644 --- a/tests/acm-industrial-edge-hub.expected.yaml +++ b/tests/acm-industrial-edge-hub.expected.yaml @@ -233,6 +233,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name diff --git a/tests/acm-medical-diagnosis-hub.expected.yaml b/tests/acm-medical-diagnosis-hub.expected.yaml index f54648fe..2361be7a 100644 --- a/tests/acm-medical-diagnosis-hub.expected.yaml +++ b/tests/acm-medical-diagnosis-hub.expected.yaml @@ -224,6 +224,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name diff --git a/tests/acm-normal.expected.yaml b/tests/acm-normal.expected.yaml index 0429824d..a83284bb 100644 --- a/tests/acm-normal.expected.yaml +++ b/tests/acm-normal.expected.yaml @@ -627,6 +627,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name @@ -721,6 +723,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name From a8417e7cb51234610f55f17d9d3931499f1bf59d Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 19 Oct 2023 12:16:21 +0200 Subject: [PATCH 2/9] Update CRD for the operator --- ...ops.hybrid-cloud-patterns.io_patterns.yaml | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml b/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml index 330e0222..ce5b2c07 100644 --- a/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml +++ b/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml @@ -1,9 +1,9 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.4 - creationTimestamp: null name: patterns.gitops.hybrid-cloud-patterns.io spec: group: gitops.hybrid-cloud-patterns.io @@ -72,30 +72,10 @@ spec: type: array gitOpsSpec: properties: - manualApproval: - description: 'Require manual confirmation before installing and - upgrading operators. Default: False' - type: boolean manualSync: description: 'Require manual intervention before Argo will sync new content. Default: False' type: boolean - operatorCSV: - description: Specific version of openshift-gitops to deploy. Requires - UseCSV=True - type: string - operatorChannel: - description: 'Channel to deploy openshift-gitops from. Default: - gitops-1.8' - type: string - operatorSource: - description: 'Source to deploy openshift-gitops from. Default: - redhat-operators' - type: string - useCSV: - description: 'Dangerous. Force a specific version to be installed. - Default: False' - type: boolean type: object gitSpec: properties: @@ -163,8 +143,31 @@ spec: status: description: PatternStatus defines the observed state of Pattern properties: + analyticsSent: + type: boolean + analyticsUUID: + type: string appClusterDomain: type: string + applications: + items: + description: PatternApplicationInfo defines the Applications Status + for the Pattern. This structure is part of the PatternStatus as + an array The Application Status will be included as part of the + Observed state of Pattern + properties: + healthMessage: + type: string + healthStatus: + type: string + name: + type: string + namespace: + type: string + syncStatus: + type: string + type: object + type: array clusterDomain: type: string clusterID: @@ -218,9 +221,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: null From 02710dca2aa676330a65c4010e130f95ab938efd Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 19 Oct 2023 12:17:41 +0200 Subject: [PATCH 3/9] Add a README containing the CRD update instructions --- operator-install/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 operator-install/README.md diff --git a/operator-install/README.md b/operator-install/README.md new file mode 100644 index 00000000..a333860e --- /dev/null +++ b/operator-install/README.md @@ -0,0 +1,4 @@ +# Update CRD + +In order to update the CRD, copy the following file from the last released patterns operator version: +`cp -v patterns-operator/config/crd/bases/gitops.hybrid-cloud-patterns.io_patterns.yaml ./crds/` From 098f16afa9bafd38d68013ca9a965f66c4c7ac95 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 26 Oct 2023 17:08:56 +0200 Subject: [PATCH 4/9] Update CRD from the operator --- .../crds/gitops.hybrid-cloud-patterns.io_patterns.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml b/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml index ce5b2c07..1806661d 100644 --- a/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml +++ b/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml @@ -144,7 +144,8 @@ spec: description: PatternStatus defines the observed state of Pattern properties: analyticsSent: - type: boolean + default: 0 + type: integer analyticsUUID: type: string appClusterDomain: From d1af1f1f8001c3a12b8f949db753f6d9cec764c8 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Thu, 26 Oct 2023 11:16:23 -0500 Subject: [PATCH 5/9] Make .plugin handling consistent --- clustergroup/templates/plumbing/applications.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clustergroup/templates/plumbing/applications.yaml b/clustergroup/templates/plumbing/applications.yaml index a54ed99f..3706d839 100644 --- a/clustergroup/templates/plumbing/applications.yaml +++ b/clustergroup/templates/plumbing/applications.yaml @@ -52,7 +52,7 @@ spec: path: {{ .path }} {{- end }} {{- if .plugin }} - plugin: {{ .plugin }} + plugin: {{ .plugin | toPrettyJson }} {{- end }} {{- if not .kustomize }} helm: From 0639916ac9db996f1405f999ab2e114ee93be274 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 27 Oct 2023 08:28:59 +0200 Subject: [PATCH 6/9] Preseed the patterns-operator-config configmap This way we keep the main.gitops keys working which is needed for IIB installs. Tested with: export EXTRA_HELM_OPTS="--set main.gitops.channel=gitops-1.10" ./pattern.sh make install and correctly got gitops from 1.10 installed. --- .../templates/pattern-operator-configmap.yaml | 13 +++++++++++++ ...-install-industrial-edge-factory.expected.yaml | 15 +++++++++++++++ ...ator-install-industrial-edge-hub.expected.yaml | 15 +++++++++++++++ ...or-install-medical-diagnosis-hub.expected.yaml | 15 +++++++++++++++ tests/operator-install-naked.expected.yaml | 15 +++++++++++++++ tests/operator-install-normal.expected.yaml | 15 +++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 operator-install/templates/pattern-operator-configmap.yaml diff --git a/operator-install/templates/pattern-operator-configmap.yaml b/operator-install/templates/pattern-operator-configmap.yaml new file mode 100644 index 00000000..17b7a026 --- /dev/null +++ b/operator-install/templates/pattern-operator-configmap.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: {{ .Values.main.gitops.operatorSource }} + gitops.channel: {{ .Values.main.gitops.channel }} + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName diff --git a/tests/operator-install-industrial-edge-factory.expected.yaml b/tests/operator-install-industrial-edge-factory.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/tests/operator-install-industrial-edge-factory.expected.yaml +++ b/tests/operator-install-industrial-edge-factory.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/operator-install-industrial-edge-hub.expected.yaml b/tests/operator-install-industrial-edge-hub.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/tests/operator-install-industrial-edge-hub.expected.yaml +++ b/tests/operator-install-industrial-edge-hub.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/operator-install-medical-diagnosis-hub.expected.yaml b/tests/operator-install-medical-diagnosis-hub.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/tests/operator-install-medical-diagnosis-hub.expected.yaml +++ b/tests/operator-install-medical-diagnosis-hub.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/operator-install-naked.expected.yaml b/tests/operator-install-naked.expected.yaml index b32c2577..90fca51e 100644 --- a/tests/operator-install-naked.expected.yaml +++ b/tests/operator-install-naked.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/operator-install-normal.expected.yaml b/tests/operator-install-normal.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/tests/operator-install-normal.expected.yaml +++ b/tests/operator-install-normal.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern From 0b00146c804eedf8c532b1664fa6ac42071b09e1 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 27 Oct 2023 09:14:47 +0200 Subject: [PATCH 7/9] Small IIB cleanups --- ansible/playbooks/iib-ci/lookup.yml | 4 ++-- ansible/roles/iib_ci/README.md | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/playbooks/iib-ci/lookup.yml b/ansible/playbooks/iib-ci/lookup.yml index f7e42ca4..f39b8ea3 100644 --- a/ansible/playbooks/iib-ci/lookup.yml +++ b/ansible/playbooks/iib-ci/lookup.yml @@ -4,13 +4,13 @@ connection: local gather_facts: false vars: - rh_url: "https://datagrepper.engineering.redhat.com/raw?topic=/topic/VirtualTopic.eng.ci.redhat-container-image.index.built&contains=%s&rows_per_page=20" + rh_url: "https://datagrepper.engineering.redhat.com/raw?topic=/topic/VirtualTopic.eng.ci.redhat-container-image.index.built&delta=15780000&contains=%s" operator: "openshift-gitops-1-gitops-operator-bundle" ocp_versions: {} tasks: - name: Set url fact ansible.builtin.set_fact: - url: "{{ rh_url | format(operator + ':v') }}" + url: "{{ rh_url | format(operator) }}" - name: Fetch URI ansible.builtin.uri: diff --git a/ansible/roles/iib_ci/README.md b/ansible/roles/iib_ci/README.md index 9f421e8f..05ae49fd 100644 --- a/ansible/roles/iib_ci/README.md +++ b/ansible/roles/iib_ci/README.md @@ -3,7 +3,9 @@ A set of ansible plays to fetch an IIB (Image Index Bundle, aka a container created by the operator sdk that contains a bunch of references to operators that can be installed in an OpenShift cluster) -Run `make lookup` to see which IIBs are available. +Run `ansible-playbook common/ansible/playbooks/iib-ci/lookup.yml` to see which IIBs are available (defaults to +openshift-gitops). If you want to look up IIBs for a different operator run: +`ansible-playbook -e operator=acm-operator common/ansible/playbooks/iib-ci/lookup.yml` Typically IIB are prerelease stuff that lives on some internal boxes. What these scripts do is fetch the IIB internally, mirror it to the registry inside the cluster, parse all the needed images and mirror From 122680712874d6cc074ba7d3ae173dc83f1b05a2 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 27 Oct 2023 12:19:03 +0200 Subject: [PATCH 8/9] Add small curl example for IIB --- ansible/roles/iib_ci/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible/roles/iib_ci/README.md b/ansible/roles/iib_ci/README.md index 05ae49fd..828daa05 100644 --- a/ansible/roles/iib_ci/README.md +++ b/ansible/roles/iib_ci/README.md @@ -7,6 +7,9 @@ Run `ansible-playbook common/ansible/playbooks/iib-ci/lookup.yml` to see which I openshift-gitops). If you want to look up IIBs for a different operator run: `ansible-playbook -e operator=acm-operator common/ansible/playbooks/iib-ci/lookup.yml` +You can also try running curl manually via: +`curl -sSL "https://datagrepper.engineering.redhat.com/raw?topic=/topic/VirtualTopic.eng.ci.redhat-container-image.index.built&delta=15780000&contains=acm-operator" | jq ".raw_messages[].msg"` + Typically IIB are prerelease stuff that lives on some internal boxes. What these scripts do is fetch the IIB internally, mirror it to the registry inside the cluster, parse all the needed images and mirror those to the internal cluster registry and then set up the registries.conf files on all nodes so From 629a54c6ae2ba65f2e05eb70466f985fe1d98f84 Mon Sep 17 00:00:00 2001 From: Lester Claudio Date: Fri, 27 Oct 2023 11:49:18 -0600 Subject: [PATCH 9/9] Update CI tests --- .../common-acm-industrial-edge-hub.expected.yaml | 2 ++ ...common-acm-medical-diagnosis-hub.expected.yaml | 2 ++ tests/common-acm-normal.expected.yaml | 4 ++++ ...-install-industrial-edge-factory.expected.yaml | 15 +++++++++++++++ ...ator-install-industrial-edge-hub.expected.yaml | 15 +++++++++++++++ ...or-install-medical-diagnosis-hub.expected.yaml | 15 +++++++++++++++ tests/common-operator-install-naked.expected.yaml | 15 +++++++++++++++ .../common-operator-install-normal.expected.yaml | 15 +++++++++++++++ 8 files changed, 83 insertions(+) diff --git a/tests/common-acm-industrial-edge-hub.expected.yaml b/tests/common-acm-industrial-edge-hub.expected.yaml index a474b4e3..6bb30bac 100644 --- a/tests/common-acm-industrial-edge-hub.expected.yaml +++ b/tests/common-acm-industrial-edge-hub.expected.yaml @@ -233,6 +233,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name diff --git a/tests/common-acm-medical-diagnosis-hub.expected.yaml b/tests/common-acm-medical-diagnosis-hub.expected.yaml index f54648fe..2361be7a 100644 --- a/tests/common-acm-medical-diagnosis-hub.expected.yaml +++ b/tests/common-acm-medical-diagnosis-hub.expected.yaml @@ -224,6 +224,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name diff --git a/tests/common-acm-normal.expected.yaml b/tests/common-acm-normal.expected.yaml index 0429824d..a83284bb 100644 --- a/tests/common-acm-normal.expected.yaml +++ b/tests/common-acm-normal.expected.yaml @@ -627,6 +627,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name @@ -721,6 +723,8 @@ spec: # Requires ACM 2.6 or higher (I could not come up with something less terrible to get maj.min) - name: global.clusterVersion value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}' + - name: global.localClusterName + value: '{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}' - name: global.clusterPlatform value: aws - name: clusterGroup.name diff --git a/tests/common-operator-install-industrial-edge-factory.expected.yaml b/tests/common-operator-install-industrial-edge-factory.expected.yaml index e6502fa4..1a4aa65c 100644 --- a/tests/common-operator-install-industrial-edge-factory.expected.yaml +++ b/tests/common-operator-install-industrial-edge-factory.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/common-operator-install-industrial-edge-hub.expected.yaml b/tests/common-operator-install-industrial-edge-hub.expected.yaml index e6502fa4..1a4aa65c 100644 --- a/tests/common-operator-install-industrial-edge-hub.expected.yaml +++ b/tests/common-operator-install-industrial-edge-hub.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/common-operator-install-medical-diagnosis-hub.expected.yaml b/tests/common-operator-install-medical-diagnosis-hub.expected.yaml index e6502fa4..1a4aa65c 100644 --- a/tests/common-operator-install-medical-diagnosis-hub.expected.yaml +++ b/tests/common-operator-install-medical-diagnosis-hub.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/common-operator-install-naked.expected.yaml b/tests/common-operator-install-naked.expected.yaml index 91bb784a..6cf7ba0a 100644 --- a/tests/common-operator-install-naked.expected.yaml +++ b/tests/common-operator-install-naked.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern diff --git a/tests/common-operator-install-normal.expected.yaml b/tests/common-operator-install-normal.expected.yaml index e6502fa4..1a4aa65c 100644 --- a/tests/common-operator-install-normal.expected.yaml +++ b/tests/common-operator-install-normal.expected.yaml @@ -1,4 +1,19 @@ --- +# Source: pattern-install/templates/pattern-operator-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: patterns-operator-config + namespace: openshift-operators +data: + gitops.catalogSource: redhat-operators + gitops.channel: gitops-1.8 + + # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace + # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan + # gitops.ManualSync: GitOpsDefaultManualSync + # gitops.name: GitOpsDefaultPackageName +--- # Source: pattern-install/templates/pattern.yaml apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern