diff --git a/vendor.mod b/vendor.mod index e9bfd38628..634170b536 100644 --- a/vendor.mod +++ b/vendor.mod @@ -14,7 +14,7 @@ require ( github.com/distribution/reference v0.6.0 github.com/docker/cli-docs-tool v0.9.0 github.com/docker/distribution v2.8.3+incompatible - github.com/docker/docker v28.1.2-0.20250512131816-cb38cc0fdd55+incompatible // master, v28.x dev + github.com/docker/docker v28.1.2-0.20250515215111-fd1a78e0a388+incompatible // master, v28.x dev github.com/docker/docker-credential-helpers v0.9.3 github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 diff --git a/vendor.sum b/vendor.sum index ab20018b54..a490d32070 100644 --- a/vendor.sum +++ b/vendor.sum @@ -53,8 +53,8 @@ github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3T 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/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v28.1.2-0.20250512131816-cb38cc0fdd55+incompatible h1:O65IbOqdNmZ8B9YyHAzKscG9XuQkzPFD2SX/JhCHkBk= -github.com/docker/docker v28.1.2-0.20250512131816-cb38cc0fdd55+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.1.2-0.20250515215111-fd1a78e0a388+incompatible h1:t6fp4pyFO9bUagzR2mxee6JdTAv5SJmqwMGUlllS7Hc= +github.com/docker/docker v28.1.2-0.20250515215111-fd1a78e0a388+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= diff --git a/vendor/github.com/docker/docker/api/types/container/container.go b/vendor/github.com/docker/docker/api/types/container/container.go index 65fabbf425..a191ca8bdb 100644 --- a/vendor/github.com/docker/docker/api/types/container/container.go +++ b/vendor/github.com/docker/docker/api/types/container/container.go @@ -104,7 +104,7 @@ type MountPoint struct { // State stores container's running state // it's part of ContainerJSONBase and returned by "inspect" command type State struct { - Status string // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead" + Status ContainerState // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead" Running bool Paused bool Restarting bool @@ -132,7 +132,7 @@ type Summary struct { SizeRw int64 `json:",omitempty"` SizeRootFs int64 `json:",omitempty"` Labels map[string]string - State string + State ContainerState Status string HostConfig struct { NetworkMode string `json:",omitempty"` diff --git a/vendor/github.com/docker/docker/api/types/container/state.go b/vendor/github.com/docker/docker/api/types/container/state.go index e5b0ecb3f5..78d5c4fe85 100644 --- a/vendor/github.com/docker/docker/api/types/container/state.go +++ b/vendor/github.com/docker/docker/api/types/container/state.go @@ -1,5 +1,40 @@ package container +import ( + "fmt" + "strings" +) + +// ContainerState is a string representation of the container's current state. +// +// It currently is an alias for string, but may become a distinct type in the future. +type ContainerState = string + +const ( + StateCreated ContainerState = "created" // StateCreated indicates the container is created, but not (yet) started. + StateRunning ContainerState = "running" // StateRunning indicates that the container is running. + StatePaused ContainerState = "paused" // StatePaused indicates that the container's current state is paused. + StateRestarting ContainerState = "restarting" // StateRestarting indicates that the container is currently restarting. + StateRemoving ContainerState = "removing" // StateRemoving indicates that the container is being removed. + StateExited ContainerState = "exited" // StateExited indicates that the container exited. + StateDead ContainerState = "dead" // StateDead indicates that the container failed to be deleted. Containers in this state are attempted to be cleaned up when the daemon restarts. +) + +var validStates = []ContainerState{ + StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead, +} + +// ValidateContainerState checks if the provided string is a valid +// container [ContainerState]. +func ValidateContainerState(s ContainerState) error { + switch s { + case StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead: + return nil + default: + return errInvalidParameter{error: fmt.Errorf("invalid value for state (%s): must be one of %s", s, strings.Join(validStates, ", "))} + } +} + // StateStatus is used to return container wait results. // Implements exec.ExitCode interface. // This type is needed as State include a sync.Mutex field which make diff --git a/vendor/github.com/docker/docker/client/request.go b/vendor/github.com/docker/docker/client/request.go index 4cc64350bd..dd95653a79 100644 --- a/vendor/github.com/docker/docker/client/request.go +++ b/vendor/github.com/docker/docker/client/request.go @@ -195,7 +195,7 @@ func (cli *Client) checkResponseErr(serverResp *http.Response) (retErr error) { if serverResp == nil { return nil } - if serverResp.StatusCode >= 200 && serverResp.StatusCode < 400 { + if serverResp.StatusCode >= http.StatusOK && serverResp.StatusCode < http.StatusBadRequest { return nil } defer func() { diff --git a/vendor/github.com/docker/docker/errdefs/http_helpers.go b/vendor/github.com/docker/docker/errdefs/http_helpers.go index 0a8fadd48f..53c18f2fe0 100644 --- a/vendor/github.com/docker/docker/errdefs/http_helpers.go +++ b/vendor/github.com/docker/docker/errdefs/http_helpers.go @@ -33,12 +33,12 @@ func FromStatusCode(err error, statusCode int) error { return System(err) default: switch { - case statusCode >= 200 && statusCode < 400: + case statusCode >= http.StatusOK && statusCode < http.StatusBadRequest: // it's a client error return err - case statusCode >= 400 && statusCode < 500: + case statusCode >= http.StatusBadRequest && statusCode < http.StatusInternalServerError: return InvalidParameter(err) - case statusCode >= 500 && statusCode < 600: + case statusCode >= http.StatusInternalServerError && statusCode < 600: return System(err) default: return Unknown(err) diff --git a/vendor/modules.txt b/vendor/modules.txt index 396fc2a6cd..d7bb651897 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -58,7 +58,7 @@ github.com/docker/distribution/registry/client/transport github.com/docker/distribution/registry/storage/cache github.com/docker/distribution/registry/storage/cache/memory github.com/docker/distribution/uuid -# github.com/docker/docker v28.1.2-0.20250512131816-cb38cc0fdd55+incompatible +# github.com/docker/docker v28.1.2-0.20250515215111-fd1a78e0a388+incompatible ## explicit github.com/docker/docker/api github.com/docker/docker/api/types