Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ignition 3.5.0 spec #55

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update for 3.5.0 spec
  • Loading branch information
prestist committed Nov 6, 2024
commit 26af96c2b59af51e57bbf6624db30b82e73f960a
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
Loading