mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-08-26 02:49:20 +00:00
It was being set to kairos key but the proper key is p2p Fixes: https://github.com/kairos-io/kairos/issues/1922 Signed-off-by: Itxaka <itxaka@kairos.io>
38 lines
866 B
Go
38 lines
866 B
Go
package provider
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/kairos-io/kairos-sdk/bus"
|
|
|
|
"github.com/mudler/edgevpn/pkg/node"
|
|
"github.com/mudler/go-pluggable"
|
|
)
|
|
|
|
func InteractiveInstall(e *pluggable.Event) pluggable.EventResponse { //nolint:revive
|
|
prompts := []bus.YAMLPrompt{
|
|
{
|
|
YAMLSection: "p2p.network_token",
|
|
Prompt: "Insert a network token, leave empty to autogenerate",
|
|
AskFirst: true,
|
|
AskPrompt: "Do you want to setup a full mesh-support?",
|
|
IfEmpty: node.GenerateNewConnectionData().Base64(),
|
|
},
|
|
{
|
|
YAMLSection: "k3s.enabled",
|
|
Bool: true,
|
|
Prompt: "Do you want to enable k3s?",
|
|
},
|
|
}
|
|
payload, err := json.Marshal(prompts)
|
|
if err != nil {
|
|
return ErrorEvent("Failed marshalling JSON input: %s", err.Error())
|
|
}
|
|
|
|
return pluggable.EventResponse{
|
|
State: "",
|
|
Data: string(payload),
|
|
Error: "",
|
|
}
|
|
}
|