From 2e545e49c6de3645c8ad0b006bc67b1968d8ad0b Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Mon, 16 Oct 2023 15:16:33 +0200 Subject: [PATCH] Some CoreDNS testing Signed-off-by: Tom Wieczorek --- inttest/ap-ha3x3/ha3x3_test.go | 8 ++++++++ pkg/component/controller/coredns.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/inttest/ap-ha3x3/ha3x3_test.go b/inttest/ap-ha3x3/ha3x3_test.go index 92d9fa152ba6..30926e527aea 100644 --- a/inttest/ap-ha3x3/ha3x3_test.go +++ b/inttest/ap-ha3x3/ha3x3_test.go @@ -101,6 +101,9 @@ func (s *ha3x3Suite) SetupTest() { for idx := 0; idx < s.FootlooseSuite.WorkerCount; idx++ { s.Require().NoError(s.WaitForNodeReady(s.WorkerNode(idx), client)) } + + s.T().Logf("Waiting for CoreDNS ...") + s.Require().NoError(common.WaitForCoreDNSReady(ctx, client), "CoreDNS not ready") } // TestApply applies a well-formed `plan` yaml, and asserts that @@ -184,6 +187,11 @@ spec: iptablesVersionParts = strings.Split(out, " ") iptablesModeAfterUpdate := iptablesVersionParts[len(iptablesVersionParts)-1] s.Equal(iptablesModeBeforeUpdate, iptablesModeAfterUpdate) + + s.T().Logf("Waiting for CoreDNS ...") + kc, err := s.KubeClient(s.ControllerNode(0)) + s.Require().NoError(err) + s.NoError(common.WaitForCoreDNSReady(s.Context(), kc), "CoreDNS not ready") } // TestHA3x3Suite sets up a suite using 3 controllers for quorum, and runs various diff --git a/pkg/component/controller/coredns.go b/pkg/component/controller/coredns.go index c000ae2a24b3..fbf6d38fb319 100644 --- a/pkg/component/controller/coredns.go +++ b/pkg/component/controller/coredns.go @@ -203,7 +203,7 @@ spec: path: /ready port: 8181 scheme: HTTP - initialDelaySeconds: 0 + initialDelaySeconds: 30 # give loop plugin time to detect loops periodSeconds: 2 timeoutSeconds: 1 successThreshold: 1