Skip to content

Commit

Permalink
Merge pull request #47 from lucab/ups/manifests-layers-order
Browse files Browse the repository at this point in the history
v2/manifest: document layers order
  • Loading branch information
steveej authored Oct 15, 2018
2 parents 2cd5f12 + 4439e5b commit 86e85b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/v2/manifest/manifest_schema1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use v2::*;

/// Manifest version 2 schema 1, signed.
///
/// Specification is at https://docs.docker.com/registry/spec/manifest-v2-1/.
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct ManifestSchema1Signed {
#[serde(rename = "schemaVersion")]
Expand Down Expand Up @@ -37,6 +39,9 @@ struct S1Layer {
}

impl ManifestSchema1Signed {
/// List digests of all layers referenced by this manifest.
///
/// The returned layers list is ordered starting with the base image first.
pub fn get_layers(&self) -> Vec<String> {
self.fs_layers
.iter()
Expand Down
6 changes: 5 additions & 1 deletion src/v2/manifest/manifest_schema2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// Manifest version 2 schema 2.
///
/// Specification is at https://docs.docker.com/registry/spec/manifest-v2-2/.
#[derive(Debug, Default, Deserialize, Serialize)]
pub struct ManifestSchema2 {
#[serde(rename = "schemaVersion")]
Expand Down Expand Up @@ -60,7 +62,9 @@ pub struct Platform {
}

impl ManifestSchema2 {
/// List digests of all layer referenced by this manifest.
/// List digests of all layers referenced by this manifest.
///
/// The returned layers list is ordered starting with the base image first.
pub fn get_layers(&self) -> Vec<String> {
self.layers.iter().map(|l| l.digest.clone()).collect()
}
Expand Down

0 comments on commit 86e85b4

Please sign in to comment.