Skip to content

Commit 28c2ba0

Browse files
authored
Merge pull request #181 from fibonacci1729/subject
Add subject to OciImageManifest
2 parents f749169 + 3a7131d commit 28c2ba0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/errors.rs

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ pub enum OciErrorCode {
191191
NameInvalid,
192192
/// Repository name is not known
193193
NameUnknown,
194+
/// Manifest is not found
195+
NotFound,
194196
/// Provided length did not match content length
195197
SizeInvalid,
196198
/// Manifest tag did not match URI

src/manifest.rs

+10
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ pub struct OciImageManifest {
9595
/// required, assuming an empty vector can be used if necessary.
9696
pub layers: Vec<OciDescriptor>,
9797

98+
/// This is an optional subject linking this manifest to another manifest
99+
/// forming an association between the image manifest and the other manifest.
100+
///
101+
/// NOTE: The responsibility of implementing the fall back mechanism when encountering
102+
/// a registry with an [unavailable referrers API](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#referrers-tag-schema)
103+
/// falls on the consumer of the client.
104+
#[serde(skip_serializing_if = "Option::is_none")]
105+
pub subject: Option<OciDescriptor>,
106+
98107
/// The OCI artifact type
99108
///
100109
/// This OPTIONAL property contains the type of an artifact when the manifest is used for an
@@ -123,6 +132,7 @@ impl Default for OciImageManifest {
123132
media_type: None,
124133
config: OciDescriptor::default(),
125134
layers: vec![],
135+
subject: None,
126136
artifact_type: None,
127137
annotations: None,
128138
}

0 commit comments

Comments
 (0)