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

Bug 1885867 : Flip to unicast only when MCO set to desired version in all nodes #103

Merged

Conversation

yboaron
Copy link
Contributor

@yboaron yboaron commented Oct 7, 2020

In 4.5 to 4.6 upgrade we support automatic Keepalived mode flip to unicast,
the change to unicast should start only after MCO finished configuring the 4.6 desired state
in all the nodes.

With this PR the flip mode starts only after all the nodes configured with the new MCO configuration.

In 4.5 to 4.6 upgrade we support automatic Keepalived mode flip to unicast,
the change to unicast should start only after MCO finished configuring the 4.6 desired state
in all the nodes.

With this PR the flip mode starts only after all the nodes configured with the new MCO configuration.
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2020
@yboaron yboaron changed the title Bug 1885867 : Flip to unciast only when MCO set to desired version in all nodes Bug 1885867 : Flip to unicast only when MCO set to desired version in all nodes Oct 7, 2020
@@ -234,7 +234,9 @@ func IsUpgradeStillRunning(kubeconfigPath string) (error, bool) {
}

for _, node := range nodes.Items {
if node.Annotations["machineconfiguration.openshift.io/desiredConfig"] != node.Annotations["machineconfiguration.openshift.io/currentConfig"] {
if node.Annotations["machineconfiguration.openshift.io/desiredConfig"] != node.Annotations["machineconfiguration.openshift.io/currentConfig"] ||
node.Annotations["machineconfiguration.openshift.io/desiredConfig"] != nodes.Items[0].Annotations["machineconfiguration.openshift.io/desiredConfig"] {
Copy link
Member

Choose a reason for hiding this comment

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

So this is essentially checking that the current node matches the first node. Do we know that the first node will always be upgraded first or should we make this check a separate loop where we verify all of the nodes' desiredConfigs match (or I guess we could still use this loop with a bit different logic)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A. No, we don't know that the first node will be first.

B. This code supposes to check that :
* desiredConfig is equal to currentConfig for each node
and

  • all the nodes has the same desiredConfig

So, If desiredConfig != currentConfig for one of the nodes, we'll fail because of the first condition in the if statement.

And the second condition in the if statement verifies that all the nodes has the same desiredConfig.

I used the below logic to verify that all nodes has the same desiredConfig.
Assuming that we have an array of N (0 - N-1) numbers and we need to check if all values of the array are equal.

So, if for each i between 1 to N-1 Arr[i] == Arr[0] that means that all array members are equal (because whenever x = y and y = z, then also x = z )

Let me know if you still think I should change/update something in this statement
.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, right. This does check that they're all equal. Oops. :-)

Copy link
Member

@cybertron cybertron left a comment

Choose a reason for hiding this comment

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

/lgtm

Sorry for the delay getting back to this.

@@ -234,7 +234,9 @@ func IsUpgradeStillRunning(kubeconfigPath string) (error, bool) {
}

for _, node := range nodes.Items {
if node.Annotations["machineconfiguration.openshift.io/desiredConfig"] != node.Annotations["machineconfiguration.openshift.io/currentConfig"] {
if node.Annotations["machineconfiguration.openshift.io/desiredConfig"] != node.Annotations["machineconfiguration.openshift.io/currentConfig"] ||
node.Annotations["machineconfiguration.openshift.io/desiredConfig"] != nodes.Items[0].Annotations["machineconfiguration.openshift.io/desiredConfig"] {
Copy link
Member

Choose a reason for hiding this comment

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

Oh, right. This does check that they're all equal. Oops. :-)

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 20, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cybertron, yboaron

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-robot openshift-merge-robot merged commit 49d42f9 into openshift:master Oct 20, 2020
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.

None yet

4 participants