Skip to content

Commit

Permalink
Bump k0sctl to v0.15.5
Browse files Browse the repository at this point in the history
This addresses a probably SELinux related provisioning problem noticed
on Fedora CoreOS 38.20230826.20.0.

Not touching the release workflow, as that one is hard to test and I
don't want to introduce a regression.

Also add bash to the Alpine VMs in the OS tests to satisfy k0sctl's/
rig's new hard dependency on bash.

Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed Aug 31, 2023
1 parent ba7cbf9 commit bf13dcf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ostests-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions hack/ostests/modules/os/os_alpine_3_17_userdata.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 12 additions & 3 deletions inttest/k0sctl/k0sctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...)
Expand All @@ -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()
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit bf13dcf

Please sign in to comment.