CMP-4475: Install OpenShift Virtualization operator for OCP-Virt e2e#78
CMP-4475: Install OpenShift Virtualization operator for OCP-Virt e2e#78Vincent056 wants to merge 5 commits into
Conversation
Add an optional setup step that installs the OpenShift Virtualization (CNV) operator and creates the HyperConverged CR before the tests run, so the CIS OpenShift Virtualization profiles can be scanned on a cluster that does not already have CNV. Gated by the new -install-virt flag (default false) and idempotent if CNV is already present. Also adds an -install-virt and -cel-content-file config plumbing; wiring the CEL ProfileBundle (spec.celContentFile) is marked as a follow-up TODO pending a bump of the vendored compliance-operator API to >= v1.9.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
Retry HyperConverged CR creation to tolerate the operator webhook not being ready right after the CRD appears. Add an opt-in TestInstallVirtLive (RUN_VIRT_LIVE=1) that exercises the installer against a real cluster. Validated on an OCP 4.21 cluster: CNV installs and HyperConverged reaches Available in ~4 minutes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…docs Expose INSTALL_VIRT and CEL_CONTENT_FILE make variables and pass the corresponding -install-virt / -cel-content-file flags from the e2e-profile and e2e-profile-remediations targets, so a CI lane can run the OCP-Virt CEL profiles (which need CNV installed and a CEL content file). Add docs/ocp-virt-e2e.md documenting the flags, local run, the CNV install step, a proposed CI lane, and the on-cluster validation results. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep the Makefile wiring; the OCP-Virt e2e usage notes live in the PR discussion instead of a checked-in doc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OpenShift Virtualization (CIS VM Extension) e2e — usage & validationThe OCP-Virt profiles (e.g.
Flags
Running locally# 1. Build the content image with the CEL content bundle (in the content checkout):
./build_product ocp4 --datastream --cel-content=ocp4
# -> build/ssg-ocp4-ds.xml and build/ocp4-cel-content.yaml
# Package both into an image and push to a registry the cluster can pull.
# 2. Run the OCP-Virt profile e2e (installs CNV itself):
export PROFILE=cis-vm-extension PRODUCT=ocp4
export INSTALL_VIRT=true CEL_CONTENT_FILE=ocp4-cel-content.yaml
make e2e-profile # go test also needs -content-image=<your image>What the CNV install step does
Opt-in live test for just this path: RUN_VIRT_LIVE=1 go test ./helpers -run TestInstallVirtLive -timeout 40m -vProposed CI lane (openshift/release, tracked separately)- as: e2e-aws-ocp4-cis-vm-extension
steps:
cluster_profile: quay-aws
test:
- as: test
commands: |
export PROFILE=cis-vm-extension PRODUCT=ocp4
export INSTALL_VIRT=true CEL_CONTENT_FILE=ocp4-cel-content.yaml
make e2e-profile
workflow: ipi-awsValidation (OCP 4.21 + AWS)
|
…tFile Bump the vendored ComplianceAsCode/compliance-operator API from v1.7.0 to v1.9.0 (the release that adds ProfileBundle.spec.celContentFile), aligning the k8s stack to match: k8s.io/* v0.30 -> v0.35.3, controller-runtime v0.20.4 -> v0.23.3, plus the openshift/api and openshift/client-go replaces from v1.9.0. With the typed field available, set pb.Spec.CELContentFile directly in ensureTestProfileBundles for the ocp4 bundle (removing the earlier TODO / unstructured workaround), so the harness creates a CEL ProfileBundle for the OCP-Virt profiles. go build/vet/test-compile pass; the k8s/controller-runtime upgrade required no code changes in the harness. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@Vincent056: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What
Adds the setup and plumbing to run the CIS OpenShift Virtualization (
cis-vm-extension) CEL profiles e2e on a cluster that doesn't ship CNV.helpers/virtualization.go, gated on-install-virt, default false): creates theopenshift-cnvnamespace, an OperatorGroup, a Subscription forkubevirt-hyperconverged(channelstable,redhat-operators), waits for theHyperConvergedAPI, creates theHyperConvergedCR (retrying to tolerate the operator webhook), and waits until it isAvailable. Idempotent; leaves existing CNV in place. Called fromhelpers/Setup.ComplianceAsCode/compliance-operatorAPI to v1.9.0 (addsProfileBundle.spec.celContentFile) and setspb.Spec.CELContentFilefor the ocp4 bundle when-cel-content-fileis provided, so CEL profiles are parsed. The k8s stack is aligned to match v1.9.0 (k8s.io/* v0.30 -> v0.35.3, controller-runtime v0.20.4 -> v0.23.3) — no harness code changes were needed for the upgrade.-install-virt/-cel-content-fileinconfig;INSTALL_VIRTandCEL_CONTENT_FILEmake vars are passed tomake e2e-profileandmake e2e-profile-remediations.TestInstallVirtLive(RUN_VIRT_LIVE=1) exercising the installer.Usage, the proposed CI lane, and full validation details are in a PR comment.
Validation (OCP 4.21 + AWS + CNV)
TestInstallVirtLivepassed — CNV installs andHyperConvergedreachesAvailablein ~4 min (no metal nodes needed for the operator/HCO config the CEL rules read).celContentFile: ocp4-cel-content.yamlparsed VALID; the operator created thecis-vm-extensionCEL profile and itsscannerType: CELrules; a ScanSettingBinding ran the scan to completion and produced per-ruleComplianceCheckResults. (Validated with a manually-created ProfileBundle; the typedCELContentFilewiring constructs the same object.)go build/go vet/ test-compile pass;gofmtclean. The dep bump is not yet runtime-tested end-to-end (cluster expired) — worth a smoke run on the next cluster before merge.Follow-ups (not in this PR)
e2e-aws-ocp4-cis-vm-extension) — see the PR comment.Jira: https://issues.redhat.com/browse/CMP-4475
🤖 Generated with Claude Code