Skip to content

Commit d66f72d

Browse files
committed
[nydus] Remove old config's reference in config descriptor's annotations when adding empty layer
Trying to push a manifest with an added empty layer to ECR currently fails because the manifest's config descriptor has an annotation field with a referrence to the old config digest. The failure is ` Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'`. This field should be accepted by ECR because it's present in the spec but since there is no hard need to keep it as an annotation on the config descriptor, this commit remove the annotation entirely since the original config can still be discovered by finding the original OCI manifest using the digest stored in the new manifest annotations. Signed-off-by: Baptiste Girard-Carrabin <baptiste.girardcarrabin@datadoghq.com>
1 parent e62d1e0 commit d66f72d

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

pkg/driver/nydus/nydus.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,6 @@ func PrependEmptyLayer(ctx context.Context, cs content.Store, manifestDesc ocisp
515515
if err != nil {
516516
return ocispec.Descriptor{}, errors.Wrap(err, "marshal modified config")
517517
}
518-
if newConfigDesc.Annotations == nil {
519-
newConfigDesc.Annotations = map[string]string{}
520-
}
521-
newConfigDesc.Annotations[annotationSourceDigest] = manifest.Config.Digest.String()
522518

523519
manifest.Config = *newConfigDesc
524520
newManifestDesc, newManifestBytes, err := nydusutils.MarshalToDesc(manifest, manifest.MediaType)

0 commit comments

Comments
 (0)