From adcc12e4501d471d789aab8e0053d75c74ab5346 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 7 Nov 2024 21:13:08 +0100 Subject: [PATCH] Use --kubelet-root-dir in reset inttest Signed-off-by: Natanael Copa --- inttest/reset/reset_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inttest/reset/reset_test.go b/inttest/reset/reset_test.go index e34fcef8d989..0e9f42f6c884 100644 --- a/inttest/reset/reset_test.go +++ b/inttest/reset/reset_test.go @@ -34,7 +34,7 @@ func (s *suite) TestReset() { if ok := s.Run("k0s gets up", func() { s.Require().NoError(s.InitController(0, "--disable-components=konnectivity-server,metrics-server")) - s.Require().NoError(s.RunWorkers()) + s.Require().NoError(s.RunWorkers("--kubelet-root-dir=/var/lib/kubelet")) kc, err := s.KubeClient(s.ControllerNode(0)) s.Require().NoError(err) @@ -55,18 +55,20 @@ func (s *suite) TestReset() { s.NoError(ssh.Exec(ctx, "test -d /var/lib/k0s", common.SSHStreams{}), "/var/lib/k0s is not a directory") s.NoError(ssh.Exec(ctx, "test -d /run/k0s", common.SSHStreams{}), "/run/k0s is not a directory") + s.NoError(ssh.Exec(ctx, "test -d /var/lib/kubelet", common.SSHStreams{}), "/var/lib/kubelet is not a directory") s.NoError(ssh.Exec(ctx, "pidof containerd-shim-runc-v2 >&2", common.SSHStreams{}), "Expected some running containerd shims") s.NoError(s.StopWorker(workerNode), "Failed to stop k0s") streams, flushStreams := common.TestLogStreams(s.T(), "reset") - err = ssh.Exec(ctx, "k0s reset --debug", streams) + err = ssh.Exec(ctx, "k0s reset --debug --kubelet-root-dir=/var/lib/kubelet", streams) flushStreams() s.NoError(err, "k0s reset didn't exit cleanly") // /var/lib/k0s is a mount point in the Docker container and can't be deleted, so it must be empty s.NoError(ssh.Exec(ctx, `x="$(ls -A /var/lib/k0s)" && echo "$x" >&2 && [ -z "$x" ]`, common.SSHStreams{}), "/var/lib/k0s is not empty") + s.NoError(ssh.Exec(ctx, "! test -e /var/lib/kubelet", common.SSHStreams{}), "/var/lib/kubelet still exists") s.NoError(ssh.Exec(ctx, "! test -e /run/k0s", common.SSHStreams{}), "/run/k0s still exists") s.NoError(ssh.Exec(ctx, "! pidof containerd-shim-runc-v2 >&2", common.SSHStreams{}), "Expected no running containerd shims") })