Skip to content

Commit

Permalink
Update for 3.5.0 spec
Browse files Browse the repository at this point in the history
  • Loading branch information
prestist committed Nov 6, 2024
1 parent 8096238 commit 26af96c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
4 changes: 1 addition & 3 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Upcoming ignition-config 0.5.0 (unreleased)


## ignition-config 0.4.2 (unreleased)

- Add Ignition 3.5.0 spec
- Update packit's downstream targets to be `fedora-rawhide`


Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub mod v3_1;
pub mod v3_2;
pub mod v3_3;
pub mod v3_4;
pub mod v3_5;

type Result<T> = std::result::Result<T, Error>;

Expand Down Expand Up @@ -53,6 +54,7 @@ pub enum Config {
V3_2(v3_2::Config),
V3_3(v3_3::Config),
V3_4(v3_4::Config),
V3_5(v3_5::Config),
}

impl Config {
Expand All @@ -75,6 +77,8 @@ impl Config {
Self::V3_3(parse_warn(v, &mut warnings)?)
} else if version == v3_4::VERSION {
Self::V3_4(parse_warn(v, &mut warnings)?)
} else if version == v3_5::VERSION {
Self::V3_5(parse_warn(v, &mut warnings)?)
} else {
return Err(Error::UnknownVersion(version));
};
Expand Down
11 changes: 11 additions & 0 deletions src/v3_5/ignition.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@
"clevis": {
"$ref": "#/definitions/storage/definitions/clevis"
},
"cex": {
"$ref": "#/definitions/storage/definitions/cex"
},
"options": {
"type": "array",
"items": {
Expand Down Expand Up @@ -334,6 +337,14 @@
}
}
},
"cex": {
"type": "object",
"properties": {
"enabled": {
"type": ["boolean", "null"]
}
}
},
"filesystem": {
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion src/v3_5/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use semver::Version;
use serde::{Deserialize, Serialize};

pub(crate) const VERSION: Version = Version::new(3, 4, 0);
pub(crate) const VERSION: Version = Version::new(3, 5, 0);

include!("schema.rs");

Expand Down
9 changes: 9 additions & 0 deletions src/v3_5/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ pub struct Resource {
pub verification: Option<Verification>,
}
#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
#[serde(rename = "cex")]
pub struct Cex {
#[serde(default)]
pub enabled: Option<bool>,
}
#[derive(Clone, PartialEq, Debug, Default, Deserialize, Serialize)]
#[serde(rename = "clevis")]
pub struct Clevis {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -358,6 +364,8 @@ impl Link {
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
#[serde(rename = "luks")]
pub struct Luks {
#[serde(skip_serializing_if = "Option::is_none")]
pub cex: Option<Cex>,
#[serde(skip_serializing_if = "Option::is_none")]
pub clevis: Option<Clevis>,
#[serde(default)]
Expand All @@ -384,6 +392,7 @@ pub struct Luks {
impl Luks {
pub fn new(name: String) -> Self {
Self {
cex: None,
clevis: None,
device: None,
discard: None,
Expand Down

0 comments on commit 26af96c

Please sign in to comment.