From 42520a1fd8a7dcba4f906afdc8c8912d96050376 Mon Sep 17 00:00:00 2001 From: oraz Date: Tue, 9 Apr 2024 08:31:26 +0300 Subject: [PATCH 1/2] Include NMO upgrade installation test in OCP-e2e cluster test Make OCP-e2e cluster test a three steps test- installing old version, update to latest, test e2e test --- ...-node-maintenance-operator-main__4.16.yaml | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml b/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml index d8ad31d1207f..e3648f614f30 100644 --- a/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml +++ b/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml @@ -3,10 +3,6 @@ base_images: name: "4.16" namespace: ocp tag: base - cli-operator-sdk: - name: cli-operator-sdk - namespace: ocp - tag: v1.30.0 binary_build_commands: make build build_root: from_repository: true @@ -43,22 +39,52 @@ tests: skip_if_only_changed: ^docs/|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ steps: cluster_profile: medik8s-aws - dependencies: - OO_BUNDLE: my-bundle env: BASE_DOMAIN: medik8s-ci.projects.ecosystem.sysdeseng.com - OO_INSTALL_NAMESPACE: nmo-install + INSTALL_NAMESPACE: nmo-install test: + - as: e2e-install-operator + cli: latest + commands: | + oc create namespace "$INSTALL_NAMESPACE" + + # workaround for OLM pod not running with restricted PSA + oc label --overwrite ns "$INSTALL_NAMESPACE" security.openshift.io/scc.podSecurityLabelSync=false + oc label --overwrite ns "$INSTALL_NAMESPACE" pod-security.kubernetes.io/enforce=privileged + + OPERATOR_NAMESPACE="$INSTALL_NAMESPACE" VERSION=0.17.0 make bundle-run + env: + - name: INSTALL_NAMESPACE + from: src + resources: + requests: + cpu: 100m + memory: 200Mi + - as: e2e-upgrade-operator + cli: latest + commands: OPERATOR_NAMESPACE="$INSTALL_NAMESPACE" BUNDLE_IMG="$OO_BUNDLE" make + bundle-run-update + dependencies: + - env: OO_BUNDLE + name: my-bundle + env: + - name: INSTALL_NAMESPACE + from: src + resources: + requests: + cpu: 100m + memory: 200Mi - as: e2e-test - commands: export OPERATOR_NS="$OO_INSTALL_NAMESPACE" && make cluster-functest + cli: latest + commands: export OPERATOR_NS="$INSTALL_NAMESPACE" && make cluster-functest env: - - name: OO_INSTALL_NAMESPACE + - name: INSTALL_NAMESPACE from: src resources: requests: cpu: 100m memory: 200Mi - workflow: optional-operators-ci-operator-sdk-aws + workflow: ipi-aws zz_generated_metadata: branch: main org: medik8s From 062a363bd7e9cdae0040fb5d6408a92b05439e00 Mon Sep 17 00:00:00 2001 From: oraz Date: Tue, 9 Apr 2024 09:19:04 +0300 Subject: [PATCH 2/2] Use quay released version Fetch old released version from Quay for the first installation --- ...-node-maintenance-operator-main__4.16.yaml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml b/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml index e3648f614f30..b0c75c76eec5 100644 --- a/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml +++ b/ci-operator/config/medik8s/node-maintenance-operator/medik8s-node-maintenance-operator-main__4.16.yaml @@ -41,34 +41,34 @@ tests: cluster_profile: medik8s-aws env: BASE_DOMAIN: medik8s-ci.projects.ecosystem.sysdeseng.com - INSTALL_NAMESPACE: nmo-install + OPERATOR_NAMESPACE: nmo-install test: - - as: e2e-install-operator + - as: e2e-install-operator-last-version cli: latest commands: | - oc create namespace "$INSTALL_NAMESPACE" + oc create namespace "$OPERATOR_NAMESPACE" # workaround for OLM pod not running with restricted PSA - oc label --overwrite ns "$INSTALL_NAMESPACE" security.openshift.io/scc.podSecurityLabelSync=false - oc label --overwrite ns "$INSTALL_NAMESPACE" pod-security.kubernetes.io/enforce=privileged + oc label --overwrite ns "$OPERATOR_NAMESPACE" security.openshift.io/scc.podSecurityLabelSync=false + oc label --overwrite ns "$OPERATOR_NAMESPACE" pod-security.kubernetes.io/enforce=privileged - OPERATOR_NAMESPACE="$INSTALL_NAMESPACE" VERSION=0.17.0 make bundle-run + # OPERATOR_NAMESPACE variable is used by bundle-run and bundle-run-update + BUNDLE_IMG=quay.io/medik8s/node-maintenance-operator-bundle:v0.17.0 make bundle-run env: - - name: INSTALL_NAMESPACE + - name: OPERATOR_NAMESPACE from: src resources: requests: cpu: 100m memory: 200Mi - - as: e2e-upgrade-operator + - as: e2e-upgrade-operator-latest cli: latest - commands: OPERATOR_NAMESPACE="$INSTALL_NAMESPACE" BUNDLE_IMG="$OO_BUNDLE" make - bundle-run-update + commands: BUNDLE_IMG="$OO_BUNDLE" make bundle-run-update dependencies: - env: OO_BUNDLE name: my-bundle env: - - name: INSTALL_NAMESPACE + - name: OPERATOR_NAMESPACE from: src resources: requests: @@ -76,9 +76,9 @@ tests: memory: 200Mi - as: e2e-test cli: latest - commands: export OPERATOR_NS="$INSTALL_NAMESPACE" && make cluster-functest + commands: export OPERATOR_NS="$OPERATOR_NAMESPACE" && make cluster-functest env: - - name: INSTALL_NAMESPACE + - name: OPERATOR_NAMESPACE from: src resources: requests: