revert changes
This commit is contained in:
@ -12,7 +12,6 @@ import (
|
||||
"coopcloud.tech/abra/pkg/upstream/container"
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/docker/api/types"
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
dockerClient "github.com/docker/docker/client"
|
||||
)
|
||||
@ -48,7 +47,7 @@ func RunBackupCmdRemote(
|
||||
backupCmd string,
|
||||
containerID string,
|
||||
execEnv []string) (io.Writer, error) {
|
||||
execBackupListOpts := containertypes.ExecOptions{
|
||||
execBackupListOpts := types.ExecConfig{
|
||||
AttachStderr: true,
|
||||
AttachStdin: true,
|
||||
AttachStdout: true,
|
||||
@ -66,10 +65,10 @@ func RunBackupCmdRemote(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, err = container.RunExec(dcli, cl, containerID, &execBackupListOpts, true)
|
||||
out, err := container.RunExec(dcli, cl, containerID, &execBackupListOpts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
return out, nil
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"coopcloud.tech/abra/pkg/upstream/container"
|
||||
"github.com/docker/cli/cli/command"
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
dockerClient "github.com/docker/docker/client"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
@ -24,7 +24,7 @@ import (
|
||||
func RunCmdRemote(
|
||||
cl *dockerClient.Client,
|
||||
app appPkg.App,
|
||||
disableTTY bool,
|
||||
requestTTY bool,
|
||||
abraSh, serviceName, cmdName, cmdArgs, remoteUser string) error {
|
||||
filters := filters.NewArgs()
|
||||
filters.Add("name", fmt.Sprintf("^%s_%s", app.StackName(), serviceName))
|
||||
@ -42,7 +42,7 @@ func RunCmdRemote(
|
||||
return err
|
||||
}
|
||||
|
||||
copyOpts := containertypes.CopyToContainerOptions{AllowOverwriteDirWithFile: false, CopyUIDGID: false}
|
||||
copyOpts := types.CopyToContainerOptions{AllowOverwriteDirWithFile: false, CopyUIDGID: false}
|
||||
if err := cl.CopyToContainer(context.Background(), targetContainer.ID, "/tmp", content, copyOpts); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -55,7 +55,7 @@ func RunCmdRemote(
|
||||
|
||||
shell := "/bin/bash"
|
||||
findShell := []string{"test", "-e", shell}
|
||||
execCreateOpts := containertypes.ExecOptions{
|
||||
execCreateOpts := types.ExecConfig{
|
||||
AttachStderr: true,
|
||||
AttachStdin: true,
|
||||
AttachStdout: true,
|
||||
@ -64,7 +64,7 @@ func RunCmdRemote(
|
||||
Tty: false,
|
||||
}
|
||||
|
||||
if _, err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts, true); err != nil {
|
||||
if _, err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts); err != nil {
|
||||
log.Infof("%s does not exist for %s, use /bin/sh as fallback", shell, app.Name)
|
||||
shell = "/bin/sh"
|
||||
}
|
||||
@ -84,14 +84,12 @@ func RunCmdRemote(
|
||||
}
|
||||
|
||||
execCreateOpts.Cmd = cmd
|
||||
|
||||
execCreateOpts.Tty = true
|
||||
if disableTTY {
|
||||
execCreateOpts.Tty = false
|
||||
execCreateOpts.Tty = requestTTY
|
||||
if !requestTTY {
|
||||
log.Debugf("not requesting a remote TTY")
|
||||
}
|
||||
|
||||
if _, err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts, true); err != nil {
|
||||
if _, err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user