Skip to content

Commit

Permalink
Merge pull request #1077 from sajayantony/index-artifacts
Browse files Browse the repository at this point in the history
image-index: add artifactType to specs and schema
  • Loading branch information
jonjohnsonjr committed Jun 22, 2023
2 parents 9708013 + a845c7a commit 5d7ba05
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schema/image-index-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"description": "the mediatype of the referenced object",
"$ref": "defs-descriptor.json#/definitions/mediaType"
},
"artifactType": {
"description": "the artifact mediatype of the referenced object",
"$ref": "defs-descriptor.json#/definitions/mediaType"
},
"subject": {
"$ref": "content-descriptor.json"
},
Expand Down
25 changes: 25 additions & 0 deletions schema/imageindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,31 @@ func TestImageIndex(t *testing.T) {
}
]
}
`,
fail: false,
},

// valid image index with artifactType and manifests
{
imageIndex: `
{
"schemaVersion": 2,
"mediaType" : "application/vnd.oci.image.index.v1+json",
"artifactType": "application/vnd.example+type",
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 7143,
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270"
},
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"artifactType": "application/vnd.example1+type",
"size": 506,
"digest": "sha256:99953afc4b90c7d78079d189ae10da0a1002e6be5e9e8dedaf9f7f29def42111"
}
]
}
`,
fail: false,
},
Expand Down
3 changes: 3 additions & 0 deletions specs-go/v1/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type Index struct {
// MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json`
MediaType string `json:"mediaType,omitempty"`

// ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.
ArtifactType string `json:"artifactType,omitempty"`

// Manifests references platform specific manifests.
Manifests []Descriptor `json:"manifests"`

Expand Down

0 comments on commit 5d7ba05

Please sign in to comment.