Skip to content

Commit 08dced3

Browse files
committed
[ote] Add windows-ote-setup step for WMCO non-payload OTE binary
WMCO is an OLM optional operator (not CVO-managed payload), so the standard payload-based OTE binary registration does not apply. This step implements the non-payload OTE binary mechanism introduced in openshift/origin#30863 (TestExtensionAdmission CRD + ImageStreamTag annotations). When run after WMCO is deployed: 1. Creates an ImageStream in the WMCO namespace pointing to the CI image (built from Dockerfile.ci, which includes wmco-tests-ext.gz) 2. Annotates the ImageStreamTag with testextension.redhat.io/component and testextension.redhat.io/binary for OTE discovery 3. Installs the TestExtensionAdmission CRD 4. Creates a TestExtensionAdmission CR permitting the WMCO namespace Added to aws-e2e-operator job to enable rehearsal testing. Related: WINC-1777, OCP-37362
1 parent 3cb8afe commit 08dced3

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

ci-operator/config/openshift/windows-machine-config-operator/openshift-windows-machine-config-operator-master.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ tests:
8989
COMPUTE_NODE_REPLICAS: "1"
9090
CONTROL_PLANE_REPLICAS: "1"
9191
test:
92+
- ref: windows-ote-setup
9293
- ref: windows-e2e-operator-test
9394
workflow: ipi-aws-ovn-hybrid
9495
- always_run: false
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
WMCO_NS="openshift-windows-machine-config-operator"
8+
9+
# OPERATOR_IMAGE is the WMCO CI image built from Dockerfile.ci, which includes
10+
# wmco-tests-ext.gz at /usr/bin/wmco-tests-ext.gz
11+
if [[ -z "${OPERATOR_IMAGE:-}" ]]; then
12+
echo "ERROR: OPERATOR_IMAGE is not set, cannot set up OTE"
13+
exit 1
14+
fi
15+
16+
echo "Setting up WMCO OTE non-payload binary registration..."
17+
echo "WMCO image: ${OPERATOR_IMAGE}"
18+
19+
# Create ImageStream in the WMCO namespace
20+
oc apply -n "$WMCO_NS" -f - <<EOF
21+
apiVersion: image.openshift.io/v1
22+
kind: ImageStream
23+
metadata:
24+
name: wmco-ote
25+
namespace: ${WMCO_NS}
26+
EOF
27+
28+
# Import the WMCO CI image as an ImageStreamTag.
29+
# The CI image (Dockerfile.ci) contains /usr/bin/wmco-tests-ext.gz.
30+
oc import-image wmco-ote:latest \
31+
-n "$WMCO_NS" \
32+
--from="${OPERATOR_IMAGE}" \
33+
--confirm
34+
35+
# Annotate the ImageStreamTag so openshift-tests can discover the OTE binary
36+
oc annotate imagestreamtag wmco-ote:latest \
37+
-n "$WMCO_NS" \
38+
--overwrite \
39+
"testextension.redhat.io/component=windows-machine-config-operator" \
40+
"testextension.redhat.io/binary=/usr/bin/wmco-tests-ext.gz"
41+
42+
# Install the TestExtensionAdmission CRD (introduced in openshift/origin#30863)
43+
openshift-tests extension-admission install-crd
44+
45+
# Create TestExtensionAdmission CR permitting the WMCO namespace
46+
openshift-tests extension-admission create wmco \
47+
--permit="${WMCO_NS}/wmco-ote"
48+
49+
echo "OTE setup complete. WMCO test binary is now discoverable by openshift-tests."
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ref:
2+
as: windows-ote-setup
3+
from: tests
4+
cli: latest
5+
commands: windows-ote-setup-commands.sh
6+
resources:
7+
requests:
8+
cpu: 100m
9+
memory: 200Mi
10+
dependencies:
11+
- env: OPERATOR_IMAGE
12+
name: windows-machine-config-operator-test
13+
documentation: |-
14+
Sets up OTE (non-payload extension binary) discovery for the Windows Machine
15+
Config Operator. Creates an ImageStream pointing to the WMCO CI image (which
16+
contains wmco-tests-ext.gz at /usr/bin/wmco-tests-ext.gz), annotates it with
17+
testextension.redhat.io annotations for OTE discovery, installs the
18+
TestExtensionAdmission CRD, and creates an admission CR permitting the WMCO
19+
namespace.
20+
21+
This step must run after WMCO is deployed and before openshift-tests runs.
22+
It implements the non-payload OTE binary mechanism from openshift/origin#30863.

0 commit comments

Comments
 (0)