Skip to content

🌱 Align ClusterObjectSet e2e cleanup with addedResources pattern#2799

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
perdasilva:e2e-cos-cleanup-alignment
Jul 8, 2026
Merged

🌱 Align ClusterObjectSet e2e cleanup with addedResources pattern#2799
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
perdasilva:e2e-cos-cleanup-alignment

Conversation

@perdasilva

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to 🌱 Add e2e regression test for cross-CE collision protection #2783 — applies the same addedResources-based cleanup pattern to ClusterObjectSets in the e2e test harness
  • ResourceIsApplied now appends ClusterObjectSets to addedResources (alongside setting clusterObjectSetName for ${COS_NAME} substitution)
  • Removes the special-case clusterObjectSetName cleanup block from ScenarioCleanup, so multiple ClusterObjectSets per scenario are all cleaned up correctly

Test plan

  • Verify e2e tests compile (go build ./test/e2e/...)
  • Run BoxcutterRuntime e2e scenarios that create ClusterObjectSets and confirm cleanup succeeds
  • Verify no leaked ClusterObjectSets remain after scenario completion

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 2, 2026 09:39
@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 2e972e6
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6a4e71901e886900087331c4
😎 Deploy Preview https://deploy-preview-2799--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the e2e test harness cleanup flow so ClusterObjectSet resources follow the same addedResources-based tracking/cleanup pattern already used for ClusterExtension, ensuring scenarios that create multiple ClusterObjectSets reliably delete all of them during ScenarioCleanup.

Changes:

  • Track applied ClusterObjectSet resources in sc.addedResources within ResourceIsApplied.
  • Remove the legacy/special-case clusterObjectSetName-based cleanup append in ScenarioCleanup, relying on addedResources instead.

Reviewed changes

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

File Description
test/e2e/steps/steps.go Adds ClusterObjectSet to addedResources when applied so cleanup can delete all COS created in a scenario.
test/e2e/steps/hooks.go Removes the special-case COS cleanup block, consolidating deletion behavior around addedResources.

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

@pedjak pedjak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Improve PR title and description for clarity

The current title describes the mechanism ("addedResources pattern") but not the problem being solved. Reviewers who haven't read #2783 won't know why alignment matters.

Suggested title:

🌱 Fix e2e cleanup to handle multiple ClusterObjectSets per scenario

Suggested description:

Follow-up to #2783, which consolidated ClusterExtension cleanup into addedResources
but left ClusterObjectSets on the legacy single-field path.

The old cleanup tracked only sc.clusterObjectSetName — a scalar that gets overwritten
on each apply. Scenarios that create multiple ClusterObjectSets would only clean up the
last one, leaking the rest. This PR applies the same fix #2783 used for ClusterExtensions:
append each applied COS to addedResources at apply time and drop the special-case
cleanup block.

What changed:

  • ResourceIsApplied now appends every ClusterObjectSet to addedResources
    (the clusterObjectSetName field is still set for ${COS_NAME} substitution)
  • ScenarioCleanup drops the single-COS cleanup block — addedResources handles it

Comment thread test/e2e/steps/steps.go
sc.addedResources = append(sc.addedResources, resource{name: res.GetName(), kind: "clusterextension"})
} else if res.GetKind() == "ClusterObjectSet" {
sc.clusterObjectSetName = res.GetName()
sc.addedResources = append(sc.addedResources, resource{name: res.GetName(), kind: "clusterobjectset"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick (non-blocking): clusterObjectSetName is still assigned here but cleanup has moved to addedResources. A short inline comment noting this field now only serves ${COS_NAME} substitution would help future readers understand why it is still set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated ^^

@pedjak

pedjak commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

thought (non-blocking): If a scenario applies the same COS name twice (e.g., updating it), addedResources will have duplicate entries and cleanup will attempt two deletes. Harmless due to --ignore-not-found=true, but noting for awareness.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2026

@rashmigottipati rashmigottipati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

Track ClusterObjectSets in addedResources when applied, matching
the pattern established for ClusterExtensions in operator-framework#2783. This removes
the special-case cleanup block in ScenarioCleanup and ensures multiple
ClusterObjectSets per scenario are all cleaned up correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@perdasilva perdasilva force-pushed the e2e-cos-cleanup-alignment branch from bc8c575 to 2e972e6 Compare July 8, 2026 15:49
Copilot AI review requested due to automatic review settings July 8, 2026 15:49
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026

@pedjak pedjak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pedjak, rashmigottipati

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 2 out of 2 changed files in this pull request and generated no new comments.

@openshift-merge-bot openshift-merge-bot Bot merged commit be16a0a into operator-framework:main Jul 8, 2026
23 checks passed
perdasilva added a commit to perdasilva/operator-controller that referenced this pull request Jul 9, 2026
…rator-framework#2799)

Track ClusterObjectSets in addedResources when applied, matching
the pattern established for ClusterExtensions in operator-framework#2783. This removes
the special-case cleanup block in ScenarioCleanup and ensures multiple
ClusterObjectSets per scenario are all cleaned up correctly.

Co-authored-by: Per G. da Silva <pegoncal@redhat.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants