-
Notifications
You must be signed in to change notification settings - Fork 15
fix: Fix reconciliation error preventing existing Backstage operands from being upgraded when the operator is upgraded from 1.1.x
[RHIDP-2597]
#384
fix: Fix reconciliation error preventing existing Backstage operands from being upgraded when the operator is upgraded from 1.1.x
[RHIDP-2597]
#384
Conversation
This is because this test requires uninstalling the installed operator, in order to install a previous version, then try out the upgrade
…on fails This way, it will be recreated at the next reconciliation. This should prevent similar issues from happening again in the future. The DB Service could not be patched to set its clusterIP field to None (to make it headless), when we were upgrading from 1.1 (where it was not headless) to 1.2. In fact, regarding K8s Services, users can upgrade (add another clusterIP or ipFamily), downgrade (remove secondary clusterIP or ipFamily), but *CAN NOT* change primary/secondary clusterIP || ipFamily *UNLESS* they are changing from/to/ON ExternalName
/cherry-pick 1.2.x |
@rm3l: once the present PR merges, I will cherry-pick it on top of 1.2.x in a new PR and assign it to you. 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-sigs/prow repository. |
1.1.x
1.1.x
1.1.x
1.1.x
[RHIDP-2597]
…patching did not succeed Co-authored-by: Gennady Azarenkov <[email protected]>
…ed) if patching did not succeed
Co-authored-by: Gennady Azarenkov <[email protected]>
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.
And please add some note that annotations and labels will be lost to the log
/cherry-pick 1.2.x |
@nickboldt: once the present PR merges, I will cherry-pick it on top of 1.2.x in a new PR and assign it to you. 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-sigs/prow repository. |
…ost when the object is deleted Co-authored-by: Gennady Azarenkov <[email protected]>
Quality Gate passedIssues Measures |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gazarenkov 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 |
@rm3l: new pull request created: #385 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-sigs/prow repository. |
Description
This PR fixes a reconciliation error occurring against existing CRs after upgrading the operator from the released
1.1.x
branch to eithermain
or1.2.x
.This issue is currently due to a PATCH operation that was denied by Kubernetes against the existing database Service object.
#369 (fix for https://issues.redhat.com/browse/RHIDP-2432) introduced a mechanism to "replace"
StatefulSet
objects when the PATCH operation fails, by deleting it (without deleting its dependents), so that the next reconciliation will recreate it.To prevent similar issues (patching fields that are not allowed by K8s) from occurring again in the future, this PR generalizes this logic
based on the patch error status and cause (either Field Update Forbidden or Field Value Invalid), i.e., it tries to delete the object anyway if patching it failed, so that it can be recreated upon the next reconciliation.Which issue(s) does this PR fix or relate to
PR acceptance criteria
rhdh-operator.csv.yaml
file accordinglyHow to test changes / Special notes to the reviewer
Repro steps provided in #382.
make test-e2e-upgrade
. It will leverage the default operator image (not patched) and will not pass.make test-e2e-upgrade IMG=quay.io/janus-idp/operator:0.3.0-pr-384
to see the E2E tests passing using the operator image from this PR.