Skip to content

Clear (existing) error cond from Subscription, once error resolved #3166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

anik120
Copy link
Contributor

@anik120 anik120 commented Jan 31, 2024

Description of the change:

The func removeSubsCond takes in a list of pointers to Subscription objects, modifies the
objects that the pointers point to, but return a new list of those pointers. A PR included in
the v0.25.0 release changed the way the output of that function was being used leading to a regression.
This PR fixes the removeSubsCond function, fixing the regression as a result.

Motivation for the change:

Closes #3162

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

@openshift-ci openshift-ci bot requested review from ncdc and perdasilva January 31, 2024 20:07
@anik120 anik120 force-pushed the catalog-recreate-clear-resolution-error branch 3 times, most recently from a4ffc39 to 3227583 Compare January 31, 2024 22:30
@tmshort
Copy link
Contributor

tmshort commented Feb 1, 2024

/retest

@tmshort
Copy link
Contributor

tmshort commented Feb 1, 2024

/retest

@anik120 anik120 force-pushed the catalog-recreate-clear-resolution-error branch from 3227583 to f8c215b Compare February 1, 2024 19:17
@tmshort
Copy link
Contributor

tmshort commented Feb 1, 2024

Generally looks good to me. But @m1kola has some quyestions.

@anik120
Copy link
Contributor Author

anik120 commented Feb 1, 2024

/retest

@tmshort there was a change I needed to do in the e2e test to reflect "BundleUnpacking cond is now removed instead of being set to false" in the e2e test 😅 Made that change, all tests should pass now.

The func `removeSubsCond` takes in a list of pointers to Subscription objects, modifies the
objects that the pointers point to, but return a new list of those pointers. A [PR](operator-framework#2942) included in
the v0.25.0 release [changed the way the output of that function was being used](https://github.com/operator-framework/operator-lifecycle-manager/pull/2942/files#diff-a1760d9b7ac1e93734eea675d8d8938c96a50e995434b163c6f77c91bace9990R1146-R1155) leading to a regression. This PR fixes the `removeSubsCond` function,
fixing the regression as a result.

Closes operator-framework#3162

Signed-off-by: Anik Bhattacharjee <[email protected]>
@anik120 anik120 force-pushed the catalog-recreate-clear-resolution-error branch from f8c215b to 0cb11cb Compare February 1, 2024 19:21
@tmshort
Copy link
Contributor

tmshort commented Feb 1, 2024

/lgtm
/approve

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 1, 2024
Copy link
Member

@m1kola m1kola left a comment

Choose a reason for hiding this comment

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

I'm a bit on the fence about removing the condition instead of setting it to False (see comments below), but other than that - looks good.

Type: v1alpha1.SubscriptionBundleUnpacking,
Status: corev1.ConditionFalse,
})
o.removeSubsCond(subs, v1alpha1.SubscriptionBundleUnpacking)
Copy link
Member

Choose a reason for hiding this comment

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

If we want to keep the condition, I think alternative fix will be something like this:

Suggested change
o.removeSubsCond(subs, v1alpha1.SubscriptionBundleUnpacking)
o.setSubsCond(subs, v1alpha1.SubscriptionCondition{
Type: v1alpha1.SubscriptionBundleUnpacking,
Status: corev1.ConditionFalse,
})

Because setSubsCond returns a new slice of pointers containing updated subs only (similar to old implementation of removeSubsCond).

Copy link
Member

Choose a reason for hiding this comment

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

Removing condition can potentially break clients, but given the fact:

  1. It is relatively recent change
  2. And not consistent with other conditions

I think it might be ok to remove 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.

My vote would be to remove it. Reasons I say that are:

  • When I asked around I wasn't able to get a "a user asked for it and hence it was added in there" answer.
  • Which feeds into the doubts about the usefulness of clients needing to know if BundleUnpacking is true or false. As opposed to for example, the usefulness of clients needing to know if ResolutionFailed is true or false.

Copy link
Member

Choose a reason for hiding this comment

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

Ship it! :shipit:

Copy link

openshift-ci bot commented Feb 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anik120, m1kola, tmshort

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

The pull request process is described 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 anik120 added this pull request to the merge queue Feb 2, 2024
Merged via the queue into operator-framework:master with commit 54da66a Feb 2, 2024
anik120 added a commit to anik120/operator-framework-olm that referenced this pull request Feb 2, 2024
…ror resolved

Upstream fix: operator-framework/operator-lifecycle-manager#3166

Upstream-repository: operator-lifecycle-manager
Upstream-commit: 54da66a9996632315827ba37e14823de6405b4d9

Signed-off-by: Anik Bhattacharjee <[email protected]>
@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Feb 4, 2024
anik120 added a commit to anik120/operator-lifecycle-manager that referenced this pull request Feb 5, 2024
However, this test is skipped for upstream, and runs only downstream.
This PR is a follow up to operator-framework#3166 to reflect the `BundleUnpacking` condition
removal in the remaining test.
anik120 added a commit to anik120/operator-lifecycle-manager that referenced this pull request Feb 5, 2024
PR operator-framework#3166 removes the `BundleUnpacking` condition once resolution is successful.
PR operator-framework#3166 [modified an e2e test](operator-framework@54da66a#diff-11f70fc71ac22d725767916f562789de88d06eb9ebe19f337a59fd7035a3ca2dR2448) to reflect that change.
However, the test being fixed in this PR is skipped for upstream, and runs only
downstream.This PR is a follow up to operator-framework#3166 to reflect the `BundleUnpacking` condition
removal in the remaining test.
anik120 added a commit to anik120/operator-lifecycle-manager that referenced this pull request Feb 5, 2024
PR operator-framework#3166 removes the `BundleUnpacking` condition once resolution is successful.
PR operator-framework#3166 [modified an e2e test](operator-framework@54da66a#diff-11f70fc71ac22d725767916f562789de88d06eb9ebe19f337a59fd7035a3ca2dR2448) to reflect that change.
However, the test being fixed in this PR is skipped for upstream, and runs only
downstream.This PR is a follow up to operator-framework#3166 to reflect the `BundleUnpacking` condition
removal in the remaining test.

Signed-off-by: Anik Bhattacharjee <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2024
PR #3166 removes the `BundleUnpacking` condition once resolution is successful.
PR #3166 [modified an e2e test](54da66a#diff-11f70fc71ac22d725767916f562789de88d06eb9ebe19f337a59fd7035a3ca2dR2448) to reflect that change.
However, the test being fixed in this PR is skipped for upstream, and runs only
downstream.This PR is a follow up to #3166 to reflect the `BundleUnpacking` condition
removal in the remaining test.

Signed-off-by: Anik Bhattacharjee <[email protected]>
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. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolution error constraints not satisfiable: no operator found from catalog is not cleared after CatalogSource is made available again
3 participants