Skip to content

Commit

Permalink
Merge pull request #108 from claudiol/common-automatic-update
Browse files Browse the repository at this point in the history
Automatic common/ update
  • Loading branch information
claudiol authored Oct 27, 2023
2 parents 7a66342 + 629a54c commit 84ac25d
Show file tree
Hide file tree
Showing 23 changed files with 219 additions and 31 deletions.
2 changes: 2 additions & 0 deletions common/acm/templates/policies/application-policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions common/ansible/playbooks/iib-ci/lookup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion common/ansible/roles/iib_ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/clustergroup/templates/plumbing/applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
path: {{ .path }}
{{- end }}
{{- if .plugin }}
plugin: {{ .plugin }}
plugin: {{ .plugin | toPrettyJson }}
{{- end }}
{{- if not .kustomize }}
helm:
Expand Down
4 changes: 4 additions & 0 deletions common/operator-install/README.md
Original file line number Diff line number Diff line change
@@ -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/`
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -218,9 +222,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
13 changes: 13 additions & 0 deletions common/operator-install/templates/pattern-operator-configmap.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions common/tests/acm-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions common/tests/acm-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions common/tests/acm-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions common/tests/operator-install-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions common/tests/operator-install-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions common/tests/operator-install-naked.expected.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions common/tests/operator-install-normal.expected.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/common-acm-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/common-acm-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/common-acm-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions tests/common-operator-install-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions tests/common-operator-install-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 84ac25d

Please sign in to comment.