mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #32779 from wojtek-t/fix_gce_node_upgrade
Automatic merge from submit-queue Fix node upgrade in e2e tests This is fixing automatic ugprade tests in GCE @davidopp @pwittrock
This commit is contained in:
commit
0877816ec8
@ -89,30 +89,9 @@ var NodeUpgrade = func(f *Framework, v string, img string) error {
|
||||
}
|
||||
|
||||
func nodeUpgradeGCE(rawV string) error {
|
||||
// TODO(ihmccreery) This code path should be identical to how a user
|
||||
// would trigger a node update; right now it's very different.
|
||||
v := "v" + rawV
|
||||
|
||||
Logf("Getting the node template before the upgrade")
|
||||
tmplBefore, err := MigTemplate()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error getting the node template before the upgrade: %v", err)
|
||||
}
|
||||
|
||||
Logf("Preparing node upgrade by creating new instance template for %q", v)
|
||||
stdout, _, err := RunCmd(path.Join(TestContext.RepoRoot, "cluster/gce/upgrade.sh"), "-P", v)
|
||||
if err != nil {
|
||||
cleanupNodeUpgradeGCE(tmplBefore)
|
||||
return fmt.Errorf("error preparing node upgrade: %v", err)
|
||||
}
|
||||
tmpl := strings.TrimSpace(stdout)
|
||||
|
||||
Logf("Performing a node upgrade to %q; waiting at most %v per node", tmpl, RestartPerNodeTimeout)
|
||||
if err := MigRollingUpdate(tmpl, RestartPerNodeTimeout); err != nil {
|
||||
cleanupNodeUpgradeGCE(tmplBefore)
|
||||
return fmt.Errorf("error doing node upgrade via a MigRollingUpdate to %s: %v", tmpl, err)
|
||||
}
|
||||
return nil
|
||||
_, _, err := RunCmd(path.Join(TestContext.RepoRoot, "cluster/gce/upgrade.sh"), "-N", v)
|
||||
return err
|
||||
}
|
||||
|
||||
// MigRollingUpdate starts a MIG rolling update, upgrading the nodes to a new
|
||||
|
Loading…
Reference in New Issue
Block a user