Skip to content

Commit

Permalink
push empty descriptor layer when using OCI version 1.1 for Compose ar…
Browse files Browse the repository at this point in the history
…tifact

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]>
  • Loading branch information
glours committed Nov 13, 2024
1 parent 2bb67f2 commit 3f5898f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ocipush/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3f5898f

Please sign in to comment.