diff --git a/.github/workflows/check-network.yaml b/.github/workflows/check-network.yaml index 8dd628996abf..ac8c3e75f82f 100644 --- a/.github/workflows/check-network.yaml +++ b/.github/workflows/check-network.yaml @@ -15,7 +15,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: eu-west-1 TF_VERSION: 1.2.2 - K0SCTL_VERSION: 0.13.2 + K0SCTL_VERSION: 0.15.5 KUBECONFIG: ${{ github.workspace }}/kubeconfig name: "K8s Network Conformance Testing" diff --git a/.github/workflows/ostests-e2e.yaml b/.github/workflows/ostests-e2e.yaml index a9d4efb41af1..11cf4d71ce96 100644 --- a/.github/workflows/ostests-e2e.yaml +++ b/.github/workflows/ostests-e2e.yaml @@ -31,7 +31,7 @@ on: k0sctl-version: type: string description: The k0sctl version to use when bootstrapping the test cluster. - default: 0.15.0 # k0sproject/k0sctl#495 + default: 0.15.5 secrets: aws-access-key-id: description: The AWS access key ID to use when provisioning test resources. diff --git a/hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl b/hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl index 07e526709a03..800854bfd3d8 100644 --- a/hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl +++ b/hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl @@ -11,4 +11,5 @@ rc-update add cgroups boot # k0sctl currently doesn't support BusyBox/doas properly. apk add coreutils sudo && apk del doas +apk add bash # Remove after https://github.com/k0sproject/rig/pull/94 echo 'alpine ALL=(ALL:ALL) NOPASSWD: ALL' >/etc/sudoers.d/alpine-all-access diff --git a/inttest/k0sctl/k0sctl_test.go b/inttest/k0sctl/k0sctl_test.go index 43279dbeabbd..2ab243261a27 100644 --- a/inttest/k0sctl/k0sctl_test.go +++ b/inttest/k0sctl/k0sctl_test.go @@ -24,18 +24,20 @@ import ( "net/http" "os" "os/exec" + "path/filepath" "runtime" "strings" "sync" "testing" "github.com/stretchr/testify/suite" + "golang.org/x/exp/slices" "sigs.k8s.io/yaml" "github.com/k0sproject/k0s/inttest/common" ) -const k0sctlVersion = "v0.13.0" +const k0sctlVersion = "v0.15.5" type K0sctlSuite struct { common.FootlooseSuite @@ -121,6 +123,7 @@ func (s *K0sctlSuite) k0sctlInitConfig() map[string]interface{} { if err != nil { s.FailNow("ssh connection failed", "%s", err) } + ssh.Disconnect() args := []string{"init", "--controller-count", fmt.Sprintf("%d", s.ControllerCount), "--key-path", ssh.KeyPath, "--user", ssh.User} args = append(args, addresses...) cmd := exec.Command("./k0sctl", args...) @@ -139,9 +142,10 @@ func (s *K0sctlSuite) k0sctlApply(cfg map[string]interface{}) { plain, err := yaml.Marshal(cfg) s.Require().NoError(err) + cacheHome := s.T().TempDir() s.T().Logf("Applying k0sctl config:\n%s", plain) cmd := exec.Command("./k0sctl", "apply", "--config", "-") - cmd.Env = s.k0sctlEnv + cmd.Env = append(slices.Clone(s.k0sctlEnv), fmt.Sprintf("XDG_CACHE_HOME=%s", cacheHome)) cmd.Stdin = bytes.NewReader(plain) stdout, err := cmd.StdoutPipe() @@ -173,7 +177,12 @@ func (s *K0sctlSuite) k0sctlApply(cfg map[string]interface{}) { err = cmd.Wait() wg.Wait() - s.Require().NoError(err) + log, logErr := os.ReadFile(filepath.Join(cacheHome, "k0sctl", "k0sctl.log")) + if !s.NoError(logErr) { + log = []byte{} + } + + s.Require().NoError(err, string(log)) } func (s *K0sctlSuite) TestK0sGetsUp() {