Skip to content

CMP-4656: Wait for TailoredProfile to be READY before creating ScanSettingBinding - #86

Merged
taimurhafeez merged 2 commits into
ComplianceAsCode:mainfrom
yuumasato:cmp-tailored-profile-ready
Sep 2, 2026
Merged

CMP-4656: Wait for TailoredProfile to be READY before creating ScanSettingBinding#86
taimurhafeez merged 2 commits into
ComplianceAsCode:mainfrom
yuumasato:cmp-tailored-profile-ready

Conversation

@yuumasato

@yuumasato yuumasato commented Sep 1, 2026

Copy link
Copy Markdown
Member

Problem

TestPlatformCompliance and TestNodeCompliance create a TailoredProfile and then immediately create a ScanSettingBinding that references it. Two issues in this path made the e2e-aws-openshift-platform-compliance presubmit hang for the full ~30-minute wait and then fail, on PRs that don't touch this code at all:

  1. No wait for the TailoredProfile to be READY. The operator's ScanSettingBinding controller can fail to generate a ComplianceSuite when it reconciles a binding whose referenced TailoredProfile has not finished rendering. The suite is then never created and the test polls until timeout:
    the Compliance Suite 'platform-scan-binding' didn't get to DONE phase:
    compliancesuites.compliance.openshift.io "platform-scan-binding" not found
    
  2. The platform TailoredProfile mixed CEL and OpenSCAP rules. It was built from every Platform rule in the ocp4 bundle, and newer content ships CEL-typed platform rules alongside the OpenSCAP ones. The operator rejects that:
    TailoredProfile cannot mix CEL-typed Rules with OpenSCAP Rules
    
    so the profile landed in ERROR and no suite was ever created.

Fix

  • Wait for READY: createTailoredProfile now waits for the TailoredProfile to reach READY before returning, so no caller (platform, ocp-node, rhcos-node) creates a binding against an unrendered profile. It fails fast (via backoff.Permanent) with the operator's ErrorMessage if the profile lands in ERROR — this is what turned the silent 30-minute timeout into an immediate, diagnostic failure that revealed issue Skip IdP setting on profiles with "moderate" prefix #2.
  • Exclude CEL rules: findPlatformRules now filters out CEL-typed rules, so the platform tailored profile contains only OpenSCAP rules. CEL checks are Platform-only, so node rule selection is unaffected.

Notes

Jira: CMP-4656

🤖 Generated with Claude Code

TestPlatformCompliance and TestNodeCompliance create a TailoredProfile and
then immediately create a ScanSettingBinding that references it. The
compliance-operator's ScanSettingBinding controller can fail to generate a
ComplianceSuite when it reconciles a binding whose referenced TailoredProfile
has not finished rendering (i.e. has not reached the READY state). When that
happens the suite is never created and the test polls for it until it times
out:

    the Compliance Suite 'platform-scan-binding' didn't get to DONE phase:
    compliancesuites.compliance.openshift.io "platform-scan-binding" not found

This is an intermittent, timing-dependent failure: whether the suite is
created depends on whether the TailoredProfile happens to be rendered before
the binding is reconciled.

Wait for each TailoredProfile to reach READY at the end of
createTailoredProfile, so no caller can create a ScanSettingBinding against an
unrendered profile. The wait fails fast (via backoff.Permanent) with the
operator's error message if the profile lands in ERROR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yuumasato yuumasato changed the title Wait for TailoredProfile to be READY before creating ScanSettingBinding CMP-4656: Wait for TailoredProfile to be READY before creating ScanSettingBinding Sep 1, 2026
The platform TailoredProfile is built from every Platform rule in the ocp4
bundle. Newer content ships CEL-typed platform rules alongside the OpenSCAP
ones, and the compliance-operator rejects a TailoredProfile that mixes the two:

    TailoredProfile cannot mix CEL-typed Rules with OpenSCAP Rules

The profile then lands in ERROR, no ComplianceSuite is generated, and the test
times out (now surfaced immediately by the READY wait added in the previous
commit).

Filter out CEL-typed rules in findPlatformRules so the platform tailored
profile only contains OpenSCAP rules. CEL checks are Platform-only, so the node
rule selection is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

@yuumasato: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-openshift-node-compliance 0a6eb76 link false /test e2e-aws-openshift-node-compliance

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@taimurhafeez
taimurhafeez merged commit 541fd80 into ComplianceAsCode:main Sep 2, 2026
5 of 6 checks passed
@yuumasato
yuumasato deleted the cmp-tailored-profile-ready branch September 3, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants