From 746f59868a714525976305f0976456bc680f7831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Thu, 18 Jul 2024 13:57:40 +0200 Subject: [PATCH] vendor: PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- vendor.mod | 4 + vendor.sum | 4 +- vendor/github.com/docker/docker/api/common.go | 2 +- .../github.com/docker/docker/api/swagger.yaml | 84 +++++++++++++++++++ .../docker/docker/api/types/image/manifest.go | 73 ++++++++++++++++ .../docker/docker/api/types/image/opts.go | 3 + .../docker/docker/api/types/image/summary.go | 14 ++-- .../docker/docker/client/image_list.go | 13 +++ vendor/modules.txt | 3 +- 9 files changed, 191 insertions(+), 9 deletions(-) create mode 100644 vendor/github.com/docker/docker/api/types/image/manifest.go diff --git a/vendor.mod b/vendor.mod index d9c302fbb15c..82815f34eada 100644 --- a/vendor.mod +++ b/vendor.mod @@ -6,6 +6,10 @@ module github.com/docker/cli go 1.21.0 +replace github.com/docker/docker => github.com/vvoland/moby v20.10.16-0.20240718121800-6c429bba16a6+incompatible + +//replace github.com/docker/docker => github.com/vvoland/moby c8d-list-multiplatform + require ( dario.cat/mergo v1.0.0 github.com/containerd/platforms v0.2.1 diff --git a/vendor.sum b/vendor.sum index a8fc2ae24c66..943474f7942a 100644 --- a/vendor.sum +++ b/vendor.sum @@ -59,8 +59,6 @@ github.com/docker/cli-docs-tool v0.8.0/go.mod h1:8TQQ3E7mOXoYUs811LiPdUnAhXrcVsB 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 v27.0.2-0.20240715215214-aae044039ca4+incompatible h1:OJJ+48ACIraFECLY+qp2Zi5kkr6J8vXm2bzIJqgsS9A= -github.com/docker/docker v27.0.2-0.20240715215214-aae044039ca4+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/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= @@ -274,6 +272,8 @@ github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a h1:tlJ github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a/go.mod h1:Y94A6rPp2OwNfP/7vmf8O2xx2IykP8pPXQ1DLouGnEw= github.com/tonistiigi/go-rosetta v0.0.0-20200727161949-f79598599c5d h1:wvQZpqy8p0D/FUia6ipKDhXrzPzBVJE4PZyPc5+5Ay0= github.com/tonistiigi/go-rosetta v0.0.0-20200727161949-f79598599c5d/go.mod h1:xKQhd7snlzKFuUi1taTGWjpRE8iFTA06DeacYi3CVFQ= +github.com/vvoland/moby v20.10.16-0.20240718121800-6c429bba16a6+incompatible h1:CT1+xdO/OMA2acK0e6+r7UTPvSZgqOmfNWKgruRXutU= +github.com/vvoland/moby v20.10.16-0.20240718121800-6c429bba16a6+incompatible/go.mod h1:nLN96xVmxZq8CPEl0UgxMpO/G2e8MQtjhAdlRDUdBi0= github.com/weppos/publicsuffix-go v0.15.1-0.20210511084619-b1f36a2d6c0b h1:FsyNrX12e5BkplJq7wKOLk0+C6LZ+KGXvuEcKUYm5ss= github.com/weppos/publicsuffix-go v0.15.1-0.20210511084619-b1f36a2d6c0b/go.mod h1:HYux0V0Zi04bHNwOHy4cXJVz/TQjYonnF6aoYhj+3QE= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/vendor/github.com/docker/docker/api/common.go b/vendor/github.com/docker/docker/api/common.go index f831735f840e..93d64cd8d5ff 100644 --- a/vendor/github.com/docker/docker/api/common.go +++ b/vendor/github.com/docker/docker/api/common.go @@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api" // Common constants for daemon and client. const ( // DefaultVersion of the current REST API. - DefaultVersion = "1.46" + DefaultVersion = "1.47" // MinSupportedAPIVersion is the minimum API version that can be supported // by the API server, specified as "major.minor". Note that the daemon diff --git a/vendor/github.com/docker/docker/api/swagger.yaml b/vendor/github.com/docker/docker/api/swagger.yaml index 802ed8ba3fbc..27585a27f59a 100644 --- a/vendor/github.com/docker/docker/api/swagger.yaml +++ b/vendor/github.com/docker/docker/api/swagger.yaml @@ -2265,6 +2265,19 @@ definitions: x-nullable: false type: "integer" example: 2 + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" AuthConfig: type: "object" @@ -6644,6 +6657,77 @@ definitions: additionalProperties: type: "string" + ImageManifestSummary: + x-nullable: false + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["Id", "Descriptor", "Available", "ContentSize", "Kind"] + properties: + Id: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is available. + type: "boolean" + example: true + ContentSize: + description: | + The size of the available distributable (possibly compressed) image content + in bytes. + type: "integer" + format: "int64" + example: 3987495 + Kind: + description: | + The kind of the manifest. + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + UnpackedSize: + description: | + The size of the unpacked and uncompressed image content (needed for + the image to be useable by containers) in bytes. + type: "integer" + format: "int64" + example: 3987495 + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + paths: /containers/json: get: diff --git a/vendor/github.com/docker/docker/api/types/image/manifest.go b/vendor/github.com/docker/docker/api/types/image/manifest.go new file mode 100644 index 000000000000..d8ec69d4dfe6 --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/image/manifest.go @@ -0,0 +1,73 @@ +package image + +import ( + "github.com/opencontainers/go-digest" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +type ImageManifestKind string + +const ( + ImageManifestKindImage ImageManifestKind = "image" + ImageManifestKindAttestation ImageManifestKind = "attestation" + ImageManifestKindUnknown ImageManifestKind = "unknown" +) + +type ImageManifestSummary struct { + // ID is the content-addressable ID of an image and is the same as the + // digest of the image manifest. + // + // Required: true + ID string `json:"Id"` + + // Descriptor is the OCI descriptor of the image. + // + // Required: true + Descriptor ocispec.Descriptor `json:"Descriptor"` + + // Indicates whether all the child content (image config, layers) is available. + // + // Required: true + Available bool `json:"Available"` + + // ContentSize is the size of all the locally available distributable content size. + // + // Required: true + ContentSize int64 `json:"ContentSize"` + + // Kind is the kind of the image manifest. + // + // Required: true + Kind ImageManifestKind `json:"Kind"` + + // Fields below are specific to the kind of the image manifest. + + // Present only if Kind == ImageManifestKindImage. + ImageData ImageProperties `json:"ImageData,omitempty"` + + // Present only if Kind == ImageManifestKindAttestation. + AttestationData AttestationProperties `json:"AttestationData,omitempty"` +} + +type ImageProperties struct { + // Platform is the OCI platform object describing the platform of + // + // Required: true + Platform ocispec.Platform `json:"Platform"` + + // UnpackedSize is the size of the image when unpacked. + // + // Required: true + UnpackedSize int64 `json:"UnpackedSize"` + + // Containers is an array containing the IDs of the containers that are + // using this image. + // + // Required: true + Containers []string `json:"Containers"` +} + +type AttestationProperties struct { + // For is the digest of the image manifest that this attestation is for. + For digest.Digest `json:"For"` +} diff --git a/vendor/github.com/docker/docker/api/types/image/opts.go b/vendor/github.com/docker/docker/api/types/image/opts.go index 8e32c9af8689..923ebe5a06a0 100644 --- a/vendor/github.com/docker/docker/api/types/image/opts.go +++ b/vendor/github.com/docker/docker/api/types/image/opts.go @@ -76,6 +76,9 @@ type ListOptions struct { // ContainerCount indicates whether container count should be computed. ContainerCount bool + + // Manifests indicates whether the image manifests should be returned. + Manifests bool } // RemoveOptions holds parameters to remove images. diff --git a/vendor/github.com/docker/docker/api/types/image/summary.go b/vendor/github.com/docker/docker/api/types/image/summary.go index f1e3e2ef018f..3515ede78622 100644 --- a/vendor/github.com/docker/docker/api/types/image/summary.go +++ b/vendor/github.com/docker/docker/api/types/image/summary.go @@ -1,10 +1,5 @@ package image -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Summary summary -// swagger:model Summary type Summary struct { // Number of containers using this image. Includes both stopped and running @@ -47,6 +42,15 @@ type Summary struct { // Required: true ParentID string `json:"ParentId"` + // Manifests is a list of image manifests available in this image. It + // provides a more detailed view of the platform-specific image manifests or + // other image-attached data like build attestations. + // + // WARNING: This is experimental and may change at any time without any backward + // compatibility. + // + Manifests []ImageManifestSummary `json:"Manifests,omitempty"` + // List of content-addressable digests of locally available image manifests // that the image is referenced from. Multiple manifests can refer to the // same image. diff --git a/vendor/github.com/docker/docker/client/image_list.go b/vendor/github.com/docker/docker/client/image_list.go index a9cc1e21e5dd..908eb9e1b060 100644 --- a/vendor/github.com/docker/docker/client/image_list.go +++ b/vendor/github.com/docker/docker/client/image_list.go @@ -10,7 +10,14 @@ import ( "github.com/docker/docker/api/types/versions" ) +// ImageListWithManifests returns a list of images including the manifests information. + // ImageList returns a list of images in the docker host. +// +// Experimental: Setting the [options.Manifest] will populate +// [image.Summary.Manifests] with information about image manifests. +// This is experimental and might change in the future without any backward +// compatibility. func (cli *Client) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { var images []image.Summary @@ -47,6 +54,12 @@ func (cli *Client) ImageList(ctx context.Context, options image.ListOptions) ([] if options.SharedSize && versions.GreaterThanOrEqualTo(cli.version, "1.42") { query.Set("shared-size", "1") } + if options.Manifests { + if err := cli.NewVersionError(ctx, "1.47", "list manifests"); err != nil { + return nil, err + } + query.Set("manifests", "1") + } serverResp, err := cli.get(ctx, "/images/json", query, nil) defer ensureReaderClosed(serverResp) diff --git a/vendor/modules.txt b/vendor/modules.txt index 47d64bf1123e..465b66a989c1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,7 +56,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 v27.0.2-0.20240715215214-aae044039ca4+incompatible +# github.com/docker/docker v27.0.2-0.20240715215214-aae044039ca4+incompatible => github.com/vvoland/moby v20.10.16-0.20240718121800-6c429bba16a6+incompatible ## explicit github.com/docker/docker/api github.com/docker/docker/api/types @@ -519,3 +519,4 @@ gotest.tools/v3/skip # tags.cncf.io/container-device-interface v0.7.2 ## explicit; go 1.20 tags.cncf.io/container-device-interface/pkg/parser +# github.com/docker/docker => github.com/vvoland/moby v20.10.16-0.20240718121800-6c429bba16a6+incompatible