Skip to content

Commit a408d8c

Browse files
committed
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 <[email protected]>
1 parent 2bb67f2 commit a408d8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/ocipush/push.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ func PushManifest(
8888
layers []Pushable,
8989
ociVersion api.OCIVersion,
9090
) error {
91+
// Check if we need an extra empty layer for the manifest config
92+
if ociVersion == api.OCIVersion1_1 || ociVersion == "" {
93+
layers = append(layers, Pushable{Descriptor: v1.DescriptorEmptyJSON, Data: []byte("{}")})
94+
}
9195
// prepare to push the manifest by pushing the layers
9296
layerDescriptors := make([]v1.Descriptor, len(layers))
9397
for i := range layers {

0 commit comments

Comments
 (0)