Skip to content

Commit

Permalink
cmd/create: Cleanup entry-point command assembly
Browse files Browse the repository at this point in the history
Too many appends. Instead, put the required sequence into a single array
and append only the variable parts.

Instead of calling "init-container" with "--verbose", call it rather
with "--log-level debug".
  • Loading branch information
HarryMichal committed Mar 21, 2021
1 parent 3aaa1d3 commit cb56f67
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,23 +388,20 @@ func createContainer(container, image, release string, showCommandToEnter bool)
}

entryPoint := []string{
"toolbox", "--verbose",
"toolbox", "--log-level", "debug",
"init-container",
"--gid", currentUser.Gid,
"--home", currentUser.HomeDir,
"--shell", userShell,
"--uid", currentUser.Uid,
"--user", currentUser.Username,
"--monitor-host",
}

entryPoint = append(entryPoint, slashHomeLink...)
entryPoint = append(entryPoint, mediaLink...)
entryPoint = append(entryPoint, mntLink...)

entryPoint = append(entryPoint, []string{
"--monitor-host",
"--shell", userShell,
"--uid", currentUser.Uid,
"--user", currentUser.Username,
}...)

createArgs := []string{
"--log-level", logLevelString,
"create",
Expand Down

0 comments on commit cb56f67

Please sign in to comment.