-
-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(clustertool): add commands debug and allow for extra args
- Loading branch information
1 parent
eb1e744
commit a11f019
Showing
6 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ embeded/darwin* | |
embeded/windows* | ||
embeded/freebsd* | ||
.devcontainer | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |