Skip to content

Commit

Permalink
Merge pull request #15 from kubewarden/default-runasany
Browse files Browse the repository at this point in the history
fix: Default all `rule` to `RunAsAny` if not set
  • Loading branch information
viccuad authored Feb 8, 2022
2 parents aed8871 + b469e5d commit 15edc4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub(crate) struct IDRange {
pub max: i64,
}

#[derive(Serialize, Deserialize, Default, Debug)]
#[derive(Serialize, Deserialize, Debug)]
#[serde(default)]
pub(crate) struct RuleStrategy {
pub rule: String,
Expand All @@ -27,6 +27,14 @@ impl RuleStrategy {
false
}
}
impl Default for RuleStrategy {
fn default() -> Self {
RuleStrategy {
rule: "RunAsAny".to_string(),
ranges: vec![],
}
}
}

impl IDRange {
fn range_min_less_than_max(&self) -> Result<()> {
Expand Down

0 comments on commit 15edc4d

Please sign in to comment.