From 281f44628f3180cae2f9f787bb9e6d6b834ee2f4 Mon Sep 17 00:00:00 2001 From: SataQiu <1527062125@qq.com> Date: Thu, 14 May 2020 10:07:03 +0800 Subject: [PATCH] kubeadm: log more information when missing the necessary config element Signed-off-by: SataQiu <1527062125@qq.com> --- cmd/kubeadm/app/util/marshal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/util/marshal.go b/cmd/kubeadm/app/util/marshal.go index 8b815c3c5dc..0eaa82efdc1 100644 --- a/cmd/kubeadm/app/util/marshal.go +++ b/cmd/kubeadm/app/util/marshal.go @@ -97,7 +97,7 @@ func SplitYAMLDocuments(yamlBytes []byte) (kubeadmapi.DocumentMap, error) { return nil, err } if len(gvk.Group) == 0 || len(gvk.Version) == 0 || len(gvk.Kind) == 0 { - return nil, errors.New("invalid configuration: kind and apiVersion is mandatory information that needs to be specified") + return nil, errors.Errorf("invalid configuration for GroupVersionKind %+v: kind and apiVersion is mandatory information that must be specified", gvk) } // Check whether the kind has been registered before. If it has, throw an error