Skip to content

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

Merged
anik120 merged 1 commit into
operator-framework:masterfrom
anik120:catalog-recreate-clear-resolution-error
Feb 2, 2024
Merged

Clear (existing) error cond from Subscription, once error resolved#3166
anik120 merged 1 commit into
operator-framework:masterfrom
anik120:catalog-recreate-clear-resolution-error

Conversation

@anik120

@anik120 anik120 commented Jan 31, 2024

Copy link
Copy Markdown
Member

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

tmshort commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

/retest

Comment thread pkg/controller/operators/catalog/operator.go Outdated
Comment thread pkg/controller/operators/catalog/operator.go
@tmshort

tmshort commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

/retest

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

tmshort commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

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

@anik120

anik120 commented Feb 1, 2024

Copy link
Copy Markdown
Member Author

/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 <anbhatta@redhat.com>
@anik120
anik120 force-pushed the catalog-recreate-clear-resolution-error branch from f8c215b to 0cb11cb Compare February 1, 2024 19:21
@tmshort

tmshort commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

/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

@m1kola m1kola 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.

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member 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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ship it! :shipit:

@openshift-ci

openshift-ci Bot commented Feb 2, 2024

Copy link
Copy Markdown

[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

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

@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 <anbhatta@redhat.com>
@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 <anbhatta@redhat.com>
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 <anbhatta@redhat.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. 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