Skip to content

Commit

Permalink
descriptor: support OCI Image Spec 1.1.0-rc5
Browse files Browse the repository at this point in the history
Signed-off-by: wayne warren <[email protected]>
  • Loading branch information
waynr committed Sep 25, 2023
1 parent 2397f4c commit b2d42de
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/image/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ pub struct Descriptor {
#[getset(get = "pub", set = "pub")]
#[builder(default)]
platform: Option<Platform>,
/// This OPTIONAL property contains the type of an artifact when the descriptor points to an
/// artifact. This is the value of the config descriptor mediaType when the descriptor
/// references an image manifest. If defined, the value MUST comply with RFC 6838, including
/// the naming requirements in its section 4.2, and MAY be registered with IANA.
#[serde(skip_serializing_if = "Option::is_none")]
#[getset(get = "pub", set = "pub")]
#[builder(default)]
artifact_type: Option<MediaType>,
/// This OPTIONAL property contains an embedded representation of the referenced content.
/// Values MUST conform to the Base 64 encoding, as defined in RFC 4648. The decoded data MUST
/// be identical to the referenced content and SHOULD be verified against the digest and size
/// fields by content consumers. See Embedded Content for when this is appropriate.
#[serde(skip_serializing_if = "Option::is_none")]
#[getset(get = "pub", set = "pub")]
#[builder(default)]
data: Option<String>,
}

#[derive(
Expand Down Expand Up @@ -109,6 +125,10 @@ pub struct Platform {
#[serde(skip_serializing_if = "Option::is_none")]
#[builder(default)]
variant: Option<String>,
/// This property is RESERVED for future versions of the specification.
#[serde(skip_serializing_if = "Option::is_none")]
#[builder(default)]
features: Option<Vec<String>>,
}

impl Descriptor {
Expand All @@ -121,6 +141,8 @@ impl Descriptor {
urls: Default::default(),
annotations: Default::default(),
platform: Default::default(),
artifact_type: Default::default(),
data: Default::default(),
}
}
}

0 comments on commit b2d42de

Please sign in to comment.