vendor: github.com/containerd/nydus-snapshotter v0.15.2

full diff: https://github.com/containerd/nydus-snapshotter/compare/v0.15.0...v0.15.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-06-12 13:38:15 +02:00
parent 9a85f50aaa
commit cf86f3a082
4 changed files with 11 additions and 38 deletions

View File

@@ -150,7 +150,7 @@ require (
github.com/containerd/console v1.0.5 // indirect
github.com/containerd/go-cni v1.1.12 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/nydus-snapshotter v0.15.0 // indirect
github.com/containerd/nydus-snapshotter v0.15.2 // indirect
github.com/containerd/plugin v1.0.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
github.com/containerd/ttrpc v1.2.7 // indirect

View File

@@ -143,8 +143,8 @@ github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gG
github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/nydus-snapshotter v0.15.0 h1:RqZRs1GPeM6T3wmuxJV9u+2Rg4YETVMwTmiDeX+iWC8=
github.com/containerd/nydus-snapshotter v0.15.0/go.mod h1:biq0ijpeZe0I5yZFSJyHzFSjjRZQ7P7y/OuHyd7hYOw=
github.com/containerd/nydus-snapshotter v0.15.2 h1:qsHI4M+Wwrf6Jr4eBqhNx8qh+YU0dSiJ+WPmcLFWNcg=
github.com/containerd/nydus-snapshotter v0.15.2/go.mod h1:FfwH2KBkNYoisK/e+KsmNr7xTU53DmnavQHMFOcXwfM=
github.com/containerd/platforms v1.0.0-rc.1 h1:83KIq4yy1erSRgOVHNk1HYdPvzdJ5CnsWaRoJX4C41E=
github.com/containerd/platforms v1.0.0-rc.1/go.mod h1:J71L7B+aiM5SdIEqmd9wp6THLVRzJGXfNuWCZCllLA4=
github.com/containerd/plugin v1.0.0 h1:c8Kf1TNl6+e2TtMHZt+39yAPDbouRH9WAToRjex483Y=

View File

@@ -913,7 +913,7 @@ func ConvertHookFunc(opt MergeOption) converter.ConvertHookFunc {
}
switch {
case images.IsIndexType(newDesc.MediaType):
return convertIndex(ctx, cs, orgDesc, newDesc)
return convertIndex(ctx, cs, newDesc)
case images.IsManifestType(newDesc.MediaType):
return convertManifest(ctx, cs, orgDesc, newDesc, opt)
default:
@@ -922,49 +922,20 @@ func ConvertHookFunc(opt MergeOption) converter.ConvertHookFunc {
}
}
// convertIndex modifies the original index by appending "nydus.remoteimage.v1"
// to the Platform.OSFeatures of each modified manifest descriptors.
func convertIndex(ctx context.Context, cs content.Store, orgDesc ocispec.Descriptor, newDesc *ocispec.Descriptor) (*ocispec.Descriptor, error) {
var orgIndex ocispec.Index
if _, err := readJSON(ctx, cs, &orgIndex, orgDesc); err != nil {
return nil, errors.Wrap(err, "read target image index json")
}
// isManifestModified is a function to check whether the manifest is modified.
isManifestModified := func(manifest ocispec.Descriptor) bool {
for _, oldManifest := range orgIndex.Manifests {
if manifest.Digest == oldManifest.Digest {
return false
}
}
return true
}
// convertIndex modifies the original index converting it to manifest directly if it contains only one manifest.
func convertIndex(ctx context.Context, cs content.Store, newDesc *ocispec.Descriptor) (*ocispec.Descriptor, error) {
var index ocispec.Index
indexLabels, err := readJSON(ctx, cs, &index, *newDesc)
_, err := readJSON(ctx, cs, &index, *newDesc)
if err != nil {
return nil, errors.Wrap(err, "read index json")
}
for i, manifest := range index.Manifests {
if !isManifestModified(manifest) {
// Skip the manifest which is not modified.
continue
}
manifest.Platform.OSFeatures = append(manifest.Platform.OSFeatures, ManifestOSFeatureNydus)
index.Manifests[i] = manifest
}
// If the converted manifest list contains only one manifest,
// convert it directly to manifest.
if len(index.Manifests) == 1 {
return &index.Manifests[0], nil
}
// Update image index in content store.
newIndexDesc, err := writeJSON(ctx, cs, index, *newDesc, indexLabels)
if err != nil {
return nil, errors.Wrap(err, "write index json")
}
return newIndexDesc, nil
return newDesc, nil
}
// convertManifest merges all the nydus blob layers into a
@@ -1054,6 +1025,8 @@ func convertManifest(ctx context.Context, cs content.Store, oldDesc ocispec.Desc
// See the `subject` field description in
// https://github.com/opencontainers/image-spec/blob/main/manifest.md#image-manifest-property-descriptions
manifest.Subject = &oldDesc
// Remove the platform field as it is not supported by certain registries like ECR.
manifest.Subject.Platform = nil
}
// Update image manifest in content store.

2
vendor/modules.txt vendored
View File

@@ -436,7 +436,7 @@ github.com/containerd/go-runc
## explicit; go 1.20
github.com/containerd/log
github.com/containerd/log/logtest
# github.com/containerd/nydus-snapshotter v0.15.0
# github.com/containerd/nydus-snapshotter v0.15.2
## explicit; go 1.22.0
github.com/containerd/nydus-snapshotter/pkg/converter
github.com/containerd/nydus-snapshotter/pkg/converter/tool