From a408d8c715bce94ceff5e2ef77fc4b3a45d27b97 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:09:42 +0100 Subject: [PATCH] push empty descriptor layer when using OCI version 1.1 for Compose artifact it fixes a repository creation issue when pushing the 1st time a Compose OCI artifact on the Hub Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- internal/ocipush/push.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ocipush/push.go b/internal/ocipush/push.go index 0296f67da46..20615056910 100644 --- a/internal/ocipush/push.go +++ b/internal/ocipush/push.go @@ -88,6 +88,10 @@ func PushManifest( layers []Pushable, ociVersion api.OCIVersion, ) error { + // Check if we need an extra empty layer for the manifest config + if ociVersion == api.OCIVersion1_1 || ociVersion == "" { + layers = append(layers, Pushable{Descriptor: v1.DescriptorEmptyJSON, Data: []byte("{}")}) + } // prepare to push the manifest by pushing the layers layerDescriptors := make([]v1.Descriptor, len(layers)) for i := range layers {