You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If not already done, call the BeforeClusterUpgrade hook before picking up the desired version.
636
599
iffeature.Gates.Enabled(feature.RuntimeSDK) {
637
-
// NOTE: the hook should be called only at the beginning of either a regular upgrade or a multistep upgrade sequence (it should not be called when in the middle of a multistep upgrade sequence);
638
-
// to detect if we are at the beginning of an upgrade, we check if the intent to call the AfterClusterUpgrade is not yet tracked.
// RetryAfterSeconds needs to be set because having only hooks without RetryAfterSeconds
656
-
// would lead to not updating the condition. We can rely on getting an event when the
657
-
// annotation gets removed so we set twice of the default sync-period to not cause additional reconciles.
658
-
RetryAfterSeconds: 20*60,
659
-
CommonResponse: runtimehooksv1.CommonResponse{
660
-
Message: message,
661
-
},
662
-
},
663
-
})
664
-
665
-
log.Info(fmt.Sprintf("Cluster upgrade to version %q is blocked by %q hook (via annotations)", topologyVersion, runtimecatalog.HookName(runtimehooksv1.BeforeClusterUpgrade)), "hooks", strings.Join(hookAnnotations, ","))
666
-
return*currentVersion, nil
667
-
}
668
-
669
-
// At this point the control plane and the machine deployments are stable and we are almost ready to pick
670
-
// up the topologyVersion. Call the BeforeClusterUpgrade hook before picking up the desired version.
671
-
v1beta1Cluster:=&clusterv1beta1.Cluster{}
672
-
// DeepCopy cluster because ConvertFrom has side effects like adding the conversion annotation.
// Cannot pickup the new version right now. Need to try again later.
692
-
log.Info(fmt.Sprintf("Cluster upgrade to version %q is blocked by %q hook", topologyVersion, runtimecatalog.HookName(runtimehooksv1.BeforeClusterUpgrade)))
// toUpgradeStep converts a list of version to a list of upgrade steps.
1665
-
// Note. when called for workers, the function will receive in input two plans one for the MachineDeployments if any, the other for MachinePools if any.
1666
-
// Considering that both plans, if defined, have to be equal, the function picks the first one not empty.
0 commit comments