Skip to content
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

Stop provider upgrade if clients version is lagging #2311

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

leelavg
Copy link
Contributor

@leelavg leelavg commented Dec 7, 2023

Provider supports client operator at X.Y and X.(Y-1) versions and if any client is already at X.(Y-1) version and provider gets upgraded then the lagging client goes out of support

This PR prohibits such provider upgrades

Minor: use a single existing enqueue function and removes duplicates

[RHSTOR-5073]

@leelavg
Copy link
Contributor Author

leelavg commented Dec 7, 2023

/hold

  1. More testing and fixing existing tests in under progress
  2. Will unhold when more than one vote is provided
  3. Testing done so far is as below

=== Provider Operator is at 4.15
# ko get csv -ojsonpath='{range .items[*]}[{.metadata.name}, {.spec.version}]{end}'
[ocs-operator.v4.15.0-79.stable, 4.15.0-79.stable]

=== All connected clients are also at 4.15
# ko get storageconsumer -ojsonpath='{range .items[*]}[{.metadata.name}, {.status.client.operatorVersion}]{"\n"}{end}'
[cons-1, 4.15.1]
[cons-2, 4.15.2]
[cons-3, 4.15.3]

=== Provider can upgrade w/o any issue
# ko get condition -ojsonpath='{range .items[*]}[{.metadata.name}, {.spec.conditions}]{end}' 
[ocs-operator.v4.15.0-79.stable, [{"lastTransitionTime":"2023-12-07T13:57:06Z","message":"Reconcile completed successfully","reason":"ReconcileCompleted","status":"True","type":"Upgradeable"}]]

==== Assume one of the client operator is lagging provider operator by 1 minor version
# ko patch --subresource=status storageconsumers cons-3 --type json -p '[{"op": "replace", "path": "/status/client/operatorVersion", "value": "4.14.3"}]'
storageconsumer.ocs.openshift.io/cons-3 patched

# ko get storageconsumer -ojsonpath='{range .items[*]}[{.metadata.name}, {.status.client.operatorVersion}]{"\n"}{end}'
[cons-1, 4.15.1]
[cons-2, 4.15.2]
[cons-3, 4.14.3]

==== The scenario is surfaced to the Operator Condition and upgrade is prohibited
# ko get condition -ojsonpath='{range .items[*]}[{.metadata.name}, {.spec.conditions}]{end}' 
[ocs-operator.v4.15.0-79.stable, [{"lastTransitionTime":"2023-12-07T13:58:10Z","message":"StorageConsumer \"cons-3\" will become unsupported if upgraded","reason":"ConsumerClientOperatorVersion","status":"False","type":"Upgradeable"}]]

# ko get storagecluster
NAME                 AGE   PHASE   EXTERNAL   CREATED AT             VERSION
ocs-storagecluster   30h   Ready              2023-12-06T07:20:31Z   4.15.0

==== Reset client operator version
# ko patch --subresource=status storageconsumers cons-3 --type json -p '[{"op": "replace", "path": "/status/client/operatorVersion", "value": "4.15.3"}]'
storageconsumer.ocs.openshift.io/cons-3 patched

# ko get storageconsumer -ojsonpath='{range .items[*]}[{.metadata.name}, {.status.client.operatorVersion}]{"\n"}{end}'
[cons-1, 4.15.1]
[cons-2, 4.15.2]
[cons-3, 4.15.3]

==== If the connected client operator is upto w/ provider operator upgrade will be unblocked
# ko get condition -ojsonpath='{range .items[*]}[{.metadata.name}, {.spec.conditions}]{end}' 
[ocs-operator.v4.15.0-79.stable, [{"lastTransitionTime":"2023-12-07T13:59:11Z","message":"Reconcile completed successfully","reason":"ReconcileCompleted","status":"True","type":"Upgradeable"}]]

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 7, 2023
@leelavg leelavg requested a review from rewantsoni December 11, 2023 11:26
leelavg added a commit to leelavg/ocs-operator that referenced this pull request Dec 12, 2023
- This alert is initially raised if client operator is outside of
support matrix b/n ODF Provider and ODF Client
- With red-hat-storage#2308 and red-hat-storage#2311 we are enforcing the onboard and upgrade
- So, this alert can be removed now

Signed-off-by: Leela Venkaiah G <[email protected]>
@leelavg
Copy link
Contributor Author

leelavg commented Dec 12, 2023

depends on #2308 partially

controllers/storagecluster/reconcile.go Outdated Show resolved Hide resolved
controllers/storagecluster/reconcile.go Outdated Show resolved Hide resolved
controllers/storagecluster/reconcile.go Outdated Show resolved Hide resolved
controllers/storagecluster/reconcile.go Outdated Show resolved Hide resolved
controllers/storagecluster/reconcile.go Outdated Show resolved Hide resolved
controllers/storagecluster/storagecluster_controller.go Outdated Show resolved Hide resolved
controllers/storagecluster/storagecluster_controller.go Outdated Show resolved Hide resolved
@leelavg leelavg requested a review from nb-ohad December 13, 2023 12:02
@leelavg leelavg force-pushed the 5073-upgrade branch 2 times, most recently from 3707ed8 to b171b51 Compare December 14, 2023 07:52
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 14, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 15, 2023
@leelavg
Copy link
Contributor Author

leelavg commented Dec 15, 2023

rebased

@leelavg leelavg force-pushed the 5073-upgrade branch 2 times, most recently from d40d887 to fbf7a2e Compare December 20, 2023 08:22
@leelavg leelavg changed the title [RHSTOR-5073] Stop provider upgrade if client becomes unsupported Stop provider upgrade if clients version is lagging Dec 20, 2023
@leelavg
Copy link
Contributor Author

leelavg commented Dec 20, 2023

address comments and retested.

@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 Dec 20, 2023
@leelavg
Copy link
Contributor Author

leelavg commented Dec 20, 2023

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 20, 2023
@nb-ohad
Copy link
Contributor

nb-ohad commented Dec 20, 2023

/lgtm

- Provider supports client operator at X.Y and X.(Y-1) versions
- If any client is already at X.(Y-1) version and provider gets upgraded
then the lagging client goes out of support
- This PR prohibits such provider upgrades

[RHSTOR-5073]

Signed-off-by: Leela Venkaiah G <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2023
@leelavg
Copy link
Contributor Author

leelavg commented Dec 20, 2023

rebased.

@nb-ohad
Copy link
Contributor

nb-ohad commented Dec 20, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2023
Copy link
Contributor

openshift-ci bot commented Dec 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leelavg, nb-ohad

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

@openshift-merge-bot openshift-merge-bot bot merged commit 6a6f49f into red-hat-storage:main Dec 20, 2023
14 checks passed
@leelavg
Copy link
Contributor Author

leelavg commented Jan 4, 2024

/cherrypick release-4.15

@openshift-cherrypick-robot

@leelavg: new pull request created: #2368

In response to this:

/cherrypick release-4.15

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.

@leelavg leelavg deleted the 5073-upgrade branch December 11, 2024 11:55
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants