diff --git a/common/acm/templates/policies/application-policies.yaml b/common/acm/templates/policies/application-policies.yaml index d854ae72..e2e717ca 100644 --- a/common/acm/templates/policies/application-policies.yaml +++ b/common/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/common/ansible/playbooks/iib-ci/lookup.yml b/common/ansible/playbooks/iib-ci/lookup.yml index f7e42ca4..f39b8ea3 100644 --- a/common/ansible/playbooks/iib-ci/lookup.yml +++ b/common/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/common/ansible/roles/iib_ci/README.md b/common/ansible/roles/iib_ci/README.md index 9f421e8f..828daa05 100644 --- a/common/ansible/roles/iib_ci/README.md +++ b/common/ansible/roles/iib_ci/README.md @@ -3,7 +3,12 @@ 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` + +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 diff --git a/common/clustergroup/templates/plumbing/applications.yaml b/common/clustergroup/templates/plumbing/applications.yaml index a54ed99f..3706d839 100644 --- a/common/clustergroup/templates/plumbing/applications.yaml +++ b/common/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: diff --git a/common/operator-install/README.md b/common/operator-install/README.md new file mode 100644 index 00000000..a333860e --- /dev/null +++ b/common/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/` diff --git a/common/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml b/common/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml index 330e0222..1806661d 100644 --- a/common/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml +++ b/common/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,32 @@ spec: status: description: PatternStatus defines the observed state of Pattern properties: + analyticsSent: + default: 0 + type: integer + 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 +222,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: null diff --git a/common/operator-install/templates/pattern-operator-configmap.yaml b/common/operator-install/templates/pattern-operator-configmap.yaml new file mode 100644 index 00000000..17b7a026 --- /dev/null +++ b/common/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/common/tests/acm-industrial-edge-hub.expected.yaml b/common/tests/acm-industrial-edge-hub.expected.yaml index a474b4e3..6bb30bac 100644 --- a/common/tests/acm-industrial-edge-hub.expected.yaml +++ b/common/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/common/tests/acm-medical-diagnosis-hub.expected.yaml b/common/tests/acm-medical-diagnosis-hub.expected.yaml index f54648fe..2361be7a 100644 --- a/common/tests/acm-medical-diagnosis-hub.expected.yaml +++ b/common/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/common/tests/acm-normal.expected.yaml b/common/tests/acm-normal.expected.yaml index 0429824d..a83284bb 100644 --- a/common/tests/acm-normal.expected.yaml +++ b/common/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 diff --git a/common/tests/operator-install-industrial-edge-factory.expected.yaml b/common/tests/operator-install-industrial-edge-factory.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/common/tests/operator-install-industrial-edge-factory.expected.yaml +++ b/common/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/common/tests/operator-install-industrial-edge-hub.expected.yaml b/common/tests/operator-install-industrial-edge-hub.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/common/tests/operator-install-industrial-edge-hub.expected.yaml +++ b/common/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/common/tests/operator-install-medical-diagnosis-hub.expected.yaml b/common/tests/operator-install-medical-diagnosis-hub.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/common/tests/operator-install-medical-diagnosis-hub.expected.yaml +++ b/common/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/common/tests/operator-install-naked.expected.yaml b/common/tests/operator-install-naked.expected.yaml index b32c2577..90fca51e 100644 --- a/common/tests/operator-install-naked.expected.yaml +++ b/common/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/common/tests/operator-install-normal.expected.yaml b/common/tests/operator-install-normal.expected.yaml index 8e9adf88..1c57fe6b 100644 --- a/common/tests/operator-install-normal.expected.yaml +++ b/common/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 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