Skip to main content

ignition_config/v3_6/
mod.rs

1// Copyright 2021 Red Hat, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// schemafy doesn't derive Eq on structs, and we don't do it either because
16// any floating point value added to a struct in a future schema version
17// would cause cascading Eq removals.  PartialEq is good enough for now.
18// https://github.com/Marwes/schemafy/issues/61
19#![allow(clippy::derive_partial_eq_without_eq)]
20
21use semver::Version;
22use serde::{Deserialize, Serialize};
23
24pub(crate) const VERSION: Version = Version::new(3, 6, 0);
25
26include!("schema.rs");
27
28// clippy doesn't know that the derive would need to be in generated code
29#[allow(clippy::derivable_impls)]
30impl Default for Config {
31    fn default() -> Self {
32        Self {
33            ignition: Default::default(),
34            kernel_arguments: None,
35            passwd: None,
36            storage: None,
37            systemd: None,
38        }
39    }
40}
41
42impl Default for Ignition {
43    fn default() -> Self {
44        Self {
45            config: None,
46            proxy: None,
47            security: None,
48            timeouts: None,
49            version: VERSION.to_string(),
50        }
51    }
52}