Skip to content

Commit

Permalink
Add 4.12 -> 4.13 upgrade testing for WMCO
Browse files Browse the repository at this point in the history
This copies the workflow that is used for the 4.13->4.14 upgrade, using
Azure instead of vSphere. Azure is being used as we wish to test storage
migration which occurs only for Azure across this upgrade.

The operator-sdk version was bumped to include this required fix:
operator-framework/operator-sdk#6477

`make update` was ran to generate the presubmit file
  • Loading branch information
sebsoto committed Sep 20, 2023
1 parent 49e7d74 commit 2c82ecd
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ base_images:
namespace: openshift
tag: rhel-9-release-golang-1.19-openshift-4.13
operator-sdk:
name: "4.13"
name: "4.14"
namespace: origin
tag: operator-sdk
previous-bundle:
name: "4.12"
namespace: ocp
tag: windows-machine-config-operator-bundle
previous-wmco:
name: "4.12"
namespace: ocp
tag: windows-machine-config-operator-test
binary_build_commands: make build
build_root:
from_repository: true
Expand Down Expand Up @@ -140,6 +148,90 @@ tests:
cpu: 1000m
memory: 400Mi
workflow: ipi-aws-ovn-hybrid
- always_run: false
as: azure-e2e-upgrade
steps:
cluster_profile: azure4
test:
- as: install
cli: latest
commands: |
export WMCO_NS=openshift-windows-machine-config-operator
oc create namespace $WMCO_NS
oc label --overwrite=true ns $WMCO_NS openshift.io/cluster-monitoring=true \
pod-security.kubernetes.io/enforce=privileged
# Deploy the bundle which will fail to come up due to it pointing to the operator image via a tag that is only
# available to the presubmit job it is created within. This pipeline image is removed shortly after said job
# completes, so the csv needs to be patched to point the equivalent image that has been promoted.
operator-sdk run bundle --timeout=10m --security-context-config restricted -n $WMCO_NS "$PREVIOUS_BUNDLE" \
|| oc get csv -n $WMCO_NS |awk {'print $1'} | tail -n1 | xargs oc patch csv -n $WMCO_NS --type='json' \
-p="[{\"op\": \"replace\", \"path\": \"/spec/install/spec/deployments/0/spec/template/spec/containers/0/image\", \"value\": \"$PREVIOUS_OPERATOR\"}]"
sleep 10
# Delete the deployment which will then be recreated by the subscription controller with the correct image
oc delete deployment -n $WMCO_NS windows-machine-config-operator
# oc wait will immediately fail if the deployment does not exist yet, first retry until the deployment is
# created by the subscription controller
retries=0
while ! oc get -n $WMCO_NS deployment windows-machine-config-operator; do
if [[ $retries -eq 10 ]]; then
echo max retries hit
exit 1
fi
sleep 1m
retries=$((retries+1))
done
oc wait --timeout=10m --for condition=Available -n $WMCO_NS deployment windows-machine-config-operator
dependencies:
- env: PREVIOUS_BUNDLE
name: previous-bundle
- env: PREVIOUS_OPERATOR
name: previous-wmco
from: operator-sdk
resources:
requests:
cpu: 1000m
memory: 400Mi
- as: test-setup
cli: latest
commands: |-
#!/bin/bash
set -euo pipefail
export KUBE_SSH_KEY_PATH=${CLUSTER_PROFILE_DIR}/ssh-privatekey
oc create secret generic cloud-private-key --from-file=private-key.pem="${KUBE_SSH_KEY_PATH}" -n openshift-windows-machine-config-operator
make upgrade-test-setup
from: windows-machine-config-operator-test
resources:
requests:
cpu: 1000m
memory: 400Mi
- as: upgrade
cli: latest
commands: |
export WMCO_NS=openshift-windows-machine-config-operator
operator-sdk run bundle-upgrade --timeout=10m --security-context-config restricted -n $WMCO_NS "$OO_BUNDLE"
sleep 5m
oc wait --timeout=5m --for condition=Available -n $WMCO_NS deployment windows-machine-config-operator
dependencies:
- env: OO_BUNDLE
name: wmco-bundle
from: operator-sdk
resources:
requests:
cpu: 1000m
memory: 400Mi
- as: test
cli: latest
commands: |-
#!/bin/bash
set -euo pipefail
export KUBE_SSH_KEY_PATH=${CLUSTER_PROFILE_DIR}/ssh-privatekey
make upgrade-test
from: windows-machine-config-operator-test
resources:
requests:
cpu: 1000m
memory: 400Mi
workflow: ipi-azure-ovn-hybrid
- as: platform-none-vsphere-e2e-operator
skip_if_only_changed: ^(?:docs|\.github)/|\.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,78 @@ presubmits:
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )azure-e2e-operator,?($|\s.*)
- agent: kubernetes
always_run: false
branches:
- ^release-4\.13$
- ^release-4\.13-
cluster: build04
context: ci/prow/azure-e2e-upgrade
decorate: true
labels:
ci-operator.openshift.io/cloud: azure4
ci-operator.openshift.io/cloud-cluster-profile: azure4
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-windows-machine-config-operator-release-4.13-azure-e2e-upgrade
rerun_command: /test azure-e2e-upgrade
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --lease-server-credentials-file=/etc/boskos/credentials
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --secret-dir=/usr/local/azure-e2e-upgrade-cluster-profile
- --target=azure-e2e-upgrade
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /etc/boskos
name: boskos
readOnly: true
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /usr/local/azure-e2e-upgrade-cluster-profile
name: cluster-profile
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: boskos
secret:
items:
- key: credentials
path: credentials
secretName: boskos-credentials
- name: ci-pull-credentials
secret:
secretName: ci-pull-credentials
- name: cluster-profile
secret:
secretName: cluster-secrets-azure4
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )(azure-e2e-upgrade|remaining-required),?($|\s.*)
- agent: kubernetes
always_run: false
branches:
Expand Down

0 comments on commit 2c82ecd

Please sign in to comment.