Merge pull request #129401 from pacoxu/kubeadm-upgrade-precheck

kubeadm: add kernel version check for upgrade
This commit is contained in:
Kubernetes Prow Robot 2025-01-02 03:50:13 +01:00 committed by GitHub
commit 3c229949f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -72,6 +72,9 @@ func runPreflight(c workflow.RunData) error {
if err := preflight.RunRootCheckOnly(ignorePreflightErrors); err != nil {
return err
}
if err := preflight.RunUpgradeChecks(ignorePreflightErrors); err != nil {
return err
}
// Run CoreDNS migration check.
if err := upgrade.RunCoreDNSMigrationCheck(client, ignorePreflightErrors); err != nil {

View File

@ -54,6 +54,9 @@ func runPreflight(c workflow.RunData) error {
if err := preflight.RunRootCheckOnly(data.IgnorePreflightErrors()); err != nil {
return err
}
if err := preflight.RunUpgradeChecks(data.IgnorePreflightErrors()); err != nil {
return err
}
// If this is a control-plane node, pull the basic images.
if data.IsControlPlaneNode() {

View File

@ -1091,6 +1091,15 @@ func RunRootCheckOnly(ignorePreflightErrors sets.Set[string]) error {
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
}
// RunUpgradeChecks initializes checks slice of structs and call RunChecks
func RunUpgradeChecks(ignorePreflightErrors sets.Set[string]) error {
checks := []Checker{
SystemVerificationCheck{},
}
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
}
// RunPullImagesCheck will pull images kubeadm needs if they are not found on the system
func RunPullImagesCheck(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.Set[string]) error {
containerRuntime := utilruntime.NewContainerRuntime(cfg.NodeRegistration.CRISocket)