Skip to content

Commit b2d42de

Browse files
committed
descriptor: support OCI Image Spec 1.1.0-rc5
Signed-off-by: wayne warren <[email protected]>
1 parent 2397f4c commit b2d42de

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/image/descriptor.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ pub struct Descriptor {
6060
#[getset(get = "pub", set = "pub")]
6161
#[builder(default)]
6262
platform: Option<Platform>,
63+
/// This OPTIONAL property contains the type of an artifact when the descriptor points to an
64+
/// artifact. This is the value of the config descriptor mediaType when the descriptor
65+
/// references an image manifest. If defined, the value MUST comply with RFC 6838, including
66+
/// the naming requirements in its section 4.2, and MAY be registered with IANA.
67+
#[serde(skip_serializing_if = "Option::is_none")]
68+
#[getset(get = "pub", set = "pub")]
69+
#[builder(default)]
70+
artifact_type: Option<MediaType>,
71+
/// This OPTIONAL property contains an embedded representation of the referenced content.
72+
/// Values MUST conform to the Base 64 encoding, as defined in RFC 4648. The decoded data MUST
73+
/// be identical to the referenced content and SHOULD be verified against the digest and size
74+
/// fields by content consumers. See Embedded Content for when this is appropriate.
75+
#[serde(skip_serializing_if = "Option::is_none")]
76+
#[getset(get = "pub", set = "pub")]
77+
#[builder(default)]
78+
data: Option<String>,
6379
}
6480

6581
#[derive(
@@ -109,6 +125,10 @@ pub struct Platform {
109125
#[serde(skip_serializing_if = "Option::is_none")]
110126
#[builder(default)]
111127
variant: Option<String>,
128+
/// This property is RESERVED for future versions of the specification.
129+
#[serde(skip_serializing_if = "Option::is_none")]
130+
#[builder(default)]
131+
features: Option<Vec<String>>,
112132
}
113133

114134
impl Descriptor {
@@ -121,6 +141,8 @@ impl Descriptor {
121141
urls: Default::default(),
122142
annotations: Default::default(),
123143
platform: Default::default(),
144+
artifact_type: Default::default(),
145+
data: Default::default(),
124146
}
125147
}
126148
}

0 commit comments

Comments
 (0)