From 2dccf29f333037f592c7e08e4c9d9788e997f4e1 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 3 Jul 2024 10:54:09 -0400 Subject: [PATCH] Fix for Merged kubelet config does not match the expected configuration in cgroupv1 based jobs Signed-off-by: Davanum Srinivas --- test/e2e_node/kubelet_config_dir_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/kubelet_config_dir_test.go b/test/e2e_node/kubelet_config_dir_test.go index 3f98cf5d6b4..7235fb055a6 100644 --- a/test/e2e_node/kubelet_config_dir_test.go +++ b/test/e2e_node/kubelet_config_dir_test.go @@ -169,7 +169,13 @@ featureGates: }, } // This covers the case where the fields within the map are overridden. - initialConfig.FeatureGates = map[string]bool{"DisableKubeletCloudCredentialProviders": true, "PodAndContainerStatsFromCRI": false, "DynamicResourceAllocation": true} + overrides := map[string]bool{"DisableKubeletCloudCredentialProviders": true, "PodAndContainerStatsFromCRI": false, "DynamicResourceAllocation": true} + // In some CI jobs, `NodeSwap` is explicitly disabled as the images are cgroupv1 based, + // so such flags should be picked up directly from the initial configuration + if _, ok := initialConfig.FeatureGates["NodeSwap"]; ok { + overrides["NodeSwap"] = initialConfig.FeatureGates["NodeSwap"] + } + initialConfig.FeatureGates = overrides // Compare the expected config with the merged config gomega.Expect(initialConfig).To(gomega.BeComparableTo(mergedConfig), "Merged kubelet config does not match the expected configuration.") })