Skip to content

Commit

Permalink
settings: use oci defaults settings extension in models
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsharm committed Jun 12, 2024
1 parent 903a43f commit f9869d9
Show file tree
Hide file tree
Showing 28 changed files with 76 additions and 74 deletions.
5 changes: 3 additions & 2 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ members = [

"settings-extensions/autoscaling",
"settings-extensions/aws",
"settings-extensions/bootstrap-container",
"settings-extensions/bootstrap-containers",
"settings-extensions/cloudformation",
"settings-extensions/container-registry",
"settings-extensions/container-runtime",
Expand Down
3 changes: 2 additions & 1 deletion sources/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ toml = "0.8"
# settings extensions
settings-extension-autoscaling = { path = "../settings-extensions/autoscaling", version = "0.1" }
settings-extension-aws = { path = "../settings-extensions/aws", version = "0.1" }
settings-extension-bootstrap-container = { path = "../settings-extensions/bootstrap-container", version = "0.1" }
settings-extension-bootstrap-containers = { path = "../settings-extensions/bootstrap-containers", version = "0.1" }
settings-extension-cloudformation = { path = "../settings-extensions/cloudformation", version = "0.1" }
settings-extension-container-registry = { path = "../settings-extensions/container-registry", version = "0.1" }
settings-extension-container-runtime = { path = "../settings-extensions/container-runtime", version = "0.1" }
Expand All @@ -32,6 +32,7 @@ settings-extension-metrics = { path = "../settings-extensions/metrics", version
settings-extension-motd = { path = "../settings-extensions/motd", version = "0.1" }
settings-extension-network = { path = "../settings-extensions/network", version = "0.1" }
settings-extension-ntp = { path = "../settings-extensions/ntp", version = "0.1" }
settings-extension-oci-defaults = { path = "../settings-extensions/oci-defaults", version = "0.1" }
settings-extension-oci-hooks = { path = "../settings-extensions/oci-hooks", version = "0.1" }
settings-extension-pki = { path = "../settings-extensions/pki", version = "0.1" }
settings-extension-updates = { path = "../settings-extensions/updates", version = "0.1" }
Expand Down
2 changes: 1 addition & 1 deletion sources/models/src/aws-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand Down
6 changes: 2 additions & 4 deletions sources/models/src/aws-ecs-1-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use model_derive::model;

use crate::OciDefaults;

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -18,7 +16,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
Expand Down
6 changes: 2 additions & 4 deletions sources/models/src/aws-ecs-1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use model_derive::model;

use crate::OciDefaults;

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -18,7 +16,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-2-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use model_derive::model;

use crate::{BootSettings, OciDefaults};
use crate::BootSettings;

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
Expand All @@ -9,7 +9,7 @@ struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-2/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use model_derive::model;

use crate::{BootSettings, OciDefaults};
use crate::BootSettings;

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
// that uses its name in serialization; internal structures use the field name that points to it
Expand All @@ -9,7 +9,7 @@ struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.24-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.24/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.25-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.25/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.26-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.26/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.30-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
6 changes: 3 additions & 3 deletions sources/models/src/aws-k8s-1.30/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BootSettings, KubernetesSettings, OciDefaults};
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;

Expand All @@ -10,7 +10,7 @@ struct Settings {
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand All @@ -19,7 +19,7 @@ struct Settings {
metrics: settings_extension_metrics::MetricsSettingsV1,
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_defaults: settings_extension_oci_defaults::OciDefaultsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: settings_extension_cloudformation::CloudFormationSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
Expand Down
2 changes: 1 addition & 1 deletion sources/models/src/metal-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_container::BootstrapContainerSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
Expand Down
Loading

0 comments on commit f9869d9

Please sign in to comment.