-
Notifications
You must be signed in to change notification settings - Fork 551
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
Prevent OLM from creating InstallPlan
s when bundle unpack fails
#2942
Prevent OLM from creating InstallPlan
s when bundle unpack fails
#2942
Conversation
Skipping CI for Draft Pull Request. |
fcbdbc8
to
b91a5ee
Compare
4a773e2
to
c165ece
Compare
ab0ee98
to
61ceac6
Compare
61ceac6
to
a2ec578
Compare
a2ec578
to
3251b11
Compare
@@ -39,7 +39,7 @@ const ( | |||
BundleLookupFailed operatorsv1alpha1.BundleLookupConditionType = "BundleLookupFailed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big PR and I think I can't split it any further into smaller mergable PRs.
it mostly consists of moving code around with minimal changes (e.g. from syncInstallPlans
into syncResolvingNamespace
) and updating unit & e2e test.
I would suggest going commit by commit starting with "Changes how InstallPlans
are being created". And reviewing removed code first will hopefully help to understand what was moved & modified.
Description of the PR provides some context and steps on how to reproduce, so make sure to read it as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual code is not that large; it's the tests...
/lgtm |
Signed-off-by: Mikalai Radchuk <[email protected]>
Changes required to account for a new flow where we prevent `InstallPlan` from being created when unpack job fails Signed-off-by: Mikalai Radchuk <[email protected]>
67b8fc6
to
9ed3d83
Compare
I updated to address feedback. Here is the short summary of the diff since the last push which (diff can be found here). It is arguably easier to comparae modified files to the master still.
No changes to the controller itself. Only tests. I hate large PRs like this, but changes changes in @tmshort @dtfranz @pgodowski @ankitathomas @perdasilva please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - excellent work!! users will be pleased ^^
} | ||
|
||
// Check BundleLookup status conditions to see if the BundleLookupFailed condtion is true | ||
// which means bundle lookup has failed and subscriptions need to be updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// which means bundle lookup has failed and subscriptions need to be updated | |
// which means bundle lookup has failed and subscriptions needs to be updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - excellent work!! users will be pleased ^^
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: m1kola, perdasilva, 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 |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: m1kola, perdasilva, 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 |
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]>
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]>
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]>
…3166) 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](#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 #3162 Signed-off-by: Anik Bhattacharjee <[email protected]>
…3166) 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/operator-lifecycle-manager#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 #3162 Signed-off-by: Anik Bhattacharjee <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 54da66a9996632315827ba37e14823de6405b4d9
…3166) 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/operator-lifecycle-manager#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 #3162 Signed-off-by: Anik Bhattacharjee <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 54da66a9996632315827ba37e14823de6405b4d9
…3166) 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/operator-lifecycle-manager#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 #3162 Signed-off-by: Anik Bhattacharjee <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 54da66a9996632315827ba37e14823de6405b4d9
…3166) 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/operator-lifecycle-manager#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 #3162 Signed-off-by: Anik Bhattacharjee <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 54da66a9996632315827ba37e14823de6405b4d9
…3166) 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/operator-lifecycle-manager#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 #3162 Signed-off-by: Anik Bhattacharjee <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 54da66a9996632315827ba37e14823de6405b4d9
Prerequisites:
Description of the change:
This PR changes how
InstallPlan
s are being created.Motivation for the change:
Today OLM creates InstallPlans even if bundle images are not available for some reason. For example, catalog source contains references to an unreachable registry.
Consider this scenario:
InstallPlan
for an upgrade which features unreachable bundle imagesWorkaround: to resolve this issue users have to manually remove a failed
InstallPlan
. After that OLM is expected to create a newInstallPlan
based on the latest state of catalog sources.The goal: We would like to find a solution which prevents
InstallPlan
from being created with unreachable images in the first place. This eliminates the need to manually deleteInstallPlan
in scenarios like the one described above.Architectural changes:
Before the change:
Namespace
reconciliation (syncResolvingNamespace
) OLM creates anInstallPlan
if required (e.g. new sub is created or a new update in a catalog is available for an existing sub)InstallPlan
reconciliation (syncInstallPlans
) OLM creates aJob
to unpack a relevant bundle.InstallPlan
conditionsAfter this change:
Namespace
reconciliation (syncResolvingNamespace
):Job
to unpack a relevant bundle and waits for the job to sucessfully completeSubscription
conditions (set on all subs in the namespace)InstallPlan
Testing remarks:
To reproduce:
make run-local
from this repo can be helpful)In master - you will see two
InstallPlan
s: one forquay-operator.v3.8.3
(successfull install) and one forquay-operator.v3.8.4
which will eventually (10min by default) report failure to unpack in bundle lookup conditions.In this branch you will see only one
InstallPlan
forquay-operator.v3.8.3
(successfull install). EventuallySubscription
will get a condition reporting failure to unpack (SubscriptionBundleUnpackFailed
). During unpacking it should reportUnpackingInProgress
.Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue