From 7fa7f6d400f235613797f6ce0ed11d207d0f6767 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 10 Nov 2021 21:56:22 +0200 Subject: [PATCH] kubeadm: fix failure in e2e_kubeadm related to kubelet-config The featureGates field in ClusterConfiguration ends up as a map[interface{}]interface{} in the test suite and cannot be casted to map[string]bool directly. Adapt the test to use map[interface{}]interface{}. --- test/e2e_kubeadm/kubelet_config_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e_kubeadm/kubelet_config_test.go b/test/e2e_kubeadm/kubelet_config_test.go index 4fb94ccac8f..c699a549c83 100644 --- a/test/e2e_kubeadm/kubelet_config_test.go +++ b/test/e2e_kubeadm/kubelet_config_test.go @@ -84,11 +84,15 @@ var _ = Describe("kubelet-config ConfigMap", func() { // https://github.com/kubernetes/kubeadm/issues/1582 var UnversionedKubeletConfigMap bool if _, ok := m["featureGates"]; ok { - if featureGates, ok := m["featureGates"].(map[string]bool); ok { + if featureGates, ok := m["featureGates"].(map[interface{}]interface{}); ok { // TODO: update the default to true once this graduates to Beta. UnversionedKubeletConfigMap = false if val, ok := featureGates["UnversionedKubeletConfigMap"]; ok { - UnversionedKubeletConfigMap = val + if valBool, ok := val.(bool); ok { + UnversionedKubeletConfigMap = valBool + } else { + framework.Failf("unable to cast the value of feature gate UnversionedKubeletConfigMap to bool") + } } } else { framework.Failf("unable to cast the featureGates field in the %s ConfigMap", kubeadmConfigName)