mirror of
https://github.com/docker/cli.git
synced 2026-11-12 15:53:52 -04:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
912c1ddf8a | ||
|
|
c97e8091a6 | ||
|
|
82bd8158f7 | ||
|
|
8945848025 | ||
|
|
b54897bcb8 | ||
|
|
cd560916f3 | ||
|
|
9a101a955b | ||
|
|
50fae20748 | ||
|
|
37533c2f55 | ||
|
|
217971d481 | ||
|
|
fce24d5f8d | ||
|
|
0e4f16f3bf | ||
|
|
6e35a78fd9 | ||
|
|
bf1a701820 |
@@ -28,9 +28,8 @@ jobs:
|
|||||||
- alpine
|
- alpine
|
||||||
- debian
|
- debian
|
||||||
engine-version:
|
engine-version:
|
||||||
- 27-rc # testing
|
- 27.0 # latest
|
||||||
- 26.1 # latest
|
- 26.1 # latest - 1
|
||||||
- 25.0 # latest - 1
|
|
||||||
- 23.0 # mirantis lts
|
- 23.0 # mirantis lts
|
||||||
# TODO(krissetto) 19.03 needs a look, doesn't work ubuntu 22.04 (cgroup errors).
|
# TODO(krissetto) 19.03 needs a look, doesn't work ubuntu 22.04 (cgroup errors).
|
||||||
# we could have a separate job that tests it against ubuntu 20.04
|
# we could have a separate job that tests it against ubuntu 20.04
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package credentials
|
package credentials
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -74,7 +75,10 @@ func ConvertToHostname(maybeURL string) string {
|
|||||||
if strings.Contains(stripped, "://") {
|
if strings.Contains(stripped, "://") {
|
||||||
u, err := url.Parse(stripped)
|
u, err := url.Parse(stripped)
|
||||||
if err == nil && u.Hostname() != "" {
|
if err == nil && u.Hostname() != "" {
|
||||||
return u.Hostname()
|
if u.Port() == "" {
|
||||||
|
return u.Hostname()
|
||||||
|
}
|
||||||
|
return net.JoinHostPort(u.Hostname(), u.Port())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hostName, _, _ := strings.Cut(stripped, "/")
|
hostName, _, _ := strings.Cut(stripped, "/")
|
||||||
|
|||||||
@@ -137,6 +137,19 @@ func TestFileStoreErase(t *testing.T) {
|
|||||||
|
|
||||||
func TestConvertToHostname(t *testing.T) {
|
func TestConvertToHostname(t *testing.T) {
|
||||||
tests := []struct{ input, expected string }{
|
tests := []struct{ input, expected string }{
|
||||||
|
{
|
||||||
|
input: "127.0.0.1",
|
||||||
|
expected: "127.0.0.1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "::1",
|
||||||
|
expected: "::1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// FIXME(thaJeztah): this should be normalized to "::1" if there's no port (or vice-versa, as long as we're consistent)
|
||||||
|
input: "[::1]",
|
||||||
|
expected: "[::1]",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
input: "example.com",
|
input: "example.com",
|
||||||
expected: "example.com",
|
expected: "example.com",
|
||||||
@@ -167,6 +180,48 @@ func TestConvertToHostname(t *testing.T) {
|
|||||||
input: "ftp://example.com",
|
input: "ftp://example.com",
|
||||||
expected: "example.com",
|
expected: "example.com",
|
||||||
},
|
},
|
||||||
|
// should support non-standard port in registry url
|
||||||
|
{
|
||||||
|
input: "127.0.0.1:6556",
|
||||||
|
expected: "127.0.0.1:6556",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// FIXME(thaJeztah): this should be normalized to "[::1]:6556"
|
||||||
|
input: "::1:6556",
|
||||||
|
expected: "::1:6556",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "[::1]:6556",
|
||||||
|
expected: "[::1]:6556",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "example.com:6555",
|
||||||
|
expected: "example.com:6555",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "https://127.0.0.1:6555/v2/",
|
||||||
|
expected: "127.0.0.1:6555",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "https://::1:6555/v2/",
|
||||||
|
expected: "[::1]:6555",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "https://[::1]:6555/v2/",
|
||||||
|
expected: "[::1]:6555",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "http://example.com:6555",
|
||||||
|
expected: "example.com:6555",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "https://example.com:6555",
|
||||||
|
expected: "example.com:6555",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "https://example.com:6555/v2/",
|
||||||
|
expected: "example.com:6555",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
tc := tc
|
tc := tc
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
ARG GO_VERSION=1.21.11
|
ARG GO_VERSION=1.21.11
|
||||||
ARG ALPINE_VERSION=3.20
|
ARG ALPINE_VERSION=3.20
|
||||||
ARG GOLANGCI_LINT_VERSION=v1.59.0
|
ARG GOLANGCI_LINT_VERSION=v1.59.1
|
||||||
|
|
||||||
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
|
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ require (
|
|||||||
github.com/creack/pty v1.1.21
|
github.com/creack/pty v1.1.21
|
||||||
github.com/distribution/reference v0.6.0
|
github.com/distribution/reference v0.6.0
|
||||||
github.com/docker/distribution v2.8.3+incompatible
|
github.com/docker/distribution v2.8.3+incompatible
|
||||||
github.com/docker/docker v27.0.1-rc.1.0.20240621131212-ff1e2c0de72a+incompatible // master (v27.0-dev)
|
github.com/docker/docker v27.0.2-0.20240626183043-e953d76450b6+incompatible
|
||||||
github.com/docker/docker-credential-helpers v0.8.2
|
github.com/docker/docker-credential-helpers v0.8.2
|
||||||
github.com/docker/go-connections v0.5.0
|
github.com/docker/go-connections v0.5.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
|
|||||||
+2
-2
@@ -57,8 +57,8 @@ github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5
|
|||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
||||||
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v27.0.1-rc.1.0.20240621131212-ff1e2c0de72a+incompatible h1:FKVJYmkfC2Rwthnhi5P2x/MVBAF/mwiQ7StbTBpjJrg=
|
github.com/docker/docker v27.0.2-0.20240626183043-e953d76450b6+incompatible h1:G3kEC7B0RWcJjojlEuMzaXE/dp3rScxo8ECJ60XEXqs=
|
||||||
github.com/docker/docker v27.0.1-rc.1.0.20240621131212-ff1e2c0de72a+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v27.0.2-0.20240626183043-e953d76450b6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
|
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
|
||||||
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||||
|
|||||||
+1
-13
@@ -245,18 +245,6 @@ type ContainerState struct {
|
|||||||
Health *Health `json:",omitempty"`
|
Health *Health `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerNode stores information about the node that a container
|
|
||||||
// is running on. It's only used by the Docker Swarm standalone API
|
|
||||||
type ContainerNode struct {
|
|
||||||
ID string
|
|
||||||
IPAddress string `json:"IP"`
|
|
||||||
Addr string
|
|
||||||
Name string
|
|
||||||
Cpus int
|
|
||||||
Memory int64
|
|
||||||
Labels map[string]string
|
|
||||||
}
|
|
||||||
|
|
||||||
// ContainerJSONBase contains response of Engine API:
|
// ContainerJSONBase contains response of Engine API:
|
||||||
// GET "/containers/{name:.*}/json"
|
// GET "/containers/{name:.*}/json"
|
||||||
type ContainerJSONBase struct {
|
type ContainerJSONBase struct {
|
||||||
@@ -270,7 +258,7 @@ type ContainerJSONBase struct {
|
|||||||
HostnamePath string
|
HostnamePath string
|
||||||
HostsPath string
|
HostsPath string
|
||||||
LogPath string
|
LogPath string
|
||||||
Node *ContainerNode `json:",omitempty"` // Node is only propagated by Docker Swarm standalone API
|
Node *ContainerNode `json:",omitempty"` // Deprecated: Node was only propagated by Docker Swarm standalone API. It sill be removed in the next release.
|
||||||
Name string
|
Name string
|
||||||
RestartCount int
|
RestartCount int
|
||||||
Driver string
|
Driver string
|
||||||
|
|||||||
+14
@@ -194,3 +194,17 @@ type ImageImportSource image.ImportSource
|
|||||||
//
|
//
|
||||||
// Deprecated: use [image.LoadResponse].
|
// Deprecated: use [image.LoadResponse].
|
||||||
type ImageLoadResponse = image.LoadResponse
|
type ImageLoadResponse = image.LoadResponse
|
||||||
|
|
||||||
|
// ContainerNode stores information about the node that a container
|
||||||
|
// is running on. It's only used by the Docker Swarm standalone API.
|
||||||
|
//
|
||||||
|
// Deprecated: ContainerNode was used for the classic Docker Swarm standalone API. It will be removed in the next release.
|
||||||
|
type ContainerNode struct {
|
||||||
|
ID string
|
||||||
|
IPAddress string `json:"IP"`
|
||||||
|
Addr string
|
||||||
|
Name string
|
||||||
|
Cpus int
|
||||||
|
Memory int64
|
||||||
|
Labels map[string]string
|
||||||
|
}
|
||||||
|
|||||||
+2
-2
@@ -54,7 +54,7 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
|
|||||||
wo = &tar.Header{
|
wo = &tar.Header{
|
||||||
Typeflag: tar.TypeReg,
|
Typeflag: tar.TypeReg,
|
||||||
Mode: hdr.Mode & int64(os.ModePerm),
|
Mode: hdr.Mode & int64(os.ModePerm),
|
||||||
Name: filepath.Join(hdr.Name, WhiteoutOpaqueDir),
|
Name: filepath.Join(hdr.Name, WhiteoutOpaqueDir), // #nosec G305 -- An archive is being created, not extracted.
|
||||||
Size: 0,
|
Size: 0,
|
||||||
Uid: hdr.Uid,
|
Uid: hdr.Uid,
|
||||||
Uname: hdr.Uname,
|
Uname: hdr.Uname,
|
||||||
@@ -62,7 +62,7 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
|
|||||||
Gname: hdr.Gname,
|
Gname: hdr.Gname,
|
||||||
AccessTime: hdr.AccessTime,
|
AccessTime: hdr.AccessTime,
|
||||||
ChangeTime: hdr.ChangeTime,
|
ChangeTime: hdr.ChangeTime,
|
||||||
} // #nosec G305 -- An archive is being created, not extracted.
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -53,7 +53,7 @@ github.com/docker/distribution/registry/client/transport
|
|||||||
github.com/docker/distribution/registry/storage/cache
|
github.com/docker/distribution/registry/storage/cache
|
||||||
github.com/docker/distribution/registry/storage/cache/memory
|
github.com/docker/distribution/registry/storage/cache/memory
|
||||||
github.com/docker/distribution/uuid
|
github.com/docker/distribution/uuid
|
||||||
# github.com/docker/docker v27.0.1-rc.1.0.20240621131212-ff1e2c0de72a+incompatible
|
# github.com/docker/docker v27.0.2-0.20240626183043-e953d76450b6+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/docker/api
|
github.com/docker/docker/api
|
||||||
github.com/docker/docker/api/types
|
github.com/docker/docker/api/types
|
||||||
|
|||||||
Reference in New Issue
Block a user