From 2a7e85bfdbaae50dfcae37ded51b5a1b8332e160 Mon Sep 17 00:00:00 2001 From: navist2020 Date: Mon, 18 Apr 2022 15:13:45 +0800 Subject: [PATCH] Return preflightError if an error occurs when running the preflight --- cmd/kubeadm/app/preflight/checks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 422167319f7..0a2b6bc3cb5 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -1063,7 +1063,7 @@ func RunRootCheckOnly(ignorePreflightErrors sets.String) error { func RunPullImagesCheck(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String) error { containerRuntime, err := utilruntime.NewContainerRuntime(utilsexec.New(), cfg.NodeRegistration.CRISocket) if err != nil { - return err + return &Error{Msg: err.Error()} } checks := []Checker{