revendor docker/docker from master

Revendoring to get new StartInterval field for container health config

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2023-07-06 19:05:08 +00:00
parent dc2eb3bf7c
commit 9bfaa6ff79
24 changed files with 73 additions and 84 deletions

View File

@ -11,7 +11,7 @@ require (
github.com/containerd/containerd v1.6.21 github.com/containerd/containerd v1.6.21
github.com/creack/pty v1.1.18 github.com/creack/pty v1.1.18
github.com/docker/distribution v2.8.2+incompatible github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v24.0.0-rc.2.0.20230627140857-7f8b1cd7f928+incompatible // master (v25.0.0-dev) github.com/docker/docker v24.0.0-rc.2.0.20230706181717-98d3da79ef9c+incompatible // master (v25.0.0-dev)
github.com/docker/docker-credential-helpers v0.7.0 github.com/docker/docker-credential-helpers v0.7.0
github.com/docker/go-connections v0.4.0 github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.5.0 github.com/docker/go-units v0.5.0

View File

@ -98,8 +98,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xb
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.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.0-rc.2.0.20230627140857-7f8b1cd7f928+incompatible h1:2NGrlnNNqZK8xzlRDfQO1gOnP5ODJzQ1W52PJKbMOVs= github.com/docker/docker v24.0.0-rc.2.0.20230706181717-98d3da79ef9c+incompatible h1:XccikgvtGCEZE9ZQoaEApdx9ZvruGYakfi2tw4d/vUg=
github.com/docker/docker v24.0.0-rc.2.0.20230627140857-7f8b1cd7f928+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v24.0.0-rc.2.0.20230706181717-98d3da79ef9c+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
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=

View File

@ -27,6 +27,7 @@ Adam Miller <admiller@redhat.com>
Adam Mills <adam@armills.info> Adam Mills <adam@armills.info>
Adam Pointer <adam.pointer@skybettingandgaming.com> Adam Pointer <adam.pointer@skybettingandgaming.com>
Adam Singer <financeCoding@gmail.com> Adam Singer <financeCoding@gmail.com>
Adam Thornton <adam.thornton@maryville.com>
Adam Walz <adam@adamwalz.net> Adam Walz <adam@adamwalz.net>
Adam Williams <awilliams@mirantis.com> Adam Williams <awilliams@mirantis.com>
AdamKorcz <adam@adalogics.com> AdamKorcz <adam@adalogics.com>
@ -436,7 +437,6 @@ Cristina Yenyxe Gonzalez Garcia <cristina.yenyxe@gmail.com>
Cruceru Calin-Cristian <crucerucalincristian@gmail.com> Cruceru Calin-Cristian <crucerucalincristian@gmail.com>
cui fliter <imcusg@gmail.com> cui fliter <imcusg@gmail.com>
CUI Wei <ghostplant@qq.com> CUI Wei <ghostplant@qq.com>
cuishuang <imcusg@gmail.com>
Cuong Manh Le <cuong.manhle.vn@gmail.com> Cuong Manh Le <cuong.manhle.vn@gmail.com>
Cyprian Gracz <cyprian.gracz@micro-jumbo.eu> Cyprian Gracz <cyprian.gracz@micro-jumbo.eu>
Cyril F <cyrilf7x@gmail.com> Cyril F <cyrilf7x@gmail.com>
@ -679,6 +679,7 @@ Evan Allrich <evan@unguku.com>
Evan Carmi <carmi@users.noreply.github.com> Evan Carmi <carmi@users.noreply.github.com>
Evan Hazlett <ejhazlett@gmail.com> Evan Hazlett <ejhazlett@gmail.com>
Evan Krall <krall@yelp.com> Evan Krall <krall@yelp.com>
Evan Lezar <elezar@nvidia.com>
Evan Phoenix <evan@fallingsnow.net> Evan Phoenix <evan@fallingsnow.net>
Evan Wies <evan@neomantra.net> Evan Wies <evan@neomantra.net>
Evelyn Xu <evelynhsu21@gmail.com> Evelyn Xu <evelynhsu21@gmail.com>
@ -986,6 +987,7 @@ Jean Rouge <rougej+github@gmail.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com> Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
Jean-Christophe Berthon <huygens@berthon.eu> Jean-Christophe Berthon <huygens@berthon.eu>
Jean-Michel Rouet <jm.rouet@gmail.com>
Jean-Paul Calderone <exarkun@twistedmatrix.com> Jean-Paul Calderone <exarkun@twistedmatrix.com>
Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr> Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr>
Jean-Tiare Le Bigot <jt@yadutaf.fr> Jean-Tiare Le Bigot <jt@yadutaf.fr>
@ -1016,6 +1018,7 @@ Jeroen Jacobs <github@jeroenj.be>
Jesse Dearing <jesse.dearing@gmail.com> Jesse Dearing <jesse.dearing@gmail.com>
Jesse Dubay <jesse@thefortytwo.net> Jesse Dubay <jesse@thefortytwo.net>
Jessica Frazelle <jess@oxide.computer> Jessica Frazelle <jess@oxide.computer>
Jeyanthinath Muthuram <jeyanthinath10@gmail.com>
Jezeniel Zapanta <jpzapanta22@gmail.com> Jezeniel Zapanta <jpzapanta22@gmail.com>
Jhon Honce <jhonce@redhat.com> Jhon Honce <jhonce@redhat.com>
Ji.Zhilong <zhilongji@gmail.com> Ji.Zhilong <zhilongji@gmail.com>
@ -1610,6 +1613,7 @@ Noah Treuhaft <noah.treuhaft@docker.com>
NobodyOnSE <ich@sektor.selfip.com> NobodyOnSE <ich@sektor.selfip.com>
noducks <onemannoducks@gmail.com> noducks <onemannoducks@gmail.com>
Nolan Darilek <nolan@thewordnerd.info> Nolan Darilek <nolan@thewordnerd.info>
Nolan Miles <nolanpmiles@gmail.com>
Noriki Nakamura <noriki.nakamura@miraclelinux.com> Noriki Nakamura <noriki.nakamura@miraclelinux.com>
nponeccop <andy.melnikov@gmail.com> nponeccop <andy.melnikov@gmail.com>
Nurahmadie <nurahmadie@gmail.com> Nurahmadie <nurahmadie@gmail.com>
@ -1665,6 +1669,7 @@ Paul Lietar <paul@lietar.net>
Paul Liljenberg <liljenberg.paul@gmail.com> Paul Liljenberg <liljenberg.paul@gmail.com>
Paul Morie <pmorie@gmail.com> Paul Morie <pmorie@gmail.com>
Paul Nasrat <pnasrat@gmail.com> Paul Nasrat <pnasrat@gmail.com>
Paul Seiffert <paul.seiffert@jimdo.com>
Paul Weaver <pauweave@cisco.com> Paul Weaver <pauweave@cisco.com>
Paulo Gomes <pjbgf@linux.com> Paulo Gomes <pjbgf@linux.com>
Paulo Ribeiro <paigr.io@gmail.com> Paulo Ribeiro <paigr.io@gmail.com>
@ -1927,6 +1932,7 @@ Sebastiaan van Steenis <mail@superseb.nl>
Sebastiaan van Stijn <github@gone.nl> Sebastiaan van Stijn <github@gone.nl>
Sebastian Höffner <sebastian.hoeffner@mevis.fraunhofer.de> Sebastian Höffner <sebastian.hoeffner@mevis.fraunhofer.de>
Sebastian Radloff <sradloff23@gmail.com> Sebastian Radloff <sradloff23@gmail.com>
Sebastian Thomschke <sebthom@users.noreply.github.com>
Sebastien Goasguen <runseb@gmail.com> Sebastien Goasguen <runseb@gmail.com>
Senthil Kumar Selvaraj <senthil.thecoder@gmail.com> Senthil Kumar Selvaraj <senthil.thecoder@gmail.com>
Senthil Kumaran <senthil@uthcode.com> Senthil Kumaran <senthil@uthcode.com>
@ -2208,6 +2214,7 @@ Vinod Kulkarni <vinod.kulkarni@gmail.com>
Vishal Doshi <vishal.doshi@gmail.com> Vishal Doshi <vishal.doshi@gmail.com>
Vishnu Kannan <vishnuk@google.com> Vishnu Kannan <vishnuk@google.com>
Vitaly Ostrosablin <vostrosablin@virtuozzo.com> Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Vitor Anjos <bartier@users.noreply.github.com>
Vitor Monteiro <vmrmonteiro@gmail.com> Vitor Monteiro <vmrmonteiro@gmail.com>
Vivek Agarwal <me@vivek.im> Vivek Agarwal <me@vivek.im>
Vivek Dasgupta <vdasgupt@redhat.com> Vivek Dasgupta <vdasgupt@redhat.com>
@ -2360,6 +2367,7 @@ Zen Lin(Zhinan Lin) <linzhinan@huawei.com>
Zhang Kun <zkazure@gmail.com> Zhang Kun <zkazure@gmail.com>
Zhang Wei <zhangwei555@huawei.com> Zhang Wei <zhangwei555@huawei.com>
Zhang Wentao <zhangwentao234@huawei.com> Zhang Wentao <zhangwentao234@huawei.com>
zhangguanzhang <zhangguanzhang@qq.com>
ZhangHang <stevezhang2014@gmail.com> ZhangHang <stevezhang2014@gmail.com>
zhangxianwei <xianwei.zw@alibaba-inc.com> zhangxianwei <xianwei.zw@alibaba-inc.com>
Zhenan Ye <21551168@zju.edu.cn> Zhenan Ye <21551168@zju.edu.cn>

View File

@ -804,6 +804,12 @@ definitions:
1000000 (1 ms). 0 means inherit. 1000000 (1 ms). 0 means inherit.
type: "integer" type: "integer"
format: "int64" format: "int64"
StartInterval:
description: |
The time to wait between checks in nanoseconds during the start period.
It should be 0 or at least 1000000 (1 ms). 0 means inherit.
type: "integer"
format: "int64"
Health: Health:
description: | description: |
@ -5161,42 +5167,8 @@ definitions:
ServerVersion: ServerVersion:
description: | description: |
Version string of the daemon. Version string of the daemon.
> **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/)
> returns the Swarm version instead of the daemon version, for example
> `swarm/1.2.8`.
type: "string" type: "string"
example: "17.06.0-ce" example: "24.0.2"
ClusterStore:
description: |
URL of the distributed storage backend.
The storage backend is used for multihost networking (to store
network and endpoint information) and by the node discovery mechanism.
<p><br /></p>
> **Deprecated**: This field is only propagated when using standalone Swarm
> mode, and overlay networking using an external k/v store. Overlay
> networks with Swarm mode enabled use the built-in raft store, and
> this field will be empty.
type: "string"
example: "consul://consul.corp.example.com:8600/some/path"
ClusterAdvertise:
description: |
The network endpoint that the Engine advertises for the purpose of
node discovery. ClusterAdvertise is a `host:port` combination on which
the daemon is reachable by other hosts.
<p><br /></p>
> **Deprecated**: This field is only propagated when using standalone Swarm
> mode, and overlay networking using an external k/v store. Overlay
> networks with Swarm mode enabled use the built-in raft store, and
> this field will be empty.
type: "string"
example: "node5.corp.example.com:8000"
Runtimes: Runtimes:
description: | description: |
List of [OCI compliant](https://github.com/opencontainers/runtime-spec) List of [OCI compliant](https://github.com/opencontainers/runtime-spec)
@ -10391,6 +10363,12 @@ paths:
default if omitted. default if omitted.
required: true required: true
type: "string" type: "string"
- name: "force"
in: "query"
description: |
Force disable a plugin even if still in use.
required: false
type: "boolean"
tags: ["Plugin"] tags: ["Plugin"]
/plugins/{name}/upgrade: /plugins/{name}/upgrade:
post: post:

View File

@ -44,9 +44,10 @@ type HealthConfig struct {
Test []string `json:",omitempty"` Test []string `json:",omitempty"`
// Zero means to inherit. Durations are expressed as integer nanoseconds. // Zero means to inherit. Durations are expressed as integer nanoseconds.
Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks. Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks.
Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung. Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung.
StartPeriod time.Duration `json:",omitempty"` // The start period for the container to initialize before the retries starts to count down. StartPeriod time.Duration `json:",omitempty"` // The start period for the container to initialize before the retries starts to count down.
StartInterval time.Duration `json:",omitempty"` // The interval to attempt healthchecks at during the start period
// Retries is the number of consecutive failures needed to consider a container as unhealthy. // Retries is the number of consecutive failures needed to consider a container as unhealthy.
// Zero means inherit. // Zero means inherit.

View File

@ -307,6 +307,9 @@ type Info struct {
ProductLicense string `json:",omitempty"` ProductLicense string `json:",omitempty"`
DefaultAddressPools []NetworkAddressPool `json:",omitempty"` DefaultAddressPools []NetworkAddressPool `json:",omitempty"`
// Legacy API fields for older API versions.
legacyFields
// Warnings contains a slice of warnings that occurred while collecting // Warnings contains a slice of warnings that occurred while collecting
// system information. These warnings are intended to be informational // system information. These warnings are intended to be informational
// messages for the user, and are not intended to be parsed / used for // messages for the user, and are not intended to be parsed / used for
@ -314,6 +317,10 @@ type Info struct {
Warnings []string Warnings []string
} }
type legacyFields struct {
ExecutionDriver string `json:",omitempty"` // Deprecated: deprecated since API v1.25, but returned for older versions.
}
// KeyValue holds a key/value pair // KeyValue holds a key/value pair
type KeyValue struct { type KeyValue struct {
Key, Value string Key, Value string

View File

@ -35,7 +35,6 @@ func WithIsolatedConfig(v bool) CloneOption {
// will be under "docker-build-git" // will be under "docker-build-git"
func Clone(remoteURL string, opts ...CloneOption) (string, error) { func Clone(remoteURL string, opts ...CloneOption) (string, error) {
repo, err := parseRemoteURL(remoteURL) repo, err := parseRemoteURL(remoteURL)
if err != nil { if err != nil {
return "", err return "", err
} }

View File

@ -29,6 +29,9 @@ func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config
if err := cli.NewVersionError("1.41", "specify container image platform"); platform != nil && err != nil { if err := cli.NewVersionError("1.41", "specify container image platform"); platform != nil && err != nil {
return response, err return response, err
} }
if err := cli.NewVersionError("1.44", "specify health-check start interval"); config != nil && config.Healthcheck != nil && config.Healthcheck.StartInterval != 0 && err != nil {
return response, err
}
if hostConfig != nil { if hostConfig != nil {
if versions.LessThan(cli.ClientVersion(), "1.25") { if versions.LessThan(cli.ClientVersion(), "1.25") {

View File

@ -37,7 +37,6 @@ func (cli *Client) ContainerList(ctx context.Context, options types.ContainerLis
if options.Filters.Len() > 0 { if options.Filters.Len() > 0 {
//nolint:staticcheck // ignore SA1019 for old code //nolint:staticcheck // ignore SA1019 for old code
filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -16,7 +16,6 @@ func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions)
if options.Filters.Len() > 0 { if options.Filters.Len() > 0 {
filterJSON, err := filters.ToJSON(options.Filters) filterJSON, err := filters.ToJSON(options.Filters)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -43,7 +43,7 @@ import (
// This value is currently implementation-defined, and not captured in any cross-runtime specification. Thus, it is // This value is currently implementation-defined, and not captured in any cross-runtime specification. Thus, it is
// subject to change in Moby at any time -- image authors who require consistent or known directory permissions // subject to change in Moby at any time -- image authors who require consistent or known directory permissions
// should explicitly control them by ensuring that header entries exist for any applicable path. // should explicitly control them by ensuring that header entries exist for any applicable path.
const ImpliedDirectoryMode = 0755 const ImpliedDirectoryMode = 0o755
type ( type (
// Compression is the state represents if compressed or not. // Compression is the state represents if compressed or not.
@ -1312,7 +1312,7 @@ func (archiver *Archiver) CopyWithTar(src, dst string) error {
// as owner // as owner
rootIDs := archiver.IDMapping.RootPair() rootIDs := archiver.IDMapping.RootPair()
// Create dst, copy src's content into it // Create dst, copy src's content into it
if err := idtools.MkdirAllAndChownNew(dst, 0755, rootIDs); err != nil { if err := idtools.MkdirAllAndChownNew(dst, 0o755, rootIDs); err != nil {
return err return err
} }
return archiver.TarUntar(src, dst) return archiver.TarUntar(src, dst)
@ -1337,7 +1337,7 @@ func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {
dst = filepath.Join(dst, filepath.Base(src)) dst = filepath.Join(dst, filepath.Base(src))
} }
// Create the holding directory if necessary // Create the holding directory if necessary
if err := system.MkdirAll(filepath.Dir(dst), 0700); err != nil { if err := system.MkdirAll(filepath.Dir(dst), 0o700); err != nil {
return err return err
} }

View File

@ -21,8 +21,7 @@ func getWhiteoutConverter(format WhiteoutFormat, inUserNS bool) (tarWhiteoutConv
return nil, nil return nil, nil
} }
type overlayWhiteoutConverter struct { type overlayWhiteoutConverter struct{}
}
func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os.FileInfo) (wo *tar.Header, err error) { func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os.FileInfo) (wo *tar.Header, err error) {
// convert whiteouts to AUFS format // convert whiteouts to AUFS format
@ -30,7 +29,7 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
// we just rename the file and make it normal // we just rename the file and make it normal
dir, filename := filepath.Split(hdr.Name) dir, filename := filepath.Split(hdr.Name)
hdr.Name = filepath.Join(dir, WhiteoutPrefix+filename) hdr.Name = filepath.Join(dir, WhiteoutPrefix+filename)
hdr.Mode = 0600 hdr.Mode = 0o600
hdr.Typeflag = tar.TypeReg hdr.Typeflag = tar.TypeReg
hdr.Size = 0 hdr.Size = 0
} }

View File

@ -82,7 +82,7 @@ func getFileUIDGID(stat interface{}) (idtools.Identity, error) {
// handleTarTypeBlockCharFifo is an OS-specific helper function used by // handleTarTypeBlockCharFifo is an OS-specific helper function used by
// createTarFile to handle the following types of header: Block; Char; Fifo // createTarFile to handle the following types of header: Block; Char; Fifo
func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {
mode := uint32(hdr.Mode & 07777) mode := uint32(hdr.Mode & 0o7777)
switch hdr.Typeflag { switch hdr.Typeflag {
case tar.TypeBlock: case tar.TypeBlock:
mode |= unix.S_IFBLK mode |= unix.S_IFBLK

View File

@ -108,8 +108,10 @@ func aufsDeletedFile(root, path string, fi os.FileInfo) (string, error) {
return "", nil return "", nil
} }
type skipChange func(string) (bool, error) type (
type deleteChange func(string, string, os.FileInfo) (string, error) skipChange func(string) (bool, error)
deleteChange func(string, string, os.FileInfo) (string, error)
)
func changes(layers []string, rw string, dc deleteChange, sc skipChange) ([]Change, error) { func changes(layers []string, rw string, dc deleteChange, sc skipChange) ([]Change, error) {
var ( var (
@ -342,9 +344,7 @@ func newRootFileInfo() *FileInfo {
// ChangesDirs compares two directories and generates an array of Change objects describing the changes. // ChangesDirs compares two directories and generates an array of Change objects describing the changes.
// If oldDir is "", then all files in newDir will be Add-Changes. // If oldDir is "", then all files in newDir will be Add-Changes.
func ChangesDirs(newDir, oldDir string) ([]Change, error) { func ChangesDirs(newDir, oldDir string) ([]Change, error) {
var ( var oldRoot, newRoot *FileInfo
oldRoot, newRoot *FileInfo
)
if oldDir == "" { if oldDir == "" {
emptyDir, err := os.MkdirTemp("", "empty") emptyDir, err := os.MkdirTemp("", "empty")
if err != nil { if err != nil {

View File

@ -267,7 +267,7 @@ func parseDirent(buf []byte, names []nameIno) (consumed int, newnames []nameIno)
continue continue
} }
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0])) bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
var name = string(bytes[0:clen(bytes[:])]) name := string(bytes[0:clen(bytes[:])])
if name == "." || name == ".." { // Useless names if name == "." || name == ".." { // Useless names
continue continue
} }

View File

@ -1,9 +1,7 @@
package system // import "github.com/docker/docker/pkg/system" package system // import "github.com/docker/docker/pkg/system"
var ( // containerdRuntimeSupported determines if containerd should be the runtime.
// containerdRuntimeSupported determines if containerd should be the runtime. var containerdRuntimeSupported = false
containerdRuntimeSupported = false
)
// InitContainerdRuntime sets whether to use containerd for runtime on Windows. // InitContainerdRuntime sets whether to use containerd for runtime on Windows.
func InitContainerdRuntime(cdPath string) { func InitContainerdRuntime(cdPath string) {

View File

@ -1,11 +0,0 @@
package system // import "github.com/docker/docker/pkg/system"
// Mknod is not implemented on Windows.
func Mknod(path string, mode uint32, dev int) error {
return ErrNotSupportedPlatform
}
// Mkdev is not implemented on Windows.
func Mkdev(major int64, minor int64) uint32 {
panic("Mkdev not implemented on Windows.")
}

View File

@ -6,10 +6,12 @@ import "syscall"
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type // fromStatT converts a syscall.Stat_t type to a system.Stat_t type
func fromStatT(s *syscall.Stat_t) (*StatT, error) { func fromStatT(s *syscall.Stat_t) (*StatT, error) {
return &StatT{size: s.Size, return &StatT{
size: s.Size,
mode: uint32(s.Mode), mode: uint32(s.Mode),
uid: s.Uid, uid: s.Uid,
gid: s.Gid, gid: s.Gid,
rdev: uint64(s.Rdev), rdev: uint64(s.Rdev),
mtim: s.Mtimespec}, nil mtim: s.Mtimespec,
}, nil
} }

View File

@ -4,10 +4,12 @@ import "syscall"
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type // fromStatT converts a syscall.Stat_t type to a system.Stat_t type
func fromStatT(s *syscall.Stat_t) (*StatT, error) { func fromStatT(s *syscall.Stat_t) (*StatT, error) {
return &StatT{size: s.Size, return &StatT{
size: s.Size,
mode: uint32(s.Mode), mode: uint32(s.Mode),
uid: s.Uid, uid: s.Uid,
gid: s.Gid, gid: s.Gid,
rdev: uint64(s.Rdev), rdev: uint64(s.Rdev),
mtim: s.Mtimespec}, nil mtim: s.Mtimespec,
}, nil
} }

View File

@ -4,13 +4,15 @@ import "syscall"
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type // fromStatT converts a syscall.Stat_t type to a system.Stat_t type
func fromStatT(s *syscall.Stat_t) (*StatT, error) { func fromStatT(s *syscall.Stat_t) (*StatT, error) {
return &StatT{size: s.Size, return &StatT{
size: s.Size,
mode: s.Mode, mode: s.Mode,
uid: s.Uid, uid: s.Uid,
gid: s.Gid, gid: s.Gid,
// the type is 32bit on mips // the type is 32bit on mips
rdev: uint64(s.Rdev), //nolint: unconvert rdev: uint64(s.Rdev), //nolint: unconvert
mtim: s.Mtim}, nil mtim: s.Mtim,
}, nil
} }
// FromStatT converts a syscall.Stat_t type to a system.Stat_t type // FromStatT converts a syscall.Stat_t type to a system.Stat_t type

View File

@ -4,10 +4,12 @@ import "syscall"
// fromStatT converts a syscall.Stat_t type to a system.Stat_t type // fromStatT converts a syscall.Stat_t type to a system.Stat_t type
func fromStatT(s *syscall.Stat_t) (*StatT, error) { func fromStatT(s *syscall.Stat_t) (*StatT, error) {
return &StatT{size: s.Size, return &StatT{
size: s.Size,
mode: uint32(s.Mode), mode: uint32(s.Mode),
uid: s.Uid, uid: s.Uid,
gid: s.Gid, gid: s.Gid,
rdev: uint64(s.Rdev), rdev: uint64(s.Rdev),
mtim: s.Mtim}, nil mtim: s.Mtim,
}, nil
} }

View File

@ -45,5 +45,6 @@ func fromStatT(fi *os.FileInfo) (*StatT, error) {
return &StatT{ return &StatT{
size: (*fi).Size(), size: (*fi).Size(),
mode: (*fi).Mode(), mode: (*fi).Mode(),
mtim: (*fi).ModTime()}, nil mtim: (*fi).ModTime(),
}, nil
} }

View File

@ -54,7 +54,7 @@ func (s *Service) ReplaceConfig(options ServiceOptions) (commit func(), err erro
// It can be used to verify the validity of a client's credentials. // It can be used to verify the validity of a client's credentials.
func (s *Service) Auth(ctx context.Context, authConfig *registry.AuthConfig, userAgent string) (status, token string, err error) { func (s *Service) Auth(ctx context.Context, authConfig *registry.AuthConfig, userAgent string) (status, token string, err error) {
// TODO Use ctx when searching for repositories // TODO Use ctx when searching for repositories
var registryHostName = IndexHostname registryHostName := IndexHostname
if authConfig.ServerAddress != "" { if authConfig.ServerAddress != "" {
serverAddress := authConfig.ServerAddress serverAddress := authConfig.ServerAddress

2
vendor/modules.txt vendored
View File

@ -43,7 +43,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 v24.0.0-rc.2.0.20230627140857-7f8b1cd7f928+incompatible # github.com/docker/docker v24.0.0-rc.2.0.20230706181717-98d3da79ef9c+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