-
Notifications
You must be signed in to change notification settings - Fork 545
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
Bug 1714140: fix(catalog): re-install resources in existing installplan #965
Bug 1714140: fix(catalog): re-install resources in existing installplan #965
Conversation
3ff979e
to
e67d450
Compare
e67d450
to
d899fe5
Compare
/retest |
for _, step := range installPlan.Status.Plan { | ||
step.Status = v1alpha1.StepStatusUnknown | ||
} | ||
_, err = o.client.OperatorsV1alpha1().InstallPlans(namespace).UpdateStatus(installPlan) |
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.
Do we need to update the status if no owners were added?
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.
Yes, the steps need to all be set to not completed status.
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.
@jpeeler could you please explain a little more:
Yes, the steps need to all be set to not completed status.
In the case where an InstallPlan already has all of the provided Subscriptions as owners, why would we set its steps states to unknown? Are we always trying to get InstallPlans to re-apply?
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.
ensureInstallPlan only gets called when there's a subscription change, right? Either way, the reapplication only occurs for an existing install plan with matching manifests. Reapplying an install plan (via setting previously executed steps as unknown) is the only way to get an operator to reinstall unless the way owner references are done currently is changed, specifically with regard to other subscriptions.
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.
ensureInstallPlan only gets called when there's a subscription change, right?
It gets called any time a Subscription is synced, which is on any change and also every 15m (whatever the resync interval is), right?
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.
Ah, that makes sense. Thanks for explaining. I'm only asking because from a user of the ensureInstallPlan
(s) I'd expect only the InstallPlans that have changed to be re-installed, but it may not be a big deal for all of them to attempt a re-install though.
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.
@jpeeler I believe leaving this as you have it solves a separate bug on our backlog too, actually!
This will check/recreate any objects that are in the bundle, so if they get inadvertently deleted this will recreate them.
This specifically fixes the scenario where a subscription is deleted and recreated in a namespace with an additional subscription. When the subscription of interest is deleted, the associated installplan remains due to the other subscription's owner reference. Because the existing installplan manifests match, no additional work is done. This is a problem if resources that were originally installed have been deleted. Now after a subscription is recreated, the proper owner references are re-added onto the install plan as well as all the resources are checked that they are installed.
Using the standard logger allows a unit test to set the desired log level via `log.SetLevel(log.DebugLevel)`.
d899fe5
to
4af534f
Compare
/test e2e-aws-olm |
/retest |
3 similar comments
/retest |
/retest |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, jpeeler 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 |
@jpeeler: This pull request references a valid Bugzilla bug. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 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 kubernetes/test-infra repository. |
@jpeeler: All pull requests linked via external trackers have merged. The Bugzilla bug has been moved to the MODIFIED state. 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 kubernetes/test-infra repository. |
/cherry-pick release-4.1 |
@ecordell: #965 failed to apply on top of branch "release-4.1":
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 kubernetes/test-infra repository. |
This specifically fixes the scenario where a subscription is deleted and recreated in a namespace with an additional subscription. When the subscription of interest is deleted, the associated installplan remains due to the other subscription's owner reference. Because the existing installplan manifests match, no additional work is done. This is a problem if resources that were originally installed have been deleted.
Now after a subscription is recreated, the proper owner references are re-added onto the install plan as well as all the resources are checked that they are installed.
https://bugzilla.redhat.com/show_bug.cgi?id=1714140