Skip to content

Commit f4cb724

Browse files
authored
Merge pull request #3092 from mmorhun/fix-config-mediatype
Fix mediaType in config for track bundle
2 parents f4b357b + 980ede8 commit f4cb724

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

acceptance/image/image.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const (
7272
)
7373

7474
const (
75-
unknownConfig = "application/vnd.unknown.config.v1+json"
7675
openPolicyAgentData = "application/vnd.cncf.openpolicyagent.data.layer.v1+json"
7776
title = "org.opencontainers.image.title"
7877
)
@@ -856,7 +855,7 @@ func createAndPushKeylessImage(ctx context.Context, imageName string) (context.C
856855
// layers
857856
func createAndPushPolicyBundle(ctx context.Context, imageName string, files *godog.Table) (context.Context, error) {
858857
bundle := mutate.MediaType(empty.Image, types.OCIManifestSchema1)
859-
bundle = mutate.ConfigMediaType(bundle, unknownConfig)
858+
bundle = mutate.ConfigMediaType(bundle, types.OCIConfigJSON)
860859

861860
// add each row as a layer to the bundle
862861
for _, row := range files.Rows {

internal/tracker/oci.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
)
3434

3535
const (
36-
unknownConfig = "application/vnd.unknown.config.v1+json"
3736
openPolicyAgentData = "application/vnd.cncf.openpolicyagent.data.layer.v1+json"
3837
title = "org.opencontainers.image.title"
3938
dataFileTitle = "data/data/trusted_tekton_tasks.yml"
@@ -117,7 +116,7 @@ func PushImage(ctx context.Context, imageRef string, data []byte, invocation str
117116
}
118117

119118
bundle := mutate.MediaType(empty.Image, types.OCIManifestSchema1)
120-
bundle = mutate.ConfigMediaType(bundle, unknownConfig)
119+
bundle = mutate.ConfigMediaType(bundle, types.OCIConfigJSON)
121120
if bundle, err = mutate.Append(bundle, mutate.Addendum{
122121
History: v1.History{
123122
CreatedBy: invocation,

internal/tracker/oci_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func TestPullImage(t *testing.T) {
117117
yaml := []byte("data: blah")
118118

119119
img := mutate.MediaType(empty.Image, types.OCIManifestSchema1)
120-
img = mutate.ConfigMediaType(img, unknownConfig)
120+
img = mutate.ConfigMediaType(img, types.OCIConfigJSON)
121121
img, err := mutate.Append(img, mutate.Addendum{
122122
MediaType: openPolicyAgentData,
123123
Layer: static.NewLayer(yaml, openPolicyAgentData),

0 commit comments

Comments
 (0)