Skip to content

Commit

Permalink
Merge pull request #181 from fibonacci1729/subject
Browse files Browse the repository at this point in the history
Add subject to OciImageManifest
  • Loading branch information
bacongobbler authored Nov 7, 2024
2 parents f749169 + 3a7131d commit 28c2ba0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ pub enum OciErrorCode {
NameInvalid,
/// Repository name is not known
NameUnknown,
/// Manifest is not found
NotFound,
/// Provided length did not match content length
SizeInvalid,
/// Manifest tag did not match URI
Expand Down
10 changes: 10 additions & 0 deletions src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ pub struct OciImageManifest {
/// required, assuming an empty vector can be used if necessary.
pub layers: Vec<OciDescriptor>,

/// This is an optional subject linking this manifest to another manifest
/// forming an association between the image manifest and the other manifest.
///
/// NOTE: The responsibility of implementing the fall back mechanism when encountering
/// a registry with an [unavailable referrers API](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#referrers-tag-schema)
/// falls on the consumer of the client.
#[serde(skip_serializing_if = "Option::is_none")]
pub subject: Option<OciDescriptor>,

/// The OCI artifact type
///
/// This OPTIONAL property contains the type of an artifact when the manifest is used for an
Expand Down Expand Up @@ -123,6 +132,7 @@ impl Default for OciImageManifest {
media_type: None,
config: OciDescriptor::default(),
layers: vec![],
subject: None,
artifact_type: None,
annotations: None,
}
Expand Down

0 comments on commit 28c2ba0

Please # to comment.