kubeadm: log more information when missing the necessary config element

Signed-off-by: SataQiu <1527062125@qq.com>
This commit is contained in:
SataQiu 2020-05-14 10:07:03 +08:00
parent 61f00365d4
commit 281f44628f

View File

@ -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