Skip to content

Conversation

@perdasilva
Copy link
Contributor

@perdasilva perdasilva commented Jan 20, 2026

Description

Updates e2e suite to add the uninstall feature with two tests:

  • cluster extension resource deletion leads to resource removal
  • cluster extension resource deletion leads to resource removal even if the cluster extension service account is not present

Updates the ClusterExtension is rolled out step to collect the cluster extension resources and attach them to the test's context

The following steps are added:

  • ClusterExtension resources are created and labeled: checks that the extension resources in the context exist and carry the appropriate olm owner-kind and owner-name labels
  • ClusterExtension is removed: deletes the ClusterExtension under test
  • ClusterExtension resources are removed: checks that the extension resources in the context (eventually) no longer exist on the cluster
  • resource <some resource> is eventually not found: checks that the resource is eventually not on the cluster

The extension resources are acquired from either the Helm release secret or the latest active ClusterExtensionRevision for the ClusterExtension depending on the feature-gate settings.

Note: OLM's internal helm client uses a custom release backend that can handle arbitrarily large bundles. In the e2e implementation, getting the helm release resources does not yet support sharded releases because:

  • it goes a little beyond the intention of this PR
  • its not needed for the current test suite
  • Boxcutter does not yet support arbitrarily large bundles -> e2e's should be updated for this case when we work on that story

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 January 20, 2026 17:16
@openshift-ci openshift-ci bot requested review from bentito and pedjak January 20, 2026 17:16
@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit a3f4ae0
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/697b81cf8d42530008000f65
😎 Deploy Preview https://deploy-preview-2453--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.

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

This PR adds an end-to-end test for verifying that bundle resources are properly removed when a ClusterExtension is uninstalled. The test uses the Gherkin BDD format to define the uninstall scenario.

Changes:

  • Added new uninstall.feature file with a test scenario that verifies resource cleanup after ClusterExtension deletion

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

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.52%. Comparing base (dbc4af3) to head (a3f4ae0).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2453      +/-   ##
==========================================
- Coverage   74.02%   73.52%   -0.50%     
==========================================
  Files         101      102       +1     
  Lines        7991     8231     +240     
==========================================
+ Hits         5915     6052     +137     
- Misses       1626     1718      +92     
- Partials      450      461      +11     
Flag Coverage Δ
e2e 46.92% <ø> (-0.19%) ⬇️
experimental-e2e 54.34% <ø> (-0.38%) ⬇️
unit 57.55% <ø> (-0.11%) ⬇️

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.

@perdasilva perdasilva marked this pull request as draft January 20, 2026 18:27
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2026
@perdasilva perdasilva marked this pull request as ready for review January 21, 2026 07:28
Copilot AI review requested due to automatic review settings January 21, 2026 07:28
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 21, 2026
@openshift-ci openshift-ci bot requested review from grokspawn and trgeiger January 21, 2026 07:28
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 2 out of 2 changed files in this pull request and generated 1 comment.


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

@perdasilva perdasilva changed the title 🌱 Add unintall feature test 🌱 Add uninstall feature test Jan 21, 2026
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Just I nit otherwise
/approved

@perdasilva
Copy link
Contributor Author

/hold to add another test

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2026
Copilot AI review requested due to automatic review settings January 21, 2026 14:08
@perdasilva
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2026
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 2 out of 2 changed files in this pull request and generated 4 comments.


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

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2026
@camilamacedo86
Copy link
Contributor

/lgtm cancel

I think we need a second person doing reviews too :-)

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2026
@tmshort
Copy link
Contributor

tmshort commented Jan 28, 2026

/lgtm cancel

I think we need a second person doing reviews too :-)

I was ok with it, but @pedjak needed to check his concerns were addressed.


Scenario: Removing ClusterExtension triggers the extension uninstall, eventually removing all installed resources
When ClusterExtension is removed
Then ClusterExtension is uninstalled
Copy link
Contributor

@pedjak pedjak Jan 28, 2026

Choose a reason for hiding this comment

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

we should be here more verbose, i.e. to replace "uninstalled" with what actually happens:

Suggested change
Then ClusterExtension is uninstalled
Then resources being part of ClusterExtension are removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would "ClusterExtension resources are removed" work as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Would "ClusterExtension resources are removed" work as well?

hm, not sure. When I read it like that I would understand it as resources of type ClusterExtension are removed. What we actually assert that all resources owned by the removed ClusterExtension are removed too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about "the ClusterExtension's constituent resources are removed"?

kind := obj.GetObjectKind().GroupVersionKind().Kind
clusterObj, err := getResource(kind, obj.GetName(), obj.GetNamespace())
if err != nil {
godog.Logf(ctx, "error getting resource name=%q namespace=%q kind=%q: %v", obj.GetName(), obj.GetNamespace(), kind, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

use logger instance.

Comment on lines 324 to 328
if labels["olm.operatorframework.io/owner-kind"] != "ClusterExtension" {
godog.Logf(ctx, "resource name=%q namespace=%q kind=%q has bad owner-kind label %q (expected=ClusterExtension)", obj.GetName(), obj.GetNamespace(), kind, labels["olm.operatorframework.io/owner-kind"])
return false
}
if labels["olm.operatorframework.io/owner-name"] != sc.clusterExtensionName {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: perhaps you can declare a map with labels you want to check and then have a for loop over them?

return fmt.Errorf("resource %s is not in the format <kind>/<name>", resource)
}

require.Eventually(godog.T(ctx), func() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

use waitFor method available in this file already.

Comment on lines 33 to 35
And resource "networkpolicy/test-operator-network-policy" is installed
And resource "configmap/test-configmap" is installed
And resource "deployment/test-operator" is installed
Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep the verbose assertions here, because it can gives us better signal when the test fails.

Comment on lines 60 to 62
And resource "networkpolicy/test-operator-network-policy" is installed
And resource "configmap/test-configmap" is installed
And resource "deployment/test-operator" is installed
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above.

"github.com/cucumber/godog"
jsonpatch "github.com/evanphx/json-patch"
"github.com/google/go-cmp/cmp"
diff "github.com/google/go-cmp/cmp"
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if we really need this diff alias, IMHO cmp is clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch - I needed to make that change in an earlier iteration where we imported the standard cmp library!

Copilot AI review requested due to automatic review settings January 29, 2026 11:10
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 3 out of 3 changed files in this pull request and generated 3 comments.


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

Copilot AI review requested due to automatic review settings January 29, 2026 12:22
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 3 out of 3 changed files in this pull request and generated 2 comments.


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

@perdasilva perdasilva force-pushed the uninstall-e2e-test branch 2 times, most recently from 425545d to 34dcd55 Compare January 29, 2026 15:36
Signed-off-by: Per Goncalves da Silva <[email protected]>
Copilot AI review requested due to automatic review settings January 29, 2026 15:50
Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jan 29, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, pedjak, tmshort

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:
  • OWNERS [camilamacedo86,pedjak,tmshort]

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 lgtm Indicates that a PR is ready to be merged. label Jan 29, 2026
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 3 out of 3 changed files in this pull request and generated no new comments.


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

@openshift-merge-bot openshift-merge-bot bot merged commit fbe909f into operator-framework:main Jan 29, 2026
40 of 41 checks passed
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.

5 participants