Skip to content

Commit

Permalink
Merge pull request #135 from jvanz/rename-oci-capabilties
Browse files Browse the repository at this point in the history
fix!: renames OCI capability functions.
  • Loading branch information
flavio authored Feb 19, 2024
2 parents c148dc7 + f8bddfa commit 14f6b86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/host_capabilities/oci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub enum OciManifestResponse {
}

/// Computes the digest of the OCI object referenced by `image`
pub fn manifest_digest(image: &str) -> Result<ManifestDigestResponse> {
pub fn get_manifest_digest(image: &str) -> Result<ManifestDigestResponse> {
let req = json!(image);
let msg = serde_json::to_vec(&req)
.map_err(|e| anyhow!("error serializing the validation request: {}", e))?;
Expand All @@ -38,7 +38,7 @@ pub fn manifest_digest(image: &str) -> Result<ManifestDigestResponse> {
}

/// Fetches OCI manifest referenced by `image`
pub fn manifest(image: &str) -> Result<OciManifestResponse> {
pub fn get_manifest(image: &str) -> Result<OciManifestResponse> {
let req = json!(image);
let msg = serde_json::to_vec(&req)
.map_err(|e| anyhow!("error serializing the validation request: {}", e))?;
Expand Down Expand Up @@ -184,7 +184,7 @@ mod tests {
== "\"ghcr.io/kubewarden/policy-server:latest\""
})
.returning(|_, _, _, _| Ok(serde_json::to_vec(&create_oci_image_manifest()).unwrap()));
let response = manifest("ghcr.io/kubewarden/policy-server:latest")
let response = get_manifest("ghcr.io/kubewarden/policy-server:latest")
.expect("failed to get oci manifest reponse");
match response {
OciManifestResponse::Image(image) => {
Expand All @@ -211,7 +211,7 @@ mod tests {
.returning(|_, _, _, _| {
Ok(serde_json::to_vec(&create_oci_index_image_manifest()).unwrap())
});
let response = manifest("ghcr.io/kubewarden/policy-server:latest")
let response = get_manifest("ghcr.io/kubewarden/policy-server:latest")
.expect("failed to get oci manifest reponse");
match response {
OciManifestResponse::Image(_) => panic!("Invalid oci manifest type returned"),
Expand Down

0 comments on commit 14f6b86

Please sign in to comment.