Move syncuser pass from shell to exec

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-09-14 22:38:55 -06:00
parent 0b3eace403
commit 96119484d8
2 changed files with 1 additions and 9 deletions

View File

@@ -124,10 +124,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
}
// getting syncuser from cmd, e.g., shell comamnd will call exec command and passing --syncuser
if syncUserFlag, err := cmd.Flags().GetBool("syncuser"); err == nil {
SyncUser = SyncUser || syncUserFlag
}
userdbChanged := false
if !beforePasswdTime.IsZero() {
afterPasswdTime := getTime(path.Join(containerPath, "/etc/passwd"))

View File

@@ -22,11 +22,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
wwlog.Error("Unknown Warewulf container: %s", containerName)
os.Exit(1)
}
/*
for _, b := range binds {
allargs = append(allargs, "--bind", b)
}
*/
shellName := os.Getenv("SHELL")
if !container.ValidSource(containerName) {
wwlog.Error("Unknown Warewulf container: %s", containerName)
@@ -49,5 +44,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
wwlog.Debug("Calling exec with args: %s", allargs)
cntexec.SetBinds(binds)
cntexec.SetNode(nodeName)
cntexec.SyncUser = syncUser
return cntexec.CobraRunE(cmd, allargs)
}