mirror of
https://github.com/truecharts/charts.git
synced 2026-07-06 22:15:11 -03:00
39 lines
1.0 KiB
Go
39 lines
1.0 KiB
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/gencmd"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/helper"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/initfiles"
|
|
"github.com/trueforge-org/truecharts/clustertool/pkg/talassist"
|
|
)
|
|
|
|
var advBootstrapLongHelp = strings.TrimSpace(`
|
|
|
|
`)
|
|
|
|
var bootstrap = &cobra.Command{
|
|
Use: "bootstrap",
|
|
Short: "bootstrap first Talos Node",
|
|
Example: "clustertool talos bootstrap",
|
|
Long: advBootstrapLongHelp,
|
|
Run: bootstrapfunc,
|
|
}
|
|
|
|
func bootstrapfunc(cmd *cobra.Command, args []string) {
|
|
if helper.GetYesOrNo("Do you want to also run the complete ClusterTool Bootstrap, besides just talos? (yes/no) [y/n]: ") {
|
|
initfiles.LoadTalEnv(false)
|
|
talassist.LoadTalConfig()
|
|
gencmd.RunBootstrap(args)
|
|
} else {
|
|
bootstrapcmds := gencmd.GenPlain("bootstrap", talassist.TalConfig.Nodes[0].IPAddress, []string{})
|
|
gencmd.ExecCmd(bootstrapcmds[0])
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
talosCmd.AddCommand(bootstrap)
|
|
}
|