From caa701b7a3f186e681603dac98a9568c9f779835 Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Tue, 9 Nov 2021 13:40:18 +0100 Subject: [PATCH] e2e_node: Skip dynamic config tests when disabled DKC is being removed and we don't want it to continue flaking the rest of our tests. Lets disable them when dkc is disabled rather than hard failing. This fits more in line with our other E2Es, and reduces the maintenance load in test-infra. --- test/e2e_node/dynamic_kubelet_config_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/e2e_node/dynamic_kubelet_config_test.go b/test/e2e_node/dynamic_kubelet_config_test.go index 02d10060b3d..054822bde56 100644 --- a/test/e2e_node/dynamic_kubelet_config_test.go +++ b/test/e2e_node/dynamic_kubelet_config_test.go @@ -35,6 +35,7 @@ import ( "k8s.io/kubernetes/pkg/kubelet/kubeletconfig/status" "k8s.io/kubernetes/pkg/kubelet/metrics" e2emetrics "k8s.io/kubernetes/test/e2e/framework/metrics" + e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper" "k8s.io/kubernetes/test/e2e/framework" @@ -83,11 +84,13 @@ var _ = SIGDescribe("[Feature:DynamicKubeletConfig][NodeFeature:DynamicKubeletCo // make sure Dynamic Kubelet Configuration feature is enabled on the Kubelet we are about to test enabled, err := isKubeletConfigEnabled(f) framework.ExpectNoError(err) + if !enabled { - framework.ExpectNoError(fmt.Errorf("The Dynamic Kubelet Configuration feature is not enabled.\n" + + e2eskipper.Skipf("The Dynamic Kubelet Configuration feature is not enabled.\n" + "Pass --feature-gates=DynamicKubeletConfig=true to the Kubelet and API server to enable this feature.\n" + - "For `make test-e2e-node`, you can set `TEST_ARGS='--feature-gates=DynamicKubeletConfig=true'`.")) + "For `make test-e2e-node`, you can set `TEST_ARGS='--feature-gates=DynamicKubeletConfig=true'`.") } + // record before state so we can restore it after the test if beforeNode == nil { node, err := f.ClientSet.CoreV1().Nodes().Get(context.TODO(), framework.TestContext.NodeName, metav1.GetOptions{})