Skip to content

Commit

Permalink
Merge pull request bottlerocket-os#4050 from mgsharm/settings-extension
Browse files Browse the repository at this point in the history
Settings extension
  • Loading branch information
mgsharm authored Jun 12, 2024
2 parents 7e9fa08 + f9869d9 commit 1f7f2ce
Show file tree
Hide file tree
Showing 45 changed files with 1,253 additions and 176 deletions.
80 changes: 80 additions & 0 deletions sources/Cargo.lock

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

6 changes: 6 additions & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,21 @@ members = [

"models",

"settings-extensions/autoscaling",
"settings-extensions/aws",
"settings-extensions/bootstrap-containers",
"settings-extensions/cloudformation",
"settings-extensions/container-registry",
"settings-extensions/container-runtime",
"settings-extensions/dns",
"settings-extensions/ecs",
"settings-extensions/host-containers",
"settings-extensions/kernel",
"settings-extensions/metrics",
"settings-extensions/motd",
"settings-extensions/network",
"settings-extensions/ntp",
"settings-extensions/oci-defaults",
"settings-extensions/oci-hooks",
"settings-extensions/pki",
"settings-extensions/updates",
Expand Down
6 changes: 6 additions & 0 deletions sources/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ serde = { version = "1", features = ["derive"] }
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-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" }
settings-extension-dns = { path = "../settings-extensions/dns", version = "0.1" }
settings-extension-ecs = { path = "../settings-extensions/ecs", version = "0.1" }
settings-extension-host-containers = { path = "../settings-extensions/host-containers", version = "0.1" }
settings-extension-kernel = { path = "../settings-extensions/kernel", version = "0.1" }
settings-extension-metrics = { path = "../settings-extensions/metrics", version = "0.1" }
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
10 changes: 4 additions & 6 deletions sources/models/src/aws-dev/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{BootSettings, BootstrapContainer, HostContainer, NetworkSettings};
use modeled_types::Identifier;
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
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
Expand Down
14 changes: 5 additions & 9 deletions sources/models/src/aws-ecs-1-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{AutoScalingSettings, BootstrapContainer, HostContainer, NetworkSettings, OciDefaults};
use modeled_types::Identifier;

// 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: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
aws: settings_extension_aws::AwsSettingsV1,
ecs: settings_extension_ecs::ECSSettingsV1,
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: AutoScalingSettings,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
}
14 changes: 5 additions & 9 deletions sources/models/src/aws-ecs-1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{AutoScalingSettings, BootstrapContainer, HostContainer, NetworkSettings, OciDefaults};
use modeled_types::Identifier;

// 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: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
aws: settings_extension_aws::AwsSettingsV1,
ecs: settings_extension_ecs::ECSSettingsV1,
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: AutoScalingSettings,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
}
17 changes: 6 additions & 11 deletions sources/models/src/aws-ecs-2-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, HostContainer, NetworkSettings,
OciDefaults,
};
use modeled_types::Identifier;
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
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
ecs: settings_extension_ecs::ECSSettingsV1,
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: AutoScalingSettings,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
}
17 changes: 6 additions & 11 deletions sources/models/src/aws-ecs-2/mod.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, HostContainer, NetworkSettings,
OciDefaults,
};
use modeled_types::Identifier;
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
#[model(rename = "settings", impl_default = true)]
struct Settings {
motd: settings_extension_motd::MotdV1,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
ecs: settings_extension_ecs::ECSSettingsV1,
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: AutoScalingSettings,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
dns: settings_extension_dns::DnsSettingsV1,
}
19 changes: 7 additions & 12 deletions sources/models/src/aws-k8s-1.24-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, ContainerRuntimeSettings, HostContainer,
KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;
use crate::{BootSettings, KubernetesSettings};

use model_derive::model;
use std::collections::HashMap;

// 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 @@ -14,20 +9,20 @@ struct Settings {
motd: settings_extension_motd::MotdV1,
kubernetes: KubernetesSettings,
updates: settings_extension_updates::UpdatesSettingsV1,
host_containers: HashMap<Identifier, HostContainer>,
bootstrap_containers: HashMap<Identifier, BootstrapContainer>,
host_containers: settings_extension_host_containers::HostContainersSettingsV1,
bootstrap_containers: settings_extension_bootstrap_containers::BootstrapContainersSettingsV1,
ntp: settings_extension_ntp::NtpSettingsV1,
network: NetworkSettings,
network: settings_extension_network::NetworkSettingsV1,
kernel: settings_extension_kernel::KernelSettingsV1,
boot: BootSettings,
aws: settings_extension_aws::AwsSettingsV1,
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,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
container_runtime: settings_extension_container_runtime::ContainerRuntimeSettingsV1,
autoscaling: settings_extension_autoscaling::AutoScalingSettingsV1,
}
Loading

0 comments on commit 1f7f2ce

Please sign in to comment.