diff --git a/inttest/k0sctl/k0sctl_test.go b/inttest/k0sctl/k0sctl_test.go index 442b918147ad..a6808b6efe4f 100644 --- a/inttest/k0sctl/k0sctl_test.go +++ b/inttest/k0sctl/k0sctl_test.go @@ -135,6 +135,7 @@ func (s *K0sctlSuite) k0sctlInitConfig() (*dig.Mapping, error) { args := []string{"init", "--controller-count", fmt.Sprintf("%d", s.ControllerCount)} args = append(args, addresses...) out, err := exec.Command("./k0sctl", args...).Output() + s.T().Logf("k0sctl init output:\n%s", string(out)) cfg := &dig.Mapping{} err = yaml.Unmarshal(out, cfg) @@ -146,15 +147,21 @@ func (s *K0sctlSuite) TestK0sGetsUp() { s.NoError(s.DownloadK0sctl()) cfg, err := s.k0sctlInitConfig() - hosts, ok := cfg.Dig("spec", "hosts").([]*dig.Mapping) + spec := cfg.DigMapping("spec") + hosts, ok := spec["hosts"].([]interface{}) if !ok { s.T().Logf("k0sctl config inspection:\n%+v", cfg) s.Fail("could not find spec.hosts in generated k0sctl.yaml") } for _, h := range hosts { - (*h)["uploadBinary"] = true - (*h)["k0sBinaryPath"] = os.Getenv("K0S_PATH") + host, ok := h.(map[string]interface{}) + if !ok { + s.Failf("k0sctl config", "is not what was expected: %+v", host) + } + + host["uploadBinary"] = true + host["k0sBinaryPath"] = os.Getenv("K0S_PATH") } s.NoError(err)