feat(clustertool): move all talhelper references to talassist

This commit is contained in:
Kjeld Schouten
2024-11-06 01:20:29 +01:00
parent 66e079fb1c
commit 16c0e0c387
18 changed files with 137 additions and 267 deletions
+27
View File
@@ -0,0 +1,27 @@
package gencmd
import (
"github.com/truecharts/public/clustertool/embed"
"github.com/truecharts/public/clustertool/pkg/helper"
"github.com/truecharts/public/clustertool/pkg/talassist"
)
func GenPlain(command string, node string, extraFlags []string) []string {
commands := []string{}
//extraFlags = append(extraFlags, "--preserve")
talosPath := embed.GetTalosExec()
if node == "" {
for _, noderef := range talassist.TalConfig.Nodes {
// TODO add extraFlags
cmd := talosPath + " " + command + " --talosconfig " + helper.TalosConfigFile + " -n " + noderef.IPAddress + " "
commands = append(commands, cmd)
}
} else {
cmd := talosPath + " " + command + " --talosconfig " + helper.TalosConfigFile + " -n " + node + " "
commands = append(commands, cmd)
}
return commands
}