Skip to content

Commit 66d62d2

Browse files
authored
Adapt interactive installer to k8s distro (#713)
fixes kairos-io/kairos#3125 Signed-off-by: Mauro Morales <[email protected]>
1 parent 09088b9 commit 66d62d2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

internal/provider/interactive-install.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55

66
"github.com/kairos-io/kairos-sdk/bus"
7+
"github.com/kairos-io/kairos-sdk/utils"
78

89
"github.com/mudler/edgevpn/pkg/node"
910
"github.com/mudler/go-pluggable"
@@ -18,12 +19,23 @@ func InteractiveInstall(e *pluggable.Event) pluggable.EventResponse { //nolint:r
1819
AskPrompt: "Do you want to setup a full mesh-support?",
1920
IfEmpty: node.GenerateNewConnectionData().Base64(),
2021
},
21-
{
22+
}
23+
24+
// Check which Kubernetes binary is installed
25+
if utils.K3sBin() != "" {
26+
prompts = append(prompts, bus.YAMLPrompt{
2227
YAMLSection: "k3s.enabled",
2328
Bool: true,
2429
Prompt: "Do you want to enable k3s?",
25-
},
30+
})
31+
} else if utils.K0sBin() != "" {
32+
prompts = append(prompts, bus.YAMLPrompt{
33+
YAMLSection: "k0s.enabled",
34+
Bool: true,
35+
Prompt: "Do you want to enable k0s?",
36+
})
2637
}
38+
2739
payload, err := json.Marshal(prompts)
2840
if err != nil {
2941
return ErrorEvent("Failed marshalling JSON input: %s", err.Error())

0 commit comments

Comments
 (0)