Skip to content

Commit

Permalink
Clean up dependency installation in stf-run-ci (#455)
Browse files Browse the repository at this point in the history
* Clean up dependency installation in stf-run-ci

Clean up the dependency installation when not using index images (which
installs dependencies via dependencies.yaml). Adjust installation of
cert-manager for versions of OCP 4.10 vs 4.12 and later.

* Move ObO CatalogSource removal to pre-clean stage
  • Loading branch information
leifmadsen authored Sep 13, 2023
1 parent 0d1c4da commit f490a9f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 46 deletions.
15 changes: 14 additions & 1 deletion build/stf-run-ci/tasks/pre-clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@
displayName: OperatorHub.io Operators
publisher: OperatorHub.io

# Upstream Source + Sub from https://github.com/rhobs/observability-operator/tree/main/hack/olm
# Moved to using Community Operators Catalog, so no longer require upstream CatalogSource. Eventually move to Red Hat Operators CatalogSource.
- name: Remove Red Hat Observability Operator CatalogSource if it is installed
k8s:
state: absent
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
annotations:
name: observability-operator
namespace: openshift-marketplace

- name: Remove CloudOps CatalogSource if it is installed
k8s:
state: absent
Expand Down Expand Up @@ -130,4 +143,4 @@
kind: Elasticsearch
metadata:
name: elasticsearch
namespace: "{{ namespace }}"
namespace: "{{ namespace }}"
90 changes: 45 additions & 45 deletions build/stf-run-ci/tasks/setup_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
name: certified-operators
- disabled: false
name: redhat-operators
- disabled: "{{ false if __service_telemetry_observability_strategy in ['use_community', 'use_hybrid'] else true }}"
- disabled: false
name: community-operators

- name: Create OperatorGroup
- name: Create OperatorGroup for service-telemetry
k8s:
definition:
apiVersion: operators.coreos.com/v1
Expand All @@ -28,7 +28,8 @@
targetNamespaces:
- "{{ namespace }}"

- when: not __deploy_from_index_enabled | bool
# deploy cert-manager from tech-preview when using versions of OCP < 4.12
- when: not __deploy_from_index_enabled | bool and ocp_ver.stdout is version ('4.12', '<')
block:
- name: Create openshift-cert-manager-operator namespace
k8s:
Expand Down Expand Up @@ -66,6 +67,28 @@
source: redhat-operators
sourceNamespace: openshift-marketplace

# deploy cert-manager from stable-v1 in 4.12 and later using namespace scoped operator
- when: not __deploy_from_index_enabled | bool and ocp_ver.stdout is version ('4.12', '>=')
block:
- name: Subscribe to Cert Manager for OpenShift Operator
k8s:
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
labels:
operators.coreos.com/openshift-cert-manager-operator.service-telemetry: ""
name: openshift-cert-manager-operator-stable-v1-redhat-operators-openshift-marketplace
namespace: service-telemetry
spec:
channel: stable-v1
installPlanApproval: Automatic
name: openshift-cert-manager-operator
source: redhat-operators
sourceNamespace: openshift-marketplace

- when: not __deploy_from_index_enabled | bool
block:
- name: Subscribe to AMQ Interconnect Operator
k8s:
definition:
Expand Down Expand Up @@ -98,6 +121,25 @@
when:
- __service_telemetry_observability_strategy == "use_community"

- name: Subscribe to Red Hat Obervability Operator
k8s:
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
labels:
operators.coreos.com/observability-operator.openshift-operators: ""
name: observability-operator
namespace: openshift-operators
spec:
channel: stable
installPlanApproval: Automatic
name: observability-operator
source: community-operators
sourceNamespace: openshift-marketplace
when:
- __service_telemetry_observability_strategy in ['use_redhat', 'use_hybrid']

- name: Subscribe to Elastic Cloud on Kubernetes Operator
k8s:
definition:
Expand All @@ -122,45 +164,3 @@
until: eckCRD.resources[0] is defined
retries: 5
delay: 30

- block:
# Upstream Source + Sub from https://github.com/rhobs/observability-operator/tree/main/hack/olm
- name: Create CatalogSource for Red Hat Observability Operator
k8s:
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
annotations:
name: observability-operator
namespace: openshift-marketplace
spec:
displayName: Observability Operator - Test
icon:
base64data: ""
mediatype: ""
image: quay.io/rhobs/observability-operator-catalog:latest
publisher: Sunil Thaha
sourceType: grpc
updateStrategy:
registryPoll:
interval: 10m0s

- name: Subscribe to Red Hat Obervability Operator
k8s:
definition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
labels:
operators.coreos.com/observability-operator.openshift-operators: ""
name: observability-operator
namespace: openshift-operators
spec:
channel: development
installPlanApproval: Automatic
name: observability-operator
source: observability-operator
sourceNamespace: openshift-marketplace
when:
- __service_telemetry_observability_strategy in ['use_redhat', 'use_hybrid']

0 comments on commit f490a9f

Please sign in to comment.