Skip to content

Commit

Permalink
Merge pull request #3980 from mgsharm/dns-settings-extension
Browse files Browse the repository at this point in the history
Dns settings extension
  • Loading branch information
mgsharm authored May 23, 2024
2 parents 62f1453 + 8ccf1f6 commit fffc133
Show file tree
Hide file tree
Showing 26 changed files with 249 additions and 49 deletions.
21 changes: 21 additions & 0 deletions packages/settings-dns/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "settings-dns"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
source-groups = [
"settings-extensions/dns"
]

# RPM BuildRequires
[build-dependencies]
glibc = { path = "../glibc" }

# RPM Requires
[dependencies]
39 changes: 39 additions & 0 deletions packages/settings-dns/settings-dns.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
%global _cross_first_party 1
%undefine _debugsource_packages

%global extension_name dns

Name: %{_cross_os}settings-%{extension_name}
Version: 0.0
Release: 0%{?dist}
Summary: settings-%{extension_name}
License: Apache-2.0 OR MIT
URL: https://github.com/bottlerocket-os/bottlerocket

BuildRequires: %{_cross_os}glibc-devel

%description
%{summary}.

%prep
%setup -T -c
%cargo_prep

%build
%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \
-p settings-extension-%{extension_name}

%install
install -d %{buildroot}%{_cross_libexecdir}
install -p -m 0755 \
${HOME}/.cache/%{__cargo_target}/release/settings-extension-%{extension_name} \
%{buildroot}%{_cross_libexecdir}

install -d %{buildroot}%{_cross_libexecdir}/settings
ln -sf \
../settings-extension-%{extension_name} \
%{buildroot}%{_cross_libexecdir}/settings/%{extension_name}

%files
%{_cross_libexecdir}/settings-extension-%{extension_name}
%{_cross_libexecdir}/settings/%{extension_name}
13 changes: 13 additions & 0 deletions sources/Cargo.lock

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

1 change: 1 addition & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ members = [

"settings-extensions/aws",
"settings-extensions/container-registry",
"settings-extensions/dns",
"settings-extensions/kernel",
"settings-extensions/metrics",
"settings-extensions/motd",
Expand Down
1 change: 1 addition & 0 deletions sources/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ toml = "0.8"
# settings extensions
settings-extension-aws = { path = "../settings-extensions/aws", version = "0.1" }
settings-extension-container-registry = { path = "../settings-extensions/container-registry", version = "0.1" }
settings-extension-dns = { path = "../settings-extensions/dns", 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" }
Expand Down
5 changes: 2 additions & 3 deletions sources/models/src/aws-dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use model_derive::model;
use std::collections::HashMap;

use crate::{
BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings, HostContainer,
NetworkSettings,
BootSettings, BootstrapContainer, CloudFormationSettings, HostContainer, NetworkSettings,
};
use modeled_types::Identifier;

Expand All @@ -25,5 +24,5 @@ struct Settings {
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-1-nvidia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use model_derive::model;
use std::collections::HashMap;

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

Expand All @@ -27,5 +27,5 @@ struct Settings {
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
autoscaling: AutoScalingSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use model_derive::model;
use std::collections::HashMap;

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

Expand All @@ -27,5 +27,5 @@ struct Settings {
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
autoscaling: AutoScalingSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
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
Expand Up @@ -2,8 +2,8 @@ use model_derive::model;
use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
ECSSettings, HostContainer, NetworkSettings, OciDefaults,
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings, ECSSettings,
HostContainer, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,5 +28,5 @@ struct Settings {
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
autoscaling: AutoScalingSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
6 changes: 3 additions & 3 deletions sources/models/src/aws-ecs-2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use model_derive::model;
use std::collections::HashMap;

use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings, DnsSettings,
ECSSettings, HostContainer, NetworkSettings, OciDefaults,
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings, ECSSettings,
HostContainer, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,5 +28,5 @@ struct Settings {
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
autoscaling: AutoScalingSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.24-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.24/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.25-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.25/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.26-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.26/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.30-nvidia/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
5 changes: 2 additions & 3 deletions sources/models/src/aws-k8s-1.30/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
AutoScalingSettings, BootSettings, BootstrapContainer, CloudFormationSettings,
ContainerRuntimeSettings, DnsSettings, HostContainer, KubernetesSettings, NetworkSettings,
OciDefaults,
ContainerRuntimeSettings, HostContainer, KubernetesSettings, NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -28,7 +27,7 @@ struct Settings {
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
cloudformation: CloudFormationSettings,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
autoscaling: AutoScalingSettings,
}
4 changes: 2 additions & 2 deletions sources/models/src/metal-dev/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{BootSettings, BootstrapContainer, DnsSettings, HostContainer, NetworkSettings};
use crate::{BootSettings, BootstrapContainer, HostContainer, NetworkSettings};
use modeled_types::Identifier;

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
Expand All @@ -20,5 +20,5 @@ struct Settings {
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
6 changes: 3 additions & 3 deletions sources/models/src/metal-k8s-1.29/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use model_derive::model;
use std::collections::HashMap;

use crate::{
BootSettings, BootstrapContainer, ContainerRuntimeSettings, DnsSettings, HostContainer,
KubernetesSettings, NetworkSettings, OciDefaults,
BootSettings, BootstrapContainer, ContainerRuntimeSettings, HostContainer, KubernetesSettings,
NetworkSettings, OciDefaults,
};
use modeled_types::Identifier;

Expand All @@ -26,6 +26,6 @@ struct Settings {
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_defaults: OciDefaults,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
container_runtime: ContainerRuntimeSettings,
}
4 changes: 2 additions & 2 deletions sources/models/src/vmware-dev/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use model_derive::model;
use std::collections::HashMap;

use crate::{BootSettings, BootstrapContainer, DnsSettings, HostContainer, NetworkSettings};
use crate::{BootSettings, BootstrapContainer, HostContainer, NetworkSettings};
use modeled_types::Identifier;

// Note: we have to use 'rename' here because the top-level Settings structure is the only one
Expand All @@ -20,5 +20,5 @@ struct Settings {
pki: settings_extension_pki::PkiSettingsV1,
container_registry: settings_extension_container_registry::RegistrySettingsV1,
oci_hooks: settings_extension_oci_hooks::OciHooksSettingsV1,
dns: DnsSettings,
dns: settings_extension_dns::DnsSettingsV1,
}
Loading

0 comments on commit fffc133

Please sign in to comment.