diff --git a/cmd/kubeadm/app/preflight/BUILD b/cmd/kubeadm/app/preflight/BUILD index cf5637cd7bc..93313bcd0e8 100644 --- a/cmd/kubeadm/app/preflight/BUILD +++ b/cmd/kubeadm/app/preflight/BUILD @@ -22,7 +22,6 @@ go_library( "//test/e2e_node/system:go_default_library", "//vendor:github.com/PuerkitoBio/purell", "//vendor:github.com/blang/semver", - "//vendor:k8s.io/apimachinery/pkg/util/errors", ], ) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 8ebd290bfe2..f139863889c 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -38,7 +38,6 @@ import ( "net/url" - utilerrors "k8s.io/apimachinery/pkg/util/errors" kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants" "k8s.io/kubernetes/pkg/api/validation" @@ -343,12 +342,11 @@ func (sysver SystemVerificationCheck) Check() (warnings, errors []error) { } } - err := utilerrors.NewAggregate(errs) - if err != nil { + if len(errs) != 0 { // Only print the output from the system verification check if the check failed fmt.Println("[preflight] The system verification failed. Printing the output from the verification:") bufw.Flush() - return warns, []error{err} + return warns, errs } return warns, nil }