New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c8d: Multi-platform image list #47526
base: master
Are you sure you want to change the base?
Conversation
9d68e75
to
3507b41
Compare
fc27649
to
f7c6a83
Compare
compatibility. | ||
type: "array" | ||
x-nullable: false | ||
x-omitempty: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm CI fails with:
diff --git a/api/types/image/summary.go b/api/types/image/summary.go
index 4ebbdeadf7..fed2746521 100644
--- a/api/types/image/summary.go
+++ b/api/types/image/summary.go
@@ -54,7 +54,7 @@ type Summary struct {
// WARNING: This is experimental and may change at any time without any backward
// compatibility.
//
- PlatformImages []PlatformImage `json:"PlatformImages,omitempty"`
+ PlatformImages []PlatformImage `json:"PlatformImages"`
// List of content-addressable digests of locally available image manifests
// that the image is referenced from. Multiple manifests can refer to the
Please update api/swagger.yaml with any API changes, then
run hack/generate-swagger-api.sh.
Even though I marked this one with x-omitempty
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's an issue with the outdated go-swagger, see #47827 for update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabled swagger model generation for this struct: 5eb892a
f7c6a83
to
ea31ce0
Compare
7a67112
to
5eb892a
Compare
moby/api/types/image/summary.go Lines 50 to 58 in 5eb892a
Thinking about it a bit more, I think we might want to expose all manifests details, not only the platform-specific images, so we can also provide information about build attestations (and possibly other things in future). // 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"` type ImageManifestKind string
const (
ImageManifestKindImage ImageManifestKind = "image"
ImageManifestKindAttestation ImageManifestKind = "attestation"
ImageManifestKindUnknown ImageManifestKind = "unknown"
)
type ImageManifestSummary struct {
ID string `json:"Id"`
Descriptor ocispec.Descriptor `json:"Descriptor"`
Available bool `json:"Available"`
ContentSize int64 `json:"ContentSize"`
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 ocispec.Platform `json:"Platform"`
UnpackedSize int64 `json:"UnpackedSize"`
Containers int64 `json:"Containers"`
}
type AttestationProperties struct {
// For - the digest of the image manifest that this attestation is for.
For digest.Digest `json:"For"`
} This would also leave the gate open for adding any other manifests types in future. WDYT? |
This adds the common helper functions used by the recent multiplatform-related PRs. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Add the PlatformImages field to `ImageSummary` which describes each platform-specific manifest in that image. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Our version of go-swagger doesn't handle the `omitempty` correctly for the new field. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Instead of exposing platform-specific manifests, expose all image manifests (to also include other blobs using the image media type, like buildkit attestations). Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
5eb892a
to
1db8418
Compare
Add the
PlatformImages
field toImageSummary
.The original proposal was to enhance
ImageSummary
withPlatform ocispec.Platform
andImages []ImageSummary
fields, but IMO having a separate type gives us more flexibility.CLI initial implementation: docker/cli#4982
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)