fix: -T/--tty disables TTY remote request
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
See #499
This commit is contained in:
parent
83af39771b
commit
1432f480c7
@ -183,7 +183,7 @@ does not).`,
|
|||||||
if err := internal.RunCmdRemote(
|
if err := internal.RunCmdRemote(
|
||||||
cl,
|
cl,
|
||||||
app,
|
app,
|
||||||
requestTTY,
|
disableTTY,
|
||||||
app.Recipe.AbraShPath,
|
app.Recipe.AbraShPath,
|
||||||
targetServiceName, cmdName, parsedCmdArgs, remoteUser); err != nil {
|
targetServiceName, cmdName, parsedCmdArgs, remoteUser); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@ -238,7 +238,7 @@ func parseCmdArgs(args []string, isLocal bool) (bool, string) {
|
|||||||
var (
|
var (
|
||||||
local bool
|
local bool
|
||||||
remoteUser string
|
remoteUser string
|
||||||
requestTTY bool
|
disableTTY bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -259,11 +259,11 @@ func init() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
AppCmdCommand.Flags().BoolVarP(
|
AppCmdCommand.Flags().BoolVarP(
|
||||||
&requestTTY,
|
&disableTTY,
|
||||||
"tty",
|
"tty",
|
||||||
"T",
|
"T",
|
||||||
false,
|
false,
|
||||||
"request remote TTY",
|
"disable remote TTY",
|
||||||
)
|
)
|
||||||
|
|
||||||
AppCmdCommand.Flags().BoolVarP(
|
AppCmdCommand.Flags().BoolVarP(
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
func RunCmdRemote(
|
func RunCmdRemote(
|
||||||
cl *dockerClient.Client,
|
cl *dockerClient.Client,
|
||||||
app appPkg.App,
|
app appPkg.App,
|
||||||
requestTTY bool,
|
disableTTY bool,
|
||||||
abraSh, serviceName, cmdName, cmdArgs, remoteUser string) error {
|
abraSh, serviceName, cmdName, cmdArgs, remoteUser string) error {
|
||||||
filters := filters.NewArgs()
|
filters := filters.NewArgs()
|
||||||
filters.Add("name", fmt.Sprintf("^%s_%s", app.StackName(), serviceName))
|
filters.Add("name", fmt.Sprintf("^%s_%s", app.StackName(), serviceName))
|
||||||
@ -84,8 +84,10 @@ func RunCmdRemote(
|
|||||||
}
|
}
|
||||||
|
|
||||||
execCreateOpts.Cmd = cmd
|
execCreateOpts.Cmd = cmd
|
||||||
execCreateOpts.Tty = requestTTY
|
|
||||||
if !requestTTY {
|
execCreateOpts.Tty = true
|
||||||
|
if disableTTY {
|
||||||
|
execCreateOpts.Tty = false
|
||||||
log.Debugf("not requesting a remote TTY")
|
log.Debugf("not requesting a remote TTY")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user