Skip to content

✨Namespace and PVC probes#2535

Open
dtfranz wants to merge 1 commit intooperator-framework:mainfrom
dtfranz:pvc-namespace-probes
Open

✨Namespace and PVC probes#2535
dtfranz wants to merge 1 commit intooperator-framework:mainfrom
dtfranz:pvc-namespace-probes

Conversation

@dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Mar 3, 2026

Adds readiness probing via CEL for namespaces and PVCs, to prevent subsequent phases from installing until their readiness checks have passed. Also adds e2e coverage via direct CER creation.

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Copilot AI review requested due to automatic review settings March 3, 2026 15:07
@netlify
Copy link

netlify bot commented Mar 3, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit ec5019e
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69a702a0f2f53d000856fd03
😎 Deploy Preview https://deploy-preview-2535--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci openshift-ci bot requested review from ankitathomas and bentito March 3, 2026 15:08
@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign pedjak for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds readiness probing for additional Kubernetes resource types (Namespaces and PVCs) using CEL-based probes in the ClusterExtensionRevision reconciliation flow, and extends the e2e framework + scenarios to validate direct CER application and phase-blocking behavior when probes fail.

Changes:

  • Add CEL readiness probes for Namespace (Active) and PersistentVolumeClaim (Bound) and wire them into the CER progress probe chain.
  • Extend e2e step framework to support direct ClusterExtensionRevision application and scenario templating via ${CER_NAME}.
  • Add new e2e feature coverage for CER install success and probe-driven phase progression/halting (PVC scenarios), plus required RBAC.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/e2e/steps/testdata/rbac-template.yaml Grants e2e SA permissions for PV/PVC resources needed by new scenarios.
test/e2e/steps/steps.go Adds ${CER_NAME} templating and helper to fetch CER objects; expands step matching for “not installed”.
test/e2e/steps/hooks.go Extends scenario context with CER name/state and updates cleanup behavior.
test/e2e/features/revision.feature New e2e feature validating direct CER apply + probe gating for PVC phases.
test/e2e/README.md Documents the new ${CER_NAME} scenario variable.
internal/operator-controller/controllers/clusterextensionrevision_controller.go Initializes and registers CEL probes for Namespace/PVC readiness in CER reconcile options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dtfranz dtfranz force-pushed the pvc-namespace-probes branch 2 times, most recently from d87dfaf to 6a9f311 Compare March 3, 2026 15:45
Copilot AI review requested due to automatic review settings March 3, 2026 15:45
Adds readiness probing via CEL for namespaces and PVCs, to prevent subsequent phases from installing until their readiness checks have passed. Also adds e2e coverage via direct CER creation.

Signed-off-by: Daniel Franz <dfranz@redhat.com>
@dtfranz dtfranz force-pushed the pvc-namespace-probes branch from 6a9f311 to ec5019e Compare March 3, 2026 15:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

out, err := k8scliWithInput(yamlContent, "apply", "-f", "-")
if err != nil {
return fmt.Errorf("failed to apply resource %v %w", out, err)
return fmt.Errorf("failed to apply resource %v %w", out, stderrOutput(err))
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt.Errorf uses %w with stderrOutput(err) (a string), which will not compile because %w requires an error. Keep wrapping err with %w and include stderr via %s (or similar) as a separate formatting argument.

Suggested change
return fmt.Errorf("failed to apply resource %v %w", out, stderrOutput(err))
return fmt.Errorf("failed to apply resource %v: %s: %w", out, stderrOutput(err), err)

Copilot uses AI. Check for mistakes.
sc.Step(`^(?i)resource "([^"]+)" is available$`, ResourceAvailable)
sc.Step(`^(?i)resource "([^"]+)" is removed$`, ResourceRemoved)
sc.Step(`^(?i)resource "([^"]+)" is eventually not found$`, ResourceEventuallyNotFound)
sc.Step(`^(?i)resource "([^"]+)" is (eventually not found|not installed)$`, ResourceEventuallyNotFound)
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex adds a second capture group (eventually not found|not installed), which requires ResourceEventuallyNotFound to accept an additional string argument; otherwise Godog step binding will fail at runtime. If the handler doesn’t need the phrase, make the alternation non-capturing (e.g., (?:...)) or split into two separate steps with appropriately matched handler signatures.

Suggested change
sc.Step(`^(?i)resource "([^"]+)" is (eventually not found|not installed)$`, ResourceEventuallyNotFound)
sc.Step(`^(?i)resource "([^"]+)" is (?:eventually not found|not installed)$`, ResourceEventuallyNotFound)

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.60%. Comparing base (55473d8) to head (ec5019e).

Files with missing lines Patch % Lines
...controllers/clusterextensionrevision_controller.go 64.70% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2535      +/-   ##
==========================================
- Coverage   68.62%   68.60%   -0.03%     
==========================================
  Files         131      131              
  Lines        9288     9304      +16     
==========================================
+ Hits         6374     6383       +9     
- Misses       2427     2434       +7     
  Partials      487      487              
Flag Coverage Δ
e2e 42.53% <0.00%> (+0.18%) ⬆️
experimental-e2e 51.95% <64.70%> (-0.07%) ⬇️
unit 53.62% <5.88%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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