Skip to content

Commit

Permalink
test: Redeploy DNS pods in AfterAll for datapath tests
Browse files Browse the repository at this point in the history
Commit a0e7712 ("test: Redeploy DNS after changing endpointRoutes")
didn't go quite far enough: It ensured that between individual tests in
a given file, the DNS pods would be redeployed during the next run if
there were significant enough datapath changes. However, the way it did
this was by storing state within the 'kubectl' variable, which is
recreated in each test file. So if the last test in one CI run enabled
endpoint routes mode, then the DNS pods would not be redeployed to
disable endpoint routes mode as part of the next test.

Fix it by redeploying DNS after removing Cilium from the cluster.
Kubernetes will remove the current DNS pods and reschedule them, but
they will not launch until the next test deploys a new version of
Cilium.

Reported-by: Chris Tarazi <chris@isovalent.com>
Fixes: 0e77127dcd7 ("test: Redeploy DNS after changing endpointRoutes")
Related: #16717

Signed-off-by: Joe Stringer <joe@cilium.io>
  • Loading branch information
joestringer committed Jul 12, 2021
1 parent 099c34d commit e4a887b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/k8sT/CustomCalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ var _ = Describe("K8sCustomCalls", func() {
AfterAll(func() {
deploymentManager.DeleteCilium()
deploymentManager.DeleteAll()
kubectl.RedeployDNS()
})

installPods := func() {
Expand Down
1 change: 1 addition & 0 deletions test/k8sT/DatapathConfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("K8sDatapathConfig", func() {

AfterAll(func() {
deploymentManager.DeleteCilium()
kubectl.RedeployDNS()
kubectl.CloseSSHClient()
})

Expand Down

0 comments on commit e4a887b

Please sign in to comment.