Merge pull request #50218 from thaJeztah/deprecate_execconfig_detach

api/types/container: deprecate ExecOptions.Detach
This commit is contained in:
Sebastiaan van Stijn
2025-06-18 17:52:39 +02:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -18,11 +18,13 @@ type ExecOptions struct {
AttachStdin bool // Attach the standard input, makes possible user interaction
AttachStderr bool // Attach the standard error
AttachStdout bool // Attach the standard output
Detach bool // Execute in detach mode
DetachKeys string // Escape keys for detach
Env []string // Environment variables
WorkingDir string // Working directory
Cmd []string // Execution commands and args
// Deprecated: the Detach field is not used, and will be removed in a future release.
Detach bool
}
// ExecStartOptions is a temp struct used by execStart

View File

@@ -127,9 +127,8 @@ func TestExecResize(t *testing.T) {
cmd = []string{"sleep", "240"}
}
resp, err := apiClient.ContainerExecCreate(ctx, cID, containertypes.ExecOptions{
Tty: true, // Windows requires a TTY for the resize to work, otherwise fails with "is not a tty: failed precondition", see https://github.com/moby/moby/pull/48665#issuecomment-2412530345
Detach: true,
Cmd: cmd,
Tty: true, // Windows requires a TTY for the resize to work, otherwise fails with "is not a tty: failed precondition", see https://github.com/moby/moby/pull/48665#issuecomment-2412530345
Cmd: cmd,
})
assert.NilError(t, err)
execID := resp.ID