Skip to content

Commit

Permalink
Merge pull request #97 from kubewarden/renovate/all-minor-patch
Browse files Browse the repository at this point in the history
chore(deps): update kubewarden/github-actions action to v3.4.4
  • Loading branch information
flavio authored Jan 14, 2025
2 parents 0542dc5 + 2978118 commit aa0270d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

test:
name: run tests and linters
uses: kubewarden/github-actions/.github/workflows/reusable-test-policy-rust.yml@v3.3.5
uses: kubewarden/github-actions/.github/workflows/reusable-test-policy-rust.yml@v3.4.4

release:
needs: test
Expand All @@ -22,7 +22,7 @@ jobs:
# Required by cosign keyless signing
id-token: write

uses: kubewarden/github-actions/.github/workflows/reusable-release-policy-rust.yml@v3.3.5
uses: kubewarden/github-actions/.github/workflows/reusable-release-policy-rust.yml@v3.4.4
with:
oci-target: ghcr.io/${{ github.repository_owner }}/policies/allow-privilege-escalation-psp

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ name: Continuous integration
jobs:
test:
name: run tests and linters
uses: kubewarden/github-actions/.github/workflows/reusable-test-policy-rust.yml@v3.3.5
uses: kubewarden/github-actions/.github/workflows/reusable-test-policy-rust.yml@v3.4.4
8 changes: 3 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ fn validate(payload: &[u8]) -> CallResult {

fn has_allowed_privilege_escalation_container(containers: Vec<apicore::Container>) -> bool {
containers.into_iter().any(|container| {
container
.security_context
.map_or(false, |security_context| {
security_context.allow_privilege_escalation.unwrap_or(false)
})
container.security_context.is_some_and(|security_context| {
security_context.allow_privilege_escalation.unwrap_or(false)
})
})
}

Expand Down
3 changes: 1 addition & 2 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ impl kubewarden_policy_sdk::settings::Validatable for Settings {
#[cfg(test)]
mod tests {
use super::*;
use serde_yaml;

#[test]
fn test_policy_with_no_settings() -> Result<(), ()> {
Expand All @@ -48,7 +47,7 @@ mod tests {

let payload = "default_allow_privilege_escalation: false";
let settings = serde_yaml::from_str::<Settings>(payload)?;
assert_eq!(settings.default_allow_privilege_escalation, false);
assert!(!settings.default_allow_privilege_escalation);
Ok(())
}
}

0 comments on commit aa0270d

Please sign in to comment.