fix(clustertool): add commands debug and allow for extra args
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
package gencmd
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
"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 {
|
||||
func GenPlain(command string, node string, extraArgs []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 + " "
|
||||
cmd := talosPath + " " + command + " --talosconfig " + helper.TalosConfigFile + " -n " + noderef.IPAddress + " " + strings.Join(extraArgs, " ")
|
||||
commands = append(commands, cmd)
|
||||
}
|
||||
} else {
|
||||
cmd := talosPath + " " + command + " --talosconfig " + helper.TalosConfigFile + " -n " + node + " "
|
||||
cmd := talosPath + " " + command + " --talosconfig " + helper.TalosConfigFile + " -n " + node + " " + strings.Join(extraArgs, " ")
|
||||
commands = append(commands, cmd)
|
||||
}
|
||||
log.Debug().Msgf("%s Command rendered: %s", command, commands)
|
||||
return commands
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user