From 7f2d675ad0ad1109173cfa7d4ab8e1152a00ab65 Mon Sep 17 00:00:00 2001 From: "Rostislav M. Georgiev" Date: Tue, 7 Jan 2020 17:55:50 +0200 Subject: [PATCH] kubeadm: Fix a false positive in a warning The warning message ``` [config] WARNING: Ignored YAML document with GroupVersionKind ... ``` is printed for all GVKs that are not part of the kubeadm core types. This is wrong as the component config types are supported and successfully parsed and used despite the fact that the warning is printed for them too. Hence this simple fix first checks if the group of the GVK is a supported component config group and the warning is printed only if it's not. Signed-off-by: Rostislav M. Georgiev --- cmd/kubeadm/app/util/config/initconfiguration.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/util/config/initconfiguration.go b/cmd/kubeadm/app/util/config/initconfiguration.go index efeed3ba29e..f3f23f95fed 100644 --- a/cmd/kubeadm/app/util/config/initconfiguration.go +++ b/cmd/kubeadm/app/util/config/initconfiguration.go @@ -270,7 +270,10 @@ func documentMapToInitConfiguration(gvkmap kubeadmapi.DocumentMap, allowDeprecat continue } - fmt.Printf("[config] WARNING: Ignored YAML document with GroupVersionKind %v\n", gvk) + // If the group is neither a kubeadm core type or of a supported component config group, we dump a warning about it being ignored + if !componentconfigs.Scheme.IsGroupRegistered(gvk.Group) { + fmt.Printf("[config] WARNING: Ignored YAML document with GroupVersionKind %v\n", gvk) + } } // Enforce that InitConfiguration and/or ClusterConfiguration has to exist among the YAML documents