Skip to content

Commit 3434869

Browse files
authored
Merge pull request #6591 from vvoland/update-docker
vendor: github.com/moby/moby master
2 parents 9dde80a + e636a2a commit 3434869

File tree

13 files changed

+86
-108
lines changed

13 files changed

+86
-108
lines changed

cli/command/container/rename.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package container
22

33
import (
4-
"errors"
54
"fmt"
65

76
"github.com/docker/cli/cli"
@@ -19,10 +18,6 @@ func newRenameCommand(dockerCLI command.Cli) *cobra.Command {
1918
Args: cli.ExactArgs(2),
2019
RunE: func(cmd *cobra.Command, args []string) error {
2120
oldName, newName := args[0], args[1]
22-
if newName == "" {
23-
// TODO(thaJeztah): remove once https://github.com/moby/moby/pull/51336 is merged and vendored.
24-
return errors.New("new name cannot be blank")
25-
}
2621
_, err := dockerCLI.Client().ContainerRename(cmd.Context(), oldName, client.ContainerRenameOptions{
2722
NewName: newName,
2823
})

cli/command/container/rename_test.go

Lines changed: 0 additions & 62 deletions
This file was deleted.

cli/command/registry/login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func loginClientSide(ctx context.Context, options client.RegistryLoginOptions) (
332332
}
333333

334334
return client.RegistryLoginResult{
335-
Auth: registrytypes.AuthenticateOKBody{
335+
Auth: registrytypes.AuthResponse{
336336
Status: "Login Succeeded",
337337
IdentityToken: token,
338338
},

cli/command/registry/login_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (*fakeClient) RegistryLogin(_ context.Context, options client.RegistryLogin
4343
}
4444
if options.Password == useToken {
4545
return client.RegistryLoginResult{
46-
Auth: registrytypes.AuthenticateOKBody{IdentityToken: options.Password},
46+
Auth: registrytypes.AuthResponse{IdentityToken: options.Password},
4747
}, nil
4848
}
4949
if options.Username == unknownUser {

e2e/container/rename_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,27 @@ func TestContainerRename(t *testing.T) {
2626
res.Assert(t, icmd.Success)
2727
assert.Equal(t, "/"+newName, strings.TrimSpace(res.Stdout()))
2828
}
29+
30+
func TestContainerRenameEmptyOldName(t *testing.T) {
31+
res := icmd.RunCommand("docker", "container", "rename", "", "newName")
32+
res.Assert(t, icmd.Expected{
33+
ExitCode: 1,
34+
Err: "invalid container name or ID: value is empty",
35+
})
36+
}
37+
38+
func TestContainerRenameEmptyNewName(t *testing.T) {
39+
oldName := "old_name_" + t.Name()
40+
res := icmd.RunCommand("docker", "run", "-d", "--name", oldName, fixtures.AlpineImage, "sleep", "60")
41+
res.Assert(t, icmd.Success)
42+
cID := strings.TrimSpace(res.Stdout())
43+
t.Cleanup(func() {
44+
icmd.RunCommand("docker", "container", "rm", "-f", cID).Assert(t, icmd.Success)
45+
})
46+
47+
res = icmd.RunCommand("docker", "container", "rename", oldName, "")
48+
res.Assert(t, icmd.Expected{
49+
ExitCode: 1,
50+
Err: "new name cannot be blank",
51+
})
52+
}

vendor.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ require (
2828
github.com/google/uuid v1.6.0
2929
github.com/mattn/go-runewidth v0.0.17
3030
github.com/moby/go-archive v0.1.0
31-
github.com/moby/moby/api v1.52.0-beta.2.0.20251029165853-ef17deb3a0fb // master
32-
github.com/moby/moby/client v0.1.0-beta.2.0.20251029165853-ef17deb3a0fb // master
31+
github.com/moby/moby/api v1.52.0-beta.2.0.20251029225139-7a97e1cb401f // master
32+
github.com/moby/moby/client v0.1.0-beta.2.0.20251029225139-7a97e1cb401f // master
3333
github.com/moby/patternmatcher v0.6.0
3434
github.com/moby/swarmkit/v2 v2.1.0
3535
github.com/moby/sys/atomicwriter v0.1.0

vendor.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N
170170
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
171171
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
172172
github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
173-
github.com/moby/moby/api v1.52.0-beta.2.0.20251029165853-ef17deb3a0fb h1:t4RxpXuvv26rIVUBqUm0xgmaSmmTJTv5fzEDxg5piWE=
174-
github.com/moby/moby/api v1.52.0-beta.2.0.20251029165853-ef17deb3a0fb/go.mod h1:v0K/motq8oWmx+rtApG1rBTIpQ8KUONUjpf+U73gags=
175-
github.com/moby/moby/client v0.1.0-beta.2.0.20251029165853-ef17deb3a0fb h1:3F0iF/yIxE43JcK3rJp4k/TsVmfvFMgRyGT/tg+K1xI=
176-
github.com/moby/moby/client v0.1.0-beta.2.0.20251029165853-ef17deb3a0fb/go.mod h1:1YrJTvhL771Q4xiwwe72NSS17lgsCF67xu8fEfSd77g=
173+
github.com/moby/moby/api v1.52.0-beta.2.0.20251029225139-7a97e1cb401f h1:agkZxo7k3fXBqdq6leYCCv0K45OjkH/H3fzPjwcoDkY=
174+
github.com/moby/moby/api v1.52.0-beta.2.0.20251029225139-7a97e1cb401f/go.mod h1:v0K/motq8oWmx+rtApG1rBTIpQ8KUONUjpf+U73gags=
175+
github.com/moby/moby/client v0.1.0-beta.2.0.20251029225139-7a97e1cb401f h1:I0uikdmKsCbOxQV+DIn7gyY8bD0d19g8920FuxI9l3E=
176+
github.com/moby/moby/client v0.1.0-beta.2.0.20251029225139-7a97e1cb401f/go.mod h1:1YrJTvhL771Q4xiwwe72NSS17lgsCF67xu8fEfSd77g=
177177
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
178178
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
179179
github.com/moby/swarmkit/v2 v2.1.0 h1:u+cJ5hSyF3HnzsyI+NtegYxdIPQIuibk7IbpXNxuISM=

vendor/github.com/moby/moby/api/types/registry/auth_response.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/moby/moby/api/types/registry/authenticate.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

vendor/github.com/moby/moby/client/client.go

Lines changed: 20 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)