Skip to content

Commit

Permalink
fix(clustertool): correct machineconfig apply command
Browse files Browse the repository at this point in the history
  • Loading branch information
PrivatePuffin committed Nov 7, 2024
1 parent 7c3ecc5 commit c70e1b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions clustertool/cmd/adv_testcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package cmd
import (
"strings"

"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/gencmd"
"github.com/truecharts/public/clustertool/pkg/initfiles"
"github.com/truecharts/public/clustertool/pkg/talassist"
)
Expand All @@ -25,8 +23,7 @@ var testcmd = &cobra.Command{
// if err != nil {
// log.Info().Msg("Error:", err)
// }
cmds := gencmd.GenApply("", []string{})
log.Info().Msgf("%s", cmds[0])
RunApply(false, "", []string{})
},
}

Expand Down
4 changes: 2 additions & 2 deletions clustertool/pkg/gencmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func GenApply(node string, extraArgs []string) []string {

for _, noderef := range talassist.TalConfig.Nodes {
filename := talassist.TalConfig.ClusterName + "-" + noderef.Hostname + ".yaml"
cmd := talosPath + " " + "apply-config" + " --talosconfig " + helper.TalosConfigFile + " -n " + noderef.IPAddress + " -f " + filepath.Join(helper.TalosGenerated, filename) // + " " + strings.Join(extraArgs, " ")
cmd := talosPath + " " + "apply machineconfig" + " -f " + filepath.Join(helper.TalosGenerated, filename) + " --talosconfig " + helper.TalosConfigFile + " -n " + noderef.IPAddress // + " " + strings.Join(extraArgs, " ")
commands = append(commands, cmd)
}
} else {
Expand All @@ -35,7 +35,7 @@ func GenApply(node string, extraArgs []string) []string {
}

filename := talassist.TalConfig.ClusterName + "-" + nodename + ".yaml"
cmd := talosPath + " " + "apply-config" + " --talosconfig " + helper.TalosConfigFile + " -n " + node + " -f " + filepath.Join(helper.TalosGenerated, filename) // + " " + strings.Join(extraArgs, " ")
cmd := talosPath + " " + "apply machineconfig" + " -f " + filepath.Join(helper.TalosGenerated, filename) + " --talosconfig " + helper.TalosConfigFile + " -n " + node // + " " + strings.Join(extraArgs, " ")
commands = append(commands, cmd)
}
log.Debug().Msgf("Apply Commands rendered: %s", commands)
Expand Down
2 changes: 1 addition & 1 deletion clustertool/pkg/gencmd/execcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func ExecCmd(cmd string) {
argslice := strings.Split(cmd, " ")
// log.Info().Msgf("Running: %s\n", argslice[0:])
log.Trace().Msgf("command", argslice[:])

// log.Info().Msg("test", strings.Join(argslice, " "))
out, err := helper.RunCommand(argslice, false)
Expand Down

0 comments on commit c70e1b4

Please sign in to comment.