refactor!: cobra migrate
This commit is contained in:
@ -21,7 +21,11 @@ import (
|
||||
)
|
||||
|
||||
// RunCmdRemote executes an abra.sh command in the target service
|
||||
func RunCmdRemote(cl *dockerClient.Client, app appPkg.App, abraSh, serviceName, cmdName, cmdArgs string) error {
|
||||
func RunCmdRemote(
|
||||
cl *dockerClient.Client,
|
||||
app appPkg.App,
|
||||
requestTTY bool,
|
||||
abraSh, serviceName, cmdName, cmdArgs, remoteUser string) error {
|
||||
filters := filters.NewArgs()
|
||||
filters.Add("name", fmt.Sprintf("^%s_%s", app.StackName(), serviceName))
|
||||
|
||||
@ -74,15 +78,15 @@ func RunCmdRemote(cl *dockerClient.Client, app appPkg.App, abraSh, serviceName,
|
||||
|
||||
log.Debugf("running command: %s", strings.Join(cmd, " "))
|
||||
|
||||
if RemoteUser != "" {
|
||||
log.Debugf("running command with user %s", RemoteUser)
|
||||
execCreateOpts.User = RemoteUser
|
||||
if remoteUser != "" {
|
||||
log.Debugf("running command with user %s", remoteUser)
|
||||
execCreateOpts.User = remoteUser
|
||||
}
|
||||
|
||||
execCreateOpts.Cmd = cmd
|
||||
execCreateOpts.Tty = true
|
||||
if Tty {
|
||||
execCreateOpts.Tty = false
|
||||
execCreateOpts.Tty = requestTTY
|
||||
if !requestTTY {
|
||||
log.Debugf("not requesting a remote TTY")
|
||||
}
|
||||
|
||||
if _, err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts); err != nil {
|
||||
|
Reference in New Issue
Block a user