Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ tests:
COMPUTE_NODE_REPLICAS: "1"
CONTROL_PLANE_REPLICAS: "1"
test:
- ref: windows-ote-setup
- ref: windows-e2e-operator-test
workflow: ipi-aws-ovn-hybrid
- always_run: false
Expand Down
4 changes: 4 additions & 0 deletions ci-operator/step-registry/windows/ote-setup/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
approvers:
- winc-approvers
reviewers:
- winc-reviewers
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

WMCO_NS="openshift-windows-machine-config-operator"

# OPERATOR_IMAGE is the WMCO CI image built from Dockerfile.ci, which includes
# wmco-tests-ext.gz at /usr/bin/wmco-tests-ext.gz
if [[ -z "${OPERATOR_IMAGE:-}" ]]; then
echo "ERROR: OPERATOR_IMAGE is not set, cannot set up OTE"
exit 1
fi

echo "Setting up WMCO OTE non-payload binary registration..."
echo "WMCO image: ${OPERATOR_IMAGE}"

# Create the WMCO namespace if it does not yet exist.
# WMCO may not be deployed at this point; we create the namespace so the
# ImageStream can be set up before the operator is installed.
oc create namespace "$WMCO_NS" --dry-run=client -o yaml | oc apply -f -

# Create ImageStream in the WMCO namespace
oc apply -n "$WMCO_NS" -f - <<EOF
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: wmco-ote
namespace: ${WMCO_NS}
EOF

# Import the WMCO CI image as an ImageStreamTag.
# The CI image (Dockerfile.ci) contains /usr/bin/wmco-tests-ext.gz.
oc import-image wmco-ote:latest \
-n "$WMCO_NS" \
--from="${OPERATOR_IMAGE}" \
--confirm

# Annotate the ImageStreamTag so openshift-tests can discover the OTE binary
oc annotate imagestreamtag wmco-ote:latest \
-n "$WMCO_NS" \
--overwrite \
"testextension.redhat.io/component=windows-machine-config-operator" \
"testextension.redhat.io/binary=/usr/bin/wmco-tests-ext.gz"

# Create TestExtensionAdmission CR permitting the WMCO namespace.
# Note: the TestExtensionAdmission CRD is installed by the
# openshift-tests-extension-admission-crd-install step in the workflow.
openshift-tests extension-admission create wmco \
--permit="${WMCO_NS}/wmco-ote"

echo "OTE setup complete. WMCO test binary is now discoverable by openshift-tests."
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"path": "windows/ote-setup/windows-ote-setup-ref.yaml",
"owners": {
"approvers": [
"winc-approvers"
],
"reviewers": [
"winc-reviewers"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ref:
as: windows-ote-setup
from: tests
cli: latest
commands: windows-ote-setup-commands.sh
resources:
requests:
cpu: 100m
memory: 200Mi
dependencies:
- env: OPERATOR_IMAGE
name: windows-machine-config-operator-test
documentation: |-
Sets up OTE (non-payload extension binary) discovery for the Windows Machine
Config Operator. Creates an ImageStream pointing to the WMCO CI image (which
contains wmco-tests-ext.gz at /usr/bin/wmco-tests-ext.gz), annotates it with
testextension.redhat.io annotations for OTE discovery, installs the
TestExtensionAdmission CRD, and creates an admission CR permitting the WMCO
namespace.

This step must run after WMCO is deployed and before openshift-tests runs.
It implements the non-payload OTE binary mechanism from openshift/origin#30863.