Skip to content

Conversation

@anik120
Copy link
Contributor

@anik120 anik120 commented Nov 18, 2025

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 18, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 18, 2025

@anik120: This pull request references OPRUN-4228 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from bentito and perdasilva November 18, 2025 16:48
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 18, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

@anik120
Copy link
Contributor Author

anik120 commented Nov 18, 2025

/hold

for openshift/cluster-olm-operator#151 to merge first

@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 Nov 18, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 18, 2025

@anik120: This pull request references OPRUN-4228 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

In response to this:

For EP: openshift/enhancements#1890

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 openshift-eng/jira-lifecycle-plugin repository.

mkdir -p $(@D)
$(GO_BINDATA) -pkg boxcuttercatalog -o $@ -prefix "testdata/boxcutter/catalog" testdata/boxcutter/catalog/...
go fmt ./$(@D)/...

Copy link
Contributor

Choose a reason for hiding this comment

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

I can see that we have a lot of it already :-(
Not a great solution

@tmshort I think we will need to look for a way to improve it at some stage
it is not maintainable.

@anik120 anik120 force-pushed the add-boxcutter-ote-tests branch 3 times, most recently from 72637ae to 7d4cb15 Compare November 18, 2025 17:23
Expect(foundOwnerRef).To(BeTrue(), "ClusterExtension should be in owner references")

By("verifying the revision has proper labels")
Expect(revision.Labels).To(HaveKeyWithValue("olm.operatorframework.io/owner", name),
Copy link
Contributor

Choose a reason for hiding this comment

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

That will be owner-name and can we have a const on top of the file.
I think we will use more than once

err = k8sClient.Get(ctx, client.ObjectKey{Name: revision2Name}, &revision2)
Expect(err).ToNot(HaveOccurred(), "revision-2 should exist")

By("verifying revision-2 is Active")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shoild we not check that the revision-1 is Archived ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@camilamacedo86

https://github.com/operator-framework/operator-controller/blob/main/internal/operator-controller/applier/boxcutter.go#L311-L407

From what I can see in the code that's in main, the apply() function creates a new revision when upgrading, but doesn't modify the lifecycle state of previous revisions. Unit tests also show that revisions must be manually set to Archived state. And then GC logic (setPreviousRevisions) only deletes revisions that are already in Archived state.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please check with the main changes? See the demo: #560 (comment)

Comment on lines +289 to +284
// NOTE: GC only deletes ARCHIVED revisions beyond the limit of 5.
// Active revisions are NEVER deleted regardless of count.
// We archive 6 revisions here, so when we later trigger a new revision,
// the oldest archived revision (revision-1) should be deleted,
// keeping 5 archived revisions (2-6) + active revisions (7-9).
Copy link
Contributor

Choose a reason for hiding this comment

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

All of this workaround should not be required after we get sync with downstream; operator-framework/operator-controller#2315

(see the demo in the PR)

err := k8sClient.Get(ctx, client.ObjectKey{Name: revisionName}, &revision)
g.Expect(err).ToNot(HaveOccurred())

revision.Spec.LifecycleState = olmv1.ClusterExtensionRevisionLifecycleStateArchived
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn’t archive it manually — that should be handled by OLM, right?

So we need to test the expected behavior, and if it’s failing, then we’ll know it needs to be fixed. I believe operator-framework/operator-controller#2315 will address it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh so looks like this isn't in downstream yet. However, based on a quick look, looks like the archiving behavior is unchanged - ie there's still no automatic archiving behavior - @perdasilva is this intended?

Ack that once this PR downstreams I need to change incorporate the switch from spec.previous field to label-based discovery using olm.operatorframework.io/owner label

Copy link
Contributor

@camilamacedo86 camilamacedo86 Nov 20, 2025

Choose a reason for hiding this comment

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

ie there's still no automatic archiving behavior

Can you please test it out?
See the demo: https://asciinema.org/a/qupccwlIdeprj8VvjF7OOko9t
It is fixed with: operator-framework/operator-controller#2315

ext.Annotations["test.boxcutter/trigger-gc"] = "true"
err = k8sClient.Update(ctx, &ext)
g.Expect(err).ToNot(HaveOccurred())
}).WithTimeout(helpers.DefaultTimeout).WithPolling(helpers.DefaultPolling).Should(Succeed())
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think that we should test it.
What IHMO we need to check is when we uninstall a ClusterExtension all revisions are not left orphoned and are either removed.

@anik120 anik120 force-pushed the add-boxcutter-ote-tests branch from 7d4cb15 to 9dac49c Compare November 20, 2025 14:56
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 20, 2025

@anik120: The following tests 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-olmv1-ext 9dac49c link true /test e2e-aws-olmv1-ext
ci/prow/e2e-aws-techpreview-olmv1-ext 9dac49c link true /test e2e-aws-techpreview-olmv1-ext
ci/prow/openshift-e2e-aws 9dac49c link true /test openshift-e2e-aws
ci/prow/tests-extension 9dac49c link true /test tests-extension

Full PR test history. Your PR dashboard.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants