Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align with OCI artifact best practices #11120

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/compose/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"context"
"encoding/json"
"os"
"path/filepath"
"time"

"github.com/compose-spec/compose-go/types"
"github.com/distribution/reference"
Expand Down Expand Up @@ -67,11 +69,12 @@
Status: progress.Working,
})
layer := v1.Descriptor{
MediaType: "application/vnd.docker.compose.file+yaml",
MediaType: v1.MediaTypeImageLayer,

Check warning on line 72 in pkg/compose/publish.go

View check run for this annotation

Codecov / codecov/patch

pkg/compose/publish.go#L72

Added line #L72 was not covered by tests
Digest: digest.FromString(string(f)),
Size: int64(len(f)),
Annotations: map[string]string{
"com.docker.compose.version": api.ComposeVersion,
"com.docker.compose.file": filepath.Base(file),

Check warning on line 77 in pkg/compose/publish.go

View check run for this annotation

Codecov / codecov/patch

pkg/compose/publish.go#L77

Added line #L77 was not covered by tests
},
}
layers = append(layers, layer)
Expand Down Expand Up @@ -114,6 +117,9 @@
ArtifactType: "application/vnd.docker.compose.project",
Config: configDescriptor,
Layers: layers,
Annotations: map[string]string{
"org.opencontainers.image.created": time.Now().Format(time.RFC3339),
},

Check warning on line 122 in pkg/compose/publish.go

View check run for this annotation

Codecov / codecov/patch

pkg/compose/publish.go#L120-L122

Added lines #L120 - L122 were not covered by tests
})
if err != nil {
return err
Expand Down