@@ -901,7 +901,7 @@ func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigura
901
901
}
902
902
903
903
if ! isSecondaryControlPlane {
904
- checks = addCommonChecks (execer , cfg , checks )
904
+ checks = addCommonChecks (execer , cfg . KubernetesVersion , & cfg . NodeRegistration , checks )
905
905
906
906
// Check IVPS required kernel module once we use IVPS kube-proxy mode
907
907
if cfg .ComponentConfigs .KubeProxy != nil && cfg .ComponentConfigs .KubeProxy .Mode == ipvsutil .IPVSProxyMode {
@@ -959,7 +959,7 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfigura
959
959
FileAvailableCheck {Path : filepath .Join (kubeadmconstants .KubernetesDir , kubeadmconstants .KubeletKubeConfigFileName )},
960
960
FileAvailableCheck {Path : filepath .Join (kubeadmconstants .KubernetesDir , kubeadmconstants .KubeletBootstrapKubeConfigFileName )},
961
961
}
962
- checks = addCommonChecks (execer , cfg , checks )
962
+ checks = addCommonChecks (execer , "" , & cfg . NodeRegistration , checks )
963
963
if cfg .ControlPlane == nil {
964
964
checks = append (checks , FileAvailableCheck {Path : cfg .CACertPath })
965
965
}
@@ -1006,8 +1006,8 @@ func RunOptionalJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.Clust
1006
1006
1007
1007
// addCommonChecks is a helper function to deplicate checks that are common between both the
1008
1008
// kubeadm init and join commands
1009
- func addCommonChecks (execer utilsexec.Interface , cfg kubeadmapi.CommonConfiguration , checks []Checker ) []Checker {
1010
- containerRuntime , err := utilruntime .NewContainerRuntime (execer , cfg . GetCRISocket () )
1009
+ func addCommonChecks (execer utilsexec.Interface , k8sVersion string , nodeReg * kubeadmapi.NodeRegistrationOptions , checks []Checker ) []Checker {
1010
+ containerRuntime , err := utilruntime .NewContainerRuntime (execer , nodeReg . CRISocket )
1011
1011
isDocker := false
1012
1012
if err != nil {
1013
1013
fmt .Printf ("[preflight] WARNING: Couldn't create the interface used for talking to the container runtime: %v\n " , err )
@@ -1044,8 +1044,8 @@ func addCommonChecks(execer utilsexec.Interface, cfg kubeadmapi.CommonConfigurat
1044
1044
}
1045
1045
checks = append (checks ,
1046
1046
SystemVerificationCheck {IsDocker : isDocker },
1047
- HostnameCheck {nodeName : cfg . GetNodeName () },
1048
- KubeletVersionCheck {KubernetesVersion : cfg . GetKubernetesVersion () , exec : execer },
1047
+ HostnameCheck {nodeName : nodeReg . Name },
1048
+ KubeletVersionCheck {KubernetesVersion : k8sVersion , exec : execer },
1049
1049
ServiceCheck {Service : "kubelet" , CheckIfActive : false },
1050
1050
PortOpenCheck {port : ports .KubeletPort })
1051
1051
return checks
@@ -1062,7 +1062,7 @@ func RunRootCheckOnly(ignorePreflightErrors sets.String) error {
1062
1062
1063
1063
// RunPullImagesCheck will pull images kubeadm needs if they are not found on the system
1064
1064
func RunPullImagesCheck (execer utilsexec.Interface , cfg * kubeadmapi.InitConfiguration , ignorePreflightErrors sets.String ) error {
1065
- containerRuntime , err := utilruntime .NewContainerRuntime (utilsexec .New (), cfg .GetCRISocket () )
1065
+ containerRuntime , err := utilruntime .NewContainerRuntime (utilsexec .New (), cfg .NodeRegistration . CRISocket )
1066
1066
if err != nil {
1067
1067
return err
1068
1068
}
0 commit comments