Skip to content

Commit

Permalink
Merge pull request #709 from jvanz/image_manifest_capability
Browse files Browse the repository at this point in the history
feat: update policy-evaluator to get new OCI manifest capability.
  • Loading branch information
jvanz committed Feb 7, 2024
2 parents 84d3701 + 7c49723 commit cbbebd4
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 46 deletions.
129 changes: 87 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lazy_static = "1.4.0"
pulldown-cmark-mdcat = { version = "2.1.1", default-features = false, features = [
"regex-fancy",
] }
policy-evaluator = { git = "https://github.com/kubewarden/policy-evaluator", tag = "v0.14.2" }
policy-evaluator = { git = "https://github.com/kubewarden/policy-evaluator", tag = "v0.15.0" }
prettytable-rs = "^0.10"
pulldown-cmark = { version = "0.9.3", default-features = false }
regex = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/policies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ pub(crate) fn list() -> Result<()> {
}

fn policy_list() -> Result<Vec<Policy>> {
Store::default().list()
Store::default().list().map_err(anyhow::Error::new)
}
4 changes: 3 additions & 1 deletion src/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ pub(crate) async fn pull(
sources: Option<&Sources>,
destination: PullDestination,
) -> Result<Policy> {
fetch_policy(uri, destination, sources).await
fetch_policy(uri, destination, sources)
.await
.map_err(anyhow::Error::new)
}
5 changes: 4 additions & 1 deletion src/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ pub(crate) async fn push(
};

let policy = fs::read(&wasm_path).map_err(|e| anyhow!("Cannot open policy file: {:?}", e))?;
Registry::new().push(&policy, uri, sources).await
Registry::new()
.push(&policy, uri, sources)
.await
.map_err(anyhow::Error::new)
}

fn can_be_force_pushed_without_metadata(
Expand Down

0 comments on commit cbbebd4

Please sign in to comment.