Skip to content

Commit 403327f

Browse files
committed
vendor: github.com/moby/moby/api master, moby/client master
This change vendors moby/moby@49f96ee for github.com/moby/moby/api and github.com/moby/moby/client dependencies. Signed-off-by: Austin Vazquez <[email protected]>
1 parent f7d6d5b commit 403327f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+902
-491
lines changed

cli/command/container/exec.go

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func RunExec(ctx context.Context, dockerCLI command.Cli, containerIDorName strin
101101
return err
102102
}
103103
if !options.Detach {
104-
if err := dockerCLI.In().CheckTty(execOptions.AttachStdin, execOptions.Tty); err != nil {
104+
if err := dockerCLI.In().CheckTty(execOptions.AttachStdin, execOptions.TTY); err != nil {
105105
return err
106106
}
107107
}
@@ -119,27 +119,20 @@ func RunExec(ctx context.Context, dockerCLI command.Cli, containerIDorName strin
119119
}
120120

121121
if options.Detach {
122-
var cs client.ConsoleSize
123-
if execOptions.ConsoleSize != nil {
124-
cs = client.ConsoleSize{
125-
Height: execOptions.ConsoleSize[0],
126-
Width: execOptions.ConsoleSize[1],
127-
}
128-
}
129122
_, err := apiClient.ExecStart(ctx, execID, client.ExecStartOptions{
130123
Detach: options.Detach,
131-
TTY: execOptions.Tty,
132-
ConsoleSize: cs,
124+
TTY: execOptions.TTY,
125+
ConsoleSize: client.ConsoleSize{Height: execOptions.ConsoleSize.Height, Width: execOptions.ConsoleSize.Width},
133126
})
134127
return err
135128
}
136129
return interactiveExec(ctx, dockerCLI, execOptions, execID)
137130
}
138131

139132
func fillConsoleSize(execOptions *client.ExecCreateOptions, dockerCli command.Cli) {
140-
if execOptions.Tty {
133+
if execOptions.TTY {
141134
height, width := dockerCli.Out().GetTtySize()
142-
execOptions.ConsoleSize = &[2]uint{height, width}
135+
execOptions.ConsoleSize = client.ConsoleSize{Height: height, Width: width}
143136
}
144137
}
145138

@@ -157,7 +150,7 @@ func interactiveExec(ctx context.Context, dockerCli command.Cli, execOptions *cl
157150
out = dockerCli.Out()
158151
}
159152
if execOptions.AttachStderr {
160-
if execOptions.Tty {
153+
if execOptions.TTY {
161154
stderr = dockerCli.Out()
162155
} else {
163156
stderr = dockerCli.Err()
@@ -166,16 +159,9 @@ func interactiveExec(ctx context.Context, dockerCli command.Cli, execOptions *cl
166159
fillConsoleSize(execOptions, dockerCli)
167160

168161
apiClient := dockerCli.Client()
169-
var cs client.ConsoleSize
170-
if execOptions.ConsoleSize != nil {
171-
cs = client.ConsoleSize{
172-
Height: execOptions.ConsoleSize[0],
173-
Width: execOptions.ConsoleSize[1],
174-
}
175-
}
176162
resp, err := apiClient.ExecAttach(ctx, execID, client.ExecAttachOptions{
177-
TTY: execOptions.Tty,
178-
ConsoleSize: cs,
163+
TTY: execOptions.TTY,
164+
ConsoleSize: client.ConsoleSize{Height: execOptions.ConsoleSize.Height, Width: execOptions.ConsoleSize.Width},
179165
})
180166
if err != nil {
181167
return err
@@ -193,15 +179,15 @@ func interactiveExec(ctx context.Context, dockerCli command.Cli, execOptions *cl
193179
outputStream: out,
194180
errorStream: stderr,
195181
resp: resp.HijackedResponse,
196-
tty: execOptions.Tty,
182+
tty: execOptions.TTY,
197183
detachKeys: execOptions.DetachKeys,
198184
}
199185

200186
return streamer.stream(ctx)
201187
}()
202188
}()
203189

204-
if execOptions.Tty && dockerCli.In().IsTerminal() {
190+
if execOptions.TTY && dockerCli.In().IsTerminal() {
205191
if err := MonitorTtySize(ctx, dockerCli, execID, true); err != nil {
206192
_, _ = fmt.Fprintln(dockerCli.Err(), "Error monitoring TTY size:", err)
207193
}
@@ -237,7 +223,7 @@ func parseExec(execOpts ExecOptions, configFile *configfile.ConfigFile) (*client
237223
execOptions := &client.ExecCreateOptions{
238224
User: execOpts.User,
239225
Privileged: execOpts.Privileged,
240-
Tty: execOpts.TTY,
226+
TTY: execOpts.TTY,
241227
Cmd: execOpts.Command,
242228
WorkingDir: execOpts.Workdir,
243229
}

cli/command/container/prune.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
7575
}
7676
}
7777

78-
res, err := dockerCli.Client().ContainersPrune(ctx, client.ContainerPruneOptions{
78+
res, err := dockerCli.Client().ContainerPrune(ctx, client.ContainerPruneOptions{
7979
Filters: pruneFilters,
8080
})
8181
if err != nil {

cli/command/formatter/buildcache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ shared: {{.Shared}}
5151
return Format(source)
5252
}
5353

54-
func buildCacheSort(buildCache []*build.CacheRecord) {
54+
func buildCacheSort(buildCache []build.CacheRecord) {
5555
sort.Slice(buildCache, func(i, j int) bool {
5656
lui, luj := buildCache[i].LastUsedAt, buildCache[j].LastUsedAt
5757
switch {
@@ -70,7 +70,7 @@ func buildCacheSort(buildCache []*build.CacheRecord) {
7070
}
7171

7272
// BuildCacheWrite renders the context for a list of containers
73-
func BuildCacheWrite(ctx Context, buildCaches []*build.CacheRecord) error {
73+
func BuildCacheWrite(ctx Context, buildCaches []build.CacheRecord) error {
7474
render := func(format func(subContext SubContext) error) error {
7575
buildCacheSort(buildCaches)
7676
for _, bc := range buildCaches {
@@ -87,7 +87,7 @@ func BuildCacheWrite(ctx Context, buildCaches []*build.CacheRecord) error {
8787
type buildCacheContext struct {
8888
HeaderContext
8989
trunc bool
90-
v *build.CacheRecord
90+
v build.CacheRecord
9191
}
9292

9393
func newBuildCacheContext() *buildCacheContext {

0 commit comments

Comments
 (0)