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

fix(upgrade): check for HA apisever pods instead of a single pod #1730

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0
1.12.0
1 change: 1 addition & 0 deletions pkg/apis/openebs.io/v1alpha1/versionDetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var (
"1.0.0": true, "1.1.0": true, "1.2.0": true, "1.3.0": true,
"1.4.0": true, "1.5.0": true, "1.6.0": true, "1.7.0": true,
"1.8.0": true, "1.9.0": true, "1.10.0": true, "1.11.0": true,
"1.12.0": true,
}
validDesiredVersion = version.GetVersion()
)
Expand Down
14 changes: 11 additions & 3 deletions pkg/upgrade/upgrader/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,23 @@ func verifyMayaApiserver(openebsNamespace string) error {
},
)
if err != nil {
return errors.Wrapf(err, "failed to get maya-apiserver deployment")
return errors.Wrapf(err, "failed to list maya-apiserver pod(s)")
}
if len(mayaPods.Items) == 0 {
return errors.Errorf(
"failed to get maya-apiserver deployment in %s",
"failed to get maya-apiserver pod(s) in %s",
openebsNamespace,
)
}
if len(mayaPods.Items) > 1 {
mayaDeploy, err := deployClient.WithNamespace(openebsNamespace).List(
&metav1.ListOptions{
LabelSelector: mayaLabels,
},
)
if err != nil {
return errors.Wrapf(err, "failed to get maya-apiserver deployment")
}
if len(mayaPods.Items) != int(*mayaDeploy.Items[0].Spec.Replicas) {
return errors.Errorf("control plane upgrade is not complete try after some time")
}
if mayaPods.Items[0].Labels["openebs.io/version"] != upgradeVersion {
Expand Down