diff --git a/packages/os/00-resolved.conf b/packages/netdog/00-resolved.conf similarity index 100% rename from packages/os/00-resolved.conf rename to packages/netdog/00-resolved.conf diff --git a/packages/netdog/Cargo.toml b/packages/netdog/Cargo.toml new file mode 100644 index 00000000000..a4d34dd353f --- /dev/null +++ b/packages/netdog/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "netdog" +version = "0.1.0" +edition = "2021" +publish = false +build = "../build.rs" + +[lib] +path = "../packages.rs" + +[package.metadata.build-packages] +source-groups = [ + "netdog", + "dogtag", +] + +# RPM BuildRequires +[build-dependencies] +glibc = { path = "../glibc" } + +[dependencies] +wicked = { path = "../wicked" } +systemd = { path = "../systemd" } diff --git a/packages/os/disable-udp-offload.service b/packages/netdog/disable-udp-offload.service similarity index 100% rename from packages/os/disable-udp-offload.service rename to packages/netdog/disable-udp-offload.service diff --git a/packages/os/generate-network-config.service b/packages/netdog/generate-network-config.service similarity index 100% rename from packages/os/generate-network-config.service rename to packages/netdog/generate-network-config.service diff --git a/packages/os/netdog-tmpfiles.conf b/packages/netdog/netdog-tmpfiles.conf similarity index 100% rename from packages/os/netdog-tmpfiles.conf rename to packages/netdog/netdog-tmpfiles.conf diff --git a/packages/netdog/netdog.spec b/packages/netdog/netdog.spec new file mode 100644 index 00000000000..7db01863af5 --- /dev/null +++ b/packages/netdog/netdog.spec @@ -0,0 +1,123 @@ +%global _cross_first_party 1 +%undefine _debugsource_packages + +Name: %{_cross_os}netdog +Version: 0.1.1 +Release: 0%{?dist} +Summary: Bottlerocket network configuration helper +License: Apache-2.0 OR MIT +URL: https://github.com/bottlerocket-os/bottlerocket + +Source0: netdog-tmpfiles.conf + +Source10: run-netdog.mount +Source11: write-network-status.service +Source12: generate-network-config.service +Source13: disable-udp-offload.service + +Source20: 00-resolved.conf + +BuildRequires: %{_cross_os}glibc-devel +Requires: %{_cross_os}hostname-reverse-dns +Requires: (%{_cross_os}hostname-imds if %{_cross_os}variant-platform(aws)) +Requires: (%{_cross_os}netdog-systemd-networkd if %{_cross_os}image-feature(systemd-networkd)) +Requires: (%{_cross_os}netdog-wicked if %{_cross_os}image-feature(no-systemd-networkd)) + +%description +%{summary}. + +%package systemd-networkd +Summary: Bottlerocket network configuration helper +Requires: %{name} +Requires: %{_cross_os}systemd-networkd +Requires: %{_cross_os}systemd-resolved +Conflicts: (%{_cross_os}netdog-wicked or %{_cross_os}image-feature(no-systemd-networkd)) +%description -n %{_cross_os}netdog-systemd-networkd +%{summary}. + +%package wicked +Summary: Bottlerocket network configuration helper +Requires: %{name} +Requires: %{_cross_os}wicked +Conflicts: (%{_cross_os}netdog-systemd-networkd or %{_cross_os}image-feature(systemd-networkd)) +%description -n %{_cross_os}netdog-wicked +%{summary}. + +%package -n %{_cross_os}hostname-reverse-dns +Summary: Reverse DNS Hostname detector +%description -n %{_cross_os}hostname-reverse-dns +%{summary} + +%package -n %{_cross_os}hostname-imds +Summary: IMDS Hostname detector +%description -n %{_cross_os}hostname-imds +%{summary} + +%prep +%setup -T -c +%cargo_prep + +%build +mkdir bin + +echo "** Build Dogtag Hostname Detectors" +%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ + -p dogtag \ + --bins \ + --target-dir=${HOME}/.cache/dogtag + +echo "** Build Netdog Binaries" +%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ + -p netdog \ + --features default \ + --target-dir=${HOME}/.cache/networkd +%cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ + -p netdog \ + --features wicked \ + --target-dir=${HOME}/.cache/wicked + +%install +install -d %{buildroot}%{_cross_libexecdir}/hostname-detectors +install -p -m 0755 ${HOME}/.cache/dogtag/%{__cargo_target}/release/20-imds %{buildroot}%{_cross_libexecdir}/hostname-detectors/20-imds +install -p -m 0755 ${HOME}/.cache/dogtag/%{__cargo_target}/release/10-reverse-dns %{buildroot}%{_cross_libexecdir}/hostname-detectors/10-reverse-dns + +install -d %{buildroot}%{_cross_bindir} +install -p -m 0755 ${HOME}/.cache/networkd/%{__cargo_target}/release/netdog %{buildroot}%{_cross_bindir}/netdog-systemd-networkd +install -p -m 0755 ${HOME}/.cache/wicked/%{__cargo_target}/release/netdog %{buildroot}%{_cross_bindir}/netdog-wicked + +install -d %{buildroot}%{_cross_tmpfilesdir} +install -p -m 0644 %{S:0} %{buildroot}%{_cross_tmpfilesdir}/netdog.conf + +install -d %{buildroot}%{_cross_unitdir} +install -p -m 0644 %{S:10} %{S:11} %{S:12} %{S:13} %{buildroot}%{_cross_unitdir} + +install -d %{buildroot}%{_cross_libdir} +install -d %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d +install -p -m 0644 %{S:20} %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d + +%post wicked -p +posix.symlink("netdog-wicked", "%{_cross_bindir}/netdog") + +%post systemd-networkd -p +posix.symlink("netdog-systemd-networkd", "%{_cross_bindir}/netdog") + +%files +%{_cross_tmpfilesdir}/netdog.conf +%{_cross_unitdir}/generate-network-config.service +%{_cross_unitdir}/disable-udp-offload.service +%{_cross_unitdir}/run-netdog.mount + +%files -n %{_cross_os}hostname-reverse-dns +%{_cross_libexecdir}/hostname-detectors/10-reverse-dns + +%files -n %{_cross_os}hostname-imds +%{_cross_libexecdir}/hostname-detectors/20-imds + +%files systemd-networkd +%{_cross_bindir}/netdog-systemd-networkd +%{_cross_unitdir}/write-network-status.service +%dir %{_cross_libdir}/systemd/resolved.conf.d +%{_cross_libdir}/systemd/resolved.conf.d/00-resolved.conf + +%files wicked +%{_cross_bindir}/netdog-wicked diff --git a/packages/os/run-netdog.mount b/packages/netdog/run-netdog.mount similarity index 100% rename from packages/os/run-netdog.mount rename to packages/netdog/run-netdog.mount diff --git a/packages/os/write-network-status.service b/packages/netdog/write-network-status.service similarity index 100% rename from packages/os/write-network-status.service rename to packages/netdog/write-network-status.service diff --git a/packages/os/Cargo.toml b/packages/os/Cargo.toml index 23af20c9726..879019e7c0b 100644 --- a/packages/os/Cargo.toml +++ b/packages/os/Cargo.toml @@ -24,7 +24,6 @@ source-groups = [ "bloodhound", "xfscli", ] -package-features = [ "systemd-networkd" ] [lib] path = "../packages.rs" @@ -46,6 +45,3 @@ glibc = { path = "../glibc" } # binutils = { path = "../binutils" } # oci-add-hooks required for shimpei functionality # oci-add-hooks = { path = "../oci-add-hooks" } -# wicked and systemd-networkd required for netdog functionality -# wicked = { path = "../wicked" } -# systemd-networkd = { path = "../systemd" } diff --git a/packages/os/os.spec b/packages/os/os.spec index 67d92a982aa..102c6b6e0c6 100644 --- a/packages/os/os.spec +++ b/packages/os/os.spec @@ -27,7 +27,6 @@ Source8: oci-default-hooks-json Source9: cfsignal-toml Source10: warm-pool-wait-toml Source11: bottlerocket-cis-checks-metadata-json -Source12: 00-resolved.conf Source13: kubernetes-cis-checks-metadata-json Source14: certdog-toml Source15: prairiedog-toml @@ -52,20 +51,15 @@ Source114: bootstrap-containers@.service Source115: link-kernel-modules.service.in Source116: load-kernel-modules.service.in Source117: cfsignal.service -Source118: generate-network-config.service Source119: reboot-if-required.service Source120: warm-pool-wait.service -Source121: disable-udp-offload.service Source122: has-boot-ever-succeeded.service -Source123: run-netdog.mount -Source124: write-network-status.service # 2xx sources: tmpfilesd configs Source200: migration-tmpfiles.conf Source201: host-containers-tmpfiles.conf Source202: thar-be-updates-tmpfiles.conf Source203: bootstrap-containers-tmpfiles.conf -Source204: netdog-tmpfiles.conf # 3xx sources: udev rules Source300: ephemeral-storage.rules @@ -90,7 +84,6 @@ Requires: %{_cross_os}host-containers Requires: %{_cross_os}logdog Requires: %{_cross_os}metricdog Requires: %{_cross_os}migration -Requires: %{_cross_os}netdog Requires: %{_cross_os}prairiedog Requires: %{_cross_os}schnauzer Requires: %{_cross_os}settings-committer @@ -129,17 +122,6 @@ Summary: Bottlerocket API client %description -n %{_cross_os}apiclient %{summary}. -%package -n %{_cross_os}netdog -Summary: Bottlerocket network configuration helper -%if %{with systemd_networkd} -Requires: %{_cross_os}systemd-networkd -Requires: %{_cross_os}systemd-resolved -%else -Requires: %{_cross_os}wicked -%endif -%description -n %{_cross_os}netdog -%{summary}. - %package -n %{_cross_os}sundog Summary: Updates settings dynamically based on user-specified generators %description -n %{_cross_os}sundog @@ -363,7 +345,6 @@ exec 1>&3 2>&4 echo "** Output from non-static builds:" %cargo_build --manifest-path %{_builddir}/sources/Cargo.toml \ -p apiserver \ - -p netdog \ -p sundog \ -p schnauzer \ -p bork \ @@ -411,7 +392,7 @@ fi install -d %{buildroot}%{_cross_bindir} for p in \ apiserver \ - netdog sundog schnauzer schnauzer-v2 bork \ + sundog schnauzer schnauzer-v2 bork \ corndog thar-be-settings thar-be-updates host-containers \ storewolf settings-committer \ migrator prairiedog certdog \ @@ -522,17 +503,10 @@ install -p -m 0644 %{S:5} %{S:6} %{S:7} %{S:8} %{S:14} %{S:15} %{S:16} %{S:17} % install -d %{buildroot}%{_cross_unitdir} install -p -m 0644 \ %{S:100} %{S:102} %{S:103} %{S:105} \ - %{S:106} %{S:107} %{S:110} %{S:111} \ - %{S:112} %{S:113} %{S:114} %{S:118} \ - %{S:119} %{S:122} %{S:123} \ + %{S:106} %{S:107} %{S:110} %{S:111} %{S:112} \ + %{S:113} %{S:114} %{S:119} %{S:122} \ %{buildroot}%{_cross_unitdir} -%if %{with systemd_networkd} -install -p -m 0644 %{S:124} %{buildroot}%{_cross_unitdir} -install -d %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d -install -p -m 0644 %{S:12} %{buildroot}%{_cross_libdir}/systemd/resolved.conf.d -%endif - %if %{with nvidia_flavor} sed -e 's|PREFIX|%{_cross_prefix}|g' %{S:115} > link-kernel-modules.service sed -e 's|PREFIX|%{_cross_prefix}|g' %{S:116} > load-kernel-modules.service @@ -556,17 +530,12 @@ install -p -m 0644 %{S:200} %{buildroot}%{_cross_tmpfilesdir}/migration.conf install -p -m 0644 %{S:201} %{buildroot}%{_cross_tmpfilesdir}/host-containers.conf install -p -m 0644 %{S:202} %{buildroot}%{_cross_tmpfilesdir}/thar-be-updates.conf install -p -m 0644 %{S:203} %{buildroot}%{_cross_tmpfilesdir}/bootstrap-containers.conf -install -p -m 0644 %{S:204} %{buildroot}%{_cross_tmpfilesdir}/netdog.conf install -d %{buildroot}%{_cross_udevrulesdir} install -p -m 0644 %{S:300} %{buildroot}%{_cross_udevrulesdir}/80-ephemeral-storage.rules install -p -m 0644 %{S:301} %{buildroot}%{_cross_udevrulesdir}/81-ebs-volumes.rules install -p -m 0644 %{S:302} %{buildroot}%{_cross_udevrulesdir}/82-supplemental-storage.rules -%if %{with vmware_platform} -install -p -m 0644 %{S:121} %{buildroot}%{_cross_unitdir} -%endif - %cross_scan_attribution --clarify %{_builddir}/sources/clarify.toml \ cargo --offline --locked %{_builddir}/sources/Cargo.toml @@ -589,20 +558,6 @@ install -p -m 0644 %{S:400} %{S:401} %{S:402} %{buildroot}%{_cross_licensedir} %files -n %{_cross_os}apiclient %{_cross_bindir}/apiclient -%files -n %{_cross_os}netdog -%{_cross_bindir}/netdog -%{_cross_tmpfilesdir}/netdog.conf -%{_cross_unitdir}/generate-network-config.service -%{_cross_unitdir}/run-netdog.mount -%if %{with vmware_platform} -%{_cross_unitdir}/disable-udp-offload.service -%endif -%if %{with systemd_networkd} -%{_cross_unitdir}/write-network-status.service -%dir %{_cross_libdir}/systemd/resolved.conf.d -%{_cross_libdir}/systemd/resolved.conf.d/00-resolved.conf -%endif - %files -n %{_cross_os}corndog %{_cross_bindir}/corndog %{_cross_templatedir}/corndog-toml diff --git a/packages/release/Cargo.toml b/packages/release/Cargo.toml index f36fa955177..b7cabee011f 100644 --- a/packages/release/Cargo.toml +++ b/packages/release/Cargo.toml @@ -40,6 +40,7 @@ libgcc = { path = "../libgcc" } libkcapi = { path = "../libkcapi" } libstd-rust = { path = "../libstd-rust" } makedumpfile = { path = "../../packages/makedumpfile" } +netdog = {path = "../netdog" } os = { path = "../os" } oci-add-hooks = { path = "../oci-add-hooks" } policycoreutils = { path = "../policycoreutils" } @@ -48,5 +49,4 @@ selinux-policy = { path = "../selinux-policy" } shim = { path = "../shim" } systemd = { path = "../systemd" } util-linux = { path = "../util-linux" } -wicked = { path = "../wicked" } xfsprogs = { path = "../xfsprogs" } diff --git a/packages/release/release.spec b/packages/release/release.spec index 879fe84d6cc..4f706dacd55 100644 --- a/packages/release/release.spec +++ b/packages/release/release.spec @@ -121,6 +121,7 @@ Requires: %{_cross_os}iptables Requires: %{_cross_os}kexec-tools Requires: %{_cross_os}keyutils Requires: %{_cross_os}makedumpfile +Requires: %{_cross_os}netdog Requires: %{_cross_os}os Requires: %{_cross_os}policycoreutils Requires: %{_cross_os}procps diff --git a/sources/Cargo.lock b/sources/Cargo.lock index a3ede8d064b..a9c503970b0 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -1697,6 +1697,7 @@ dependencies = [ "log", "snafu 0.8.2", "tokio", + "tokio-retry", "walkdir", ] @@ -2805,12 +2806,10 @@ name = "netdog" version = "0.1.0" dependencies = [ "argh", - "bottlerocket-variant", - "dns-lookup", + "dogtag", "envy", "generate-readme", "handlebars", - "imdsclient", "indexmap 1.9.3", "ipnet", "lazy_static", @@ -2824,7 +2823,6 @@ dependencies = [ "systemd-derive", "tempfile", "tokio", - "tokio-retry", "toml", ] diff --git a/sources/Cargo.toml b/sources/Cargo.toml index e78c5c66f3d..36a6617e389 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -8,7 +8,6 @@ members = [ "api/certdog", "api/corndog", "api/datastore", - "api/netdog", "api/sundog", "api/schnauzer", "api/pluto", @@ -115,6 +114,8 @@ members = [ "metricdog", + "netdog", + "cfsignal", "logdog", diff --git a/sources/api/netdog/build.rs b/sources/api/netdog/build.rs deleted file mode 100644 index dab30d8c838..00000000000 --- a/sources/api/netdog/build.rs +++ /dev/null @@ -1,43 +0,0 @@ -use bottlerocket_variant::{Variant, VARIANT_ENV}; - -/// The name of the environment variable that will be set in the event the variant is being built -/// with the `systemd-networkd` backend. The variable's value can only ever be 1 (based on -/// buildsys), and will only be emitted if the variant's image features include the build flag. -/// TODO: Remove these variables once systemd-networkd integration development is finished -const NET_BACKEND_OVERRIDE_ENV: &str = "SYSTEMD_NETWORKD"; -/// The `cfg` value that will be emitted in the case the `NET_BACKEND_OVERRIDE_ENV` variable is set -const NET_BACKEND_OVERRIDE: &str = "systemd-networkd"; -/// The default network backend, used in the case the `NET_BACKEND_OVERRIDE_ENV` isn't set in the -/// build environment. -const DEFAULT_NET_BACKEND: &str = "wicked"; - -fn main() { - let variant = match Variant::from_env() { - Ok(variant) => variant, - Err(e) => { - eprintln!( - "For local builds, you must set the '{}' environment variable so we know \ - which data provider to build. Valid values are the directories in \ - models/src/variants/, for example 'aws-ecs-1': {}", - VARIANT_ENV, e, - ); - std::process::exit(1); - } - }; - variant.emit_cfgs(); - emit_net_backend_cfgs(); - - generate_readme::from_main().unwrap(); -} - -/// Emit `cfg` values that can be used for conditional compilation based on the network backend. -/// TODO: Remove this function once systemd-networkd integration development is finished -fn emit_net_backend_cfgs() { - let net_backend = if Some("1".to_string()) == std::env::var(NET_BACKEND_OVERRIDE_ENV).ok() { - NET_BACKEND_OVERRIDE - } else { - DEFAULT_NET_BACKEND - }; - println!("cargo:rerun-if-env-changed={}", NET_BACKEND_OVERRIDE_ENV); - println!("cargo:rustc-cfg=net_backend=\"{}\"", net_backend); -} diff --git a/sources/api/netdog/src/cli/generate_hostname.rs b/sources/api/netdog/src/cli/generate_hostname.rs deleted file mode 100644 index 435c59280a5..00000000000 --- a/sources/api/netdog/src/cli/generate_hostname.rs +++ /dev/null @@ -1,105 +0,0 @@ -use super::{error, print_json, Result}; -use crate::CURRENT_IP; -use argh::FromArgs; -use dns_lookup::lookup_addr; -use snafu::ResultExt; -use tokio::time::Duration; -use tokio_retry::{ - strategy::{jitter, FibonacciBackoff}, - Retry, -}; - -use std::fs; -use std::net::IpAddr; -use std::str::FromStr; - -// Maximum number of retries for querying DNS for the hostname. -const DNS_QUERY_MAX_RETRIES: usize = 3; -// Starting retry interval for fibonacci backoff strategy. -const DNS_QUERY_FIBONACCI_RETRY_INTERVAL: u64 = 50; -// getnameinfo() takes about 5 seconds to time out - we add our own brief delay between retries. - -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "generate-hostname")] -/// Generate hostname from DNS reverse lookup or use current IP -pub(crate) struct GenerateHostnameArgs {} - -/// Attempt to resolve assigned IP address, if unsuccessful use the IP as the hostname. -/// -/// The result is returned as JSON. (intended for use as a settings generator) -pub(crate) async fn run() -> Result<()> { - let ip_string = fs::read_to_string(CURRENT_IP) - .context(error::CurrentIpReadFailedSnafu { path: CURRENT_IP })?; - let ip = IpAddr::from_str(&ip_string).context(error::IpFromStringSnafu { ip: &ip_string })?; - - // First, try any platform-specific mechanism that exists. - let hostname = - // The interaction between async and `Result.or_else()` chaining makes this the most ergonomic way to write this... - platform::query_platform_hostname() - .await - .map_err(|e| { - eprintln!("Failed to find hostname from platform: {}", e); - e - }).ok().flatten(); - - // If the platform-specific mechanism fails, attempt to lookup the hostname via DNS - let hostname = if hostname.is_none() { - Retry::spawn(retry_strategy(), || async { lookup_addr(&ip) }) - .await - .map_err(|e| { - eprintln!("Reverse DNS lookup failed: {}", e); - e - }) - .ok() - } else { - hostname - } - // If no hostname has been determined we return the IP address of the host, replacing invalid ipv6 chars. - .unwrap_or(ip_string.replace(':', "-")); - - // sundog expects JSON-serialized output - print_json(hostname) -} - -/// Returns an iterator of Durations to wait between retries of DNS queries. -fn retry_strategy() -> impl Iterator { - FibonacciBackoff::from_millis(DNS_QUERY_FIBONACCI_RETRY_INTERVAL) - .map(jitter) - .take(DNS_QUERY_MAX_RETRIES) -} - -mod platform { - use snafu::Snafu; - - #[cfg(variant_platform = "aws")] - use snafu::ResultExt; - - #[cfg(variant_platform = "aws")] - const IMDS_RETRY_TIMEOUT: tokio::time::Duration = tokio::time::Duration::from_secs(3); - - /// Query IMDS on AWS platforms to determine hostname. - #[cfg(variant_platform = "aws")] - pub(super) async fn query_platform_hostname() -> Result> { - let mut imdsclient = imdsclient::ImdsClient::new().with_timeout(IMDS_RETRY_TIMEOUT); - let imds_hostname = imdsclient.fetch_hostname().await.context(ImdsLookupSnafu)?; - Ok(imds_hostname) - } - - #[cfg(not(variant_platform = "aws"))] - pub(super) async fn query_platform_hostname() -> Result> { - Ok(None) - } - - /// Provide a Snafu error type for calling platform-specific hostname-fetching errors. - /// - /// This allows us to avoid conditionally compiling error cases into `crate::error::Error`. - #[derive(Debug, Snafu)] - #[snafu(visibility(pub(super)))] - pub(super) enum Error { - #[cfg(variant_platform = "aws")] - #[snafu(display("Failed to lookup hostname in imds: {}", source))] - ImdsLookup { source: imdsclient::Error }, - } - - pub(super) type Result = std::result::Result; -} diff --git a/sources/dogtag/Cargo.toml b/sources/dogtag/Cargo.toml index dbca249a23d..c62124138e4 100644 --- a/sources/dogtag/Cargo.toml +++ b/sources/dogtag/Cargo.toml @@ -24,6 +24,7 @@ imdsclient = { version = "0.1", path = "../imdsclient" } log = "0.4" snafu = "0.8" tokio = { version = "~1.32", features = ["macros"]} # LTS +tokio-retry = "0.3" walkdir = "2" [build-dependencies] diff --git a/sources/dogtag/README.md b/sources/dogtag/README.md index 875a509d7a2..d28f6c648dd 100644 --- a/sources/dogtag/README.md +++ b/sources/dogtag/README.md @@ -2,14 +2,17 @@ Current version: 0.1.0 -dogtag resolves the hostname of a bottlerocket server/instance. It's used to generate settings.network.hostname. To accomplish this, it uses a set of standalone binaries in /var/bottlerocket/dogtag that resolve the hostname via different methods. +dogtag detects the hostname of a bottlerocket server/instance. It's used to generate settings.network.hostname. +To accomplish this, it uses a set of standalone binaries in /usr/libexec/hostname-detectors that detect the hostname via different methods. -Currently, bottlerocket ships with two hostname resolver binaries: +Currently, bottlerocket ships with two hostname detector binaries: 20-imds - Fetches hostname from EC2 Instance Metadata Service 10-reverse-dns - Uses reverse DNS lookup to resolve the hostname -dogtag runs the resolvers in /var/bottlerocket/dogtag in reverse alphanumerical order until one of them returns a hostname, at which point it will exit early and print the returned hostname to stdout. +dogtag runs the detectors in /usr/libexec/hostname-detectors in reverse alphanumerical order until one of them returns a hostname, +at which point it will exit early and print the returned hostname to stdout. If none of the detectors detect the hostname the +ip address is returned. ## Colophon diff --git a/sources/dogtag/bin/reverse.rs b/sources/dogtag/bin/reverse.rs index 633494b621f..7b2d10c05eb 100644 --- a/sources/dogtag/bin/reverse.rs +++ b/sources/dogtag/bin/reverse.rs @@ -1,19 +1,42 @@ use dns_lookup::lookup_addr; use dogtag::Cli; use snafu::ResultExt; +use tokio::time::Duration; +use tokio_retry::{ + strategy::{jitter, FibonacciBackoff}, + Retry, +}; + +// Maximum number of retries for querying DNS for the hostname. +const DNS_QUERY_MAX_RETRIES: usize = 3; +// Starting retry interval for fibonacci backoff strategy. +const DNS_QUERY_FIBONACCI_RETRY_INTERVAL: u64 = 50; +// getnameinfo() takes about 5 seconds to time out - we add our own brief delay between retries. type Result = std::result::Result; /// Looks up the public hostname by using dns-lookup to /// resolve it from the ip address provided -fn main() -> Result<()> { +#[tokio::main] +async fn main() -> Result<()> { let cli: Cli = argh::from_env(); let ip: std::net::IpAddr = cli.ip_address.parse().context(error::InvalidIpSnafu)?; - let hostname = lookup_addr(&ip).context(error::LookupSnafu)?; + let hostname = Retry::spawn(retry_strategy(), || async { lookup_addr(&ip) }) + .await + .map_err(|e| error::Error::Lookup { + source: Box::new(e), + })?; println!("{}", hostname); Ok(()) } +/// Returns an iterator of Durations to wait between retries of DNS queries. +fn retry_strategy() -> impl Iterator { + FibonacciBackoff::from_millis(DNS_QUERY_FIBONACCI_RETRY_INTERVAL) + .map(jitter) + .take(DNS_QUERY_MAX_RETRIES) +} + mod error { use snafu::Snafu; diff --git a/sources/dogtag/src/lib.rs b/sources/dogtag/src/lib.rs index 0e220c6fb6a..ee873a80aef 100644 --- a/sources/dogtag/src/lib.rs +++ b/sources/dogtag/src/lib.rs @@ -1,20 +1,24 @@ /*! -dogtag resolves the hostname of a bottlerocket server/instance. It's used to generate settings.network.hostname. To accomplish this, it uses a set of standalone binaries in /var/bottlerocket/dogtag that resolve the hostname via different methods. +dogtag detects the hostname of a bottlerocket server/instance. It's used to generate settings.network.hostname. +To accomplish this, it uses a set of standalone binaries in /usr/libexec/hostname-detectors that detect the hostname via different methods. -Currently, bottlerocket ships with two hostname resolver binaries: +Currently, bottlerocket ships with two hostname detector binaries: 20-imds - Fetches hostname from EC2 Instance Metadata Service 10-reverse-dns - Uses reverse DNS lookup to resolve the hostname -dogtag runs the resolvers in /var/bottlerocket/dogtag in reverse alphanumerical order until one of them returns a hostname, at which point it will exit early and print the returned hostname to stdout. +dogtag runs the detectors in /usr/libexec/hostname-detectors in reverse alphanumerical order until one of them returns a hostname, +at which point it will exit early and print the returned hostname to stdout. If none of the detectors detect the hostname the +ip address is returned. */ use argh::FromArgs; use log::debug; use snafu::ResultExt; +use std::net::IpAddr; use std::{path::PathBuf, process}; use walkdir::WalkDir; -const DOGTAG_BIN_PATH: &str = "/var/bottlerocket/dogtag"; +const DOGTAG_BIN_PATH: &str = "/usr/libexec/hostname-detectors"; /// Cli defines the standard cmdline interface for all hostname handlers #[derive(FromArgs)] @@ -27,10 +31,10 @@ pub struct Cli { pub type Result = std::result::Result; -/// find_hostname will utilize the helpers located in /var/bottlerocket/dogtag/ to try and discover the hostname -pub async fn find_hostname() -> Result { +/// find_hostname will utilize the helpers located in /usr/libexec/hostname-detectors to try and discover the hostname +pub async fn find_hostname(ip_addr: IpAddr) -> Result { debug!( - "attempting to discover hostname helpers in {}", + "attempting to discover hostname detectors in {}", DOGTAG_BIN_PATH ); // We want to do reverse sort as we want to prioritize higher numbers first @@ -50,6 +54,8 @@ pub async fn find_hostname() -> Result { for helper in hostname_helpers.iter() { let output = process::Command::new(helper) + .arg("--ip-address") + .arg(ip_addr.to_string()) .output() .map(Some) .unwrap_or(None); @@ -61,7 +67,8 @@ pub async fn find_hostname() -> Result { } } } - Err(error::Error::NoHelper {}) + // If we fail to find a hostname return the provided ip address sanitized + Ok(ip_addr.to_string().replace(':', "-")) } pub mod error { diff --git a/sources/api/netdog/.gitignore b/sources/netdog/.gitignore similarity index 100% rename from sources/api/netdog/.gitignore rename to sources/netdog/.gitignore diff --git a/sources/api/netdog/Cargo.toml b/sources/netdog/Cargo.toml similarity index 79% rename from sources/api/netdog/Cargo.toml rename to sources/netdog/Cargo.toml index d38d22c7ed3..df3d00d3397 100644 --- a/sources/api/netdog/Cargo.toml +++ b/sources/netdog/Cargo.toml @@ -8,11 +8,14 @@ publish = false # Don't rebuild crate just because of changes to README. exclude = ["README.md"] +[features] +default = [] +wicked = [] + [dependencies] argh = "0.1" -dns-lookup = "2" +dogtag = { version = "0.1", path = "../dogtag" } ipnet = { version = "2", features = ["serde"] } -imdsclient = { path = "../../imdsclient", version = "0.1" } indexmap = { version = "1", features = ["serde"] } envy = "0.4" lazy_static = "1" @@ -25,7 +28,6 @@ serde_json = "1" serde_plain = "1" snafu = "0.8" tokio = { version = "~1.32", default-features = false, features = ["macros", "rt-multi-thread", "time"] } # LTS -tokio-retry = "0.3" toml = { version = "0.8", features = ["preserve_order"] } [dev-dependencies] @@ -33,5 +35,4 @@ tempfile = "3" handlebars = "4" [build-dependencies] -bottlerocket-variant = { version = "0.1", path = "../../bottlerocket-variant" } -generate-readme = { version = "0.1", path = "../../generate-readme" } +generate-readme = { version = "0.1", path = "../generate-readme" } diff --git a/sources/api/netdog/README.md b/sources/netdog/README.md similarity index 100% rename from sources/api/netdog/README.md rename to sources/netdog/README.md diff --git a/sources/api/netdog/README.tpl b/sources/netdog/README.tpl similarity index 100% rename from sources/api/netdog/README.tpl rename to sources/netdog/README.tpl diff --git a/sources/netdog/build.rs b/sources/netdog/build.rs new file mode 100644 index 00000000000..5b3a661c3f5 --- /dev/null +++ b/sources/netdog/build.rs @@ -0,0 +1,3 @@ +fn main() { + generate_readme::from_main().unwrap(); +} diff --git a/sources/api/netdog/src/addressing/dhcp.rs b/sources/netdog/src/addressing/dhcp.rs similarity index 100% rename from sources/api/netdog/src/addressing/dhcp.rs rename to sources/netdog/src/addressing/dhcp.rs diff --git a/sources/api/netdog/src/addressing/mod.rs b/sources/netdog/src/addressing/mod.rs similarity index 100% rename from sources/api/netdog/src/addressing/mod.rs rename to sources/netdog/src/addressing/mod.rs diff --git a/sources/api/netdog/src/addressing/static_address.rs b/sources/netdog/src/addressing/static_address.rs similarity index 100% rename from sources/api/netdog/src/addressing/static_address.rs rename to sources/netdog/src/addressing/static_address.rs diff --git a/sources/api/netdog/src/bonding.rs b/sources/netdog/src/bonding.rs similarity index 100% rename from sources/api/netdog/src/bonding.rs rename to sources/netdog/src/bonding.rs diff --git a/sources/netdog/src/cli/generate_hostname.rs b/sources/netdog/src/cli/generate_hostname.rs new file mode 100644 index 00000000000..1f3fea591cf --- /dev/null +++ b/sources/netdog/src/cli/generate_hostname.rs @@ -0,0 +1,28 @@ +use super::{error, print_json, Result}; +use crate::CURRENT_IP; +use argh::FromArgs; +use dogtag::find_hostname; +use snafu::ResultExt; +use std::fs; +use std::net::IpAddr; +use std::str::FromStr; + +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand, name = "generate-hostname")] +/// Generate hostname from installed hostname resolvers +pub(crate) struct GenerateHostnameArgs {} + +/// Attempt to convert the assigned IP address to a valid hostname +/// +/// The result is returned as JSON. (intended for use as a settings generator) +pub(crate) async fn run() -> Result<()> { + let ip_string = fs::read_to_string(CURRENT_IP) + .context(error::CurrentIpReadFailedSnafu { path: CURRENT_IP })?; + let ip = IpAddr::from_str(&ip_string).context(error::IpFromStringSnafu { ip: &ip_string })?; + let hostname = find_hostname(ip) + .await + .context(error::HostnameDetectionSnafu)?; + + // sundog expects JSON-serialized output + print_json(hostname) +} diff --git a/sources/api/netdog/src/cli/generate_net_config.rs b/sources/netdog/src/cli/generate_net_config.rs similarity index 97% rename from sources/api/netdog/src/cli/generate_net_config.rs rename to sources/netdog/src/cli/generate_net_config.rs index f2500ef039d..4d40afd857c 100644 --- a/sources/api/netdog/src/cli/generate_net_config.rs +++ b/sources/netdog/src/cli/generate_net_config.rs @@ -7,7 +7,7 @@ use snafu::{OptionExt, ResultExt}; use std::fs; use std::path::Path; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd::config::{NetworkDConfigFile, NETWORKD_CONFIG_DIR}; #[derive(FromArgs, PartialEq, Debug)] @@ -66,7 +66,7 @@ fn write_primary_interface(interface_id: &InterfaceId) -> Result<()> { }) } -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] fn write_network_config_files(net_config: Box, from_cmd_line: bool) -> Result<()> { let mut wicked_interfaces = net_config.as_wicked_interfaces(); for interface in &mut wicked_interfaces { @@ -85,7 +85,7 @@ fn write_network_config_files(net_config: Box, from_cmd_line: bo Ok(()) } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] fn write_network_config_files(net_config: Box, from_cmd_line: bool) -> Result<()> { fs::create_dir_all(NETWORKD_CONFIG_DIR).context(error::CreateDirSnafu { path: NETWORKD_CONFIG_DIR, diff --git a/sources/api/netdog/src/cli/install.rs b/sources/netdog/src/cli/install.rs similarity index 100% rename from sources/api/netdog/src/cli/install.rs rename to sources/netdog/src/cli/install.rs diff --git a/sources/api/netdog/src/cli/mod.rs b/sources/netdog/src/cli/mod.rs similarity index 93% rename from sources/api/netdog/src/cli/mod.rs rename to sources/netdog/src/cli/mod.rs index df824feb7df..21e99e5b218 100644 --- a/sources/api/netdog/src/cli/mod.rs +++ b/sources/netdog/src/cli/mod.rs @@ -4,12 +4,12 @@ pub(crate) mod node_ip; pub(crate) mod set_hostname; pub(crate) mod write_resolv_conf; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] pub(crate) mod install; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] pub(crate) mod remove; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] pub(crate) mod write_network_status; use crate::net_config::{self, Interfaces}; @@ -30,12 +30,12 @@ use std::process::Command; use std::{fs, io}; pub(crate) use write_resolv_conf::WriteResolvConfArgs; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] pub(crate) use install::InstallArgs; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] pub(crate) use remove::RemoveArgs; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] pub(crate) use write_network_status::WriteNetworkStatusArgs; #[derive(Debug, PartialEq, Deserialize)] @@ -159,7 +159,7 @@ where let mut output = String::new(); writeln!(output, "{}", ipv4_rp_filter).context(error::SysctlConfBuildSnafu)?; - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] // systemd-networkd implements its own RA client, and expects the kernel implementation to be // unused. However, various solutions that run in EC2 might "helpfully" turn it on since it's // required for most non-systemd-networkd systems. Guard against this by explicitly disabling @@ -228,7 +228,9 @@ mod tests { let fake_file = tempfile::NamedTempFile::new().unwrap(); let expected = "-net.ipv4.conf.eno1.rp_filter = 2\n"; write_interface_sysctl(interface, &fake_file).unwrap(); - assert_eq!(std::fs::read_to_string(&fake_file).unwrap(), expected); + assert!(std::fs::read_to_string(&fake_file) + .unwrap() + .starts_with(expected)); } } @@ -240,17 +242,17 @@ mod error { use std::io; use std::path::PathBuf; - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] use crate::{lease, wicked}; - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] use crate::{networkd, networkd_status}; #[derive(Debug, Snafu)] #[snafu(visibility(pub(crate)))] #[allow(clippy::enum_variant_names)] pub(crate) enum Error { - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to create directory '{}': {}", path.display(),source))] CreateDir { path: PathBuf, source: io::Error }, @@ -266,18 +268,18 @@ mod error { #[snafu(display("Failed to read/parse DNS settings from DHCP lease: {}", source))] DnsFromLease { source: dns::Error }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to create interface drop-in directory '{}': {}", path.display(), source))] DropInDirCreate { path: PathBuf, source: io::Error }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to write interface drop-in '{}': {}", path.display(), source))] DropInFileWrite { path: PathBuf, source: io::Error }, #[snafu(display("'systemd-sysctl' failed: {}", stderr))] FailedSystemdSysctl { stderr: String }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("'systemctl' failed: {}", stderr))] FailedSystemctl { stderr: String }, @@ -287,10 +289,13 @@ mod error { #[snafu(display("Failed to discern primary interface"))] GetPrimaryInterface, + #[snafu(display("Failed to detect hostname: {}", source))] + HostnameDetection { source: dogtag::error::Error }, + #[snafu(display("Failed to write hostname to '{}': {}", path.display(), source))] HostnameWriteFailed { path: PathBuf, source: io::Error }, - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] #[snafu(display("Failed to write network interface configuration: {}", source))] InterfaceConfigWrite { source: wicked::Error }, @@ -312,7 +317,7 @@ mod error { source: serde_json::error::Error, }, - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] #[snafu(display("Failed to read/parse lease data: {}", source))] LeaseParseFailed { source: lease::Error }, @@ -328,11 +333,11 @@ mod error { #[snafu(display("Unable to find an interface with MAC address '{}'", mac))] NonExistentMac { mac: String }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to create systemd-networkd config: {}", source))] NetworkDConfigCreate { source: net_config::Error }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Failed to write network interface configuration: {}", source))] NetworkDConfigWrite { source: networkd::Error }, @@ -366,17 +371,17 @@ mod error { #[snafu(display("Failed to run 'systemd-sysctl': {}", source))] SystemdSysctlExecution { source: io::Error }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Failed to run 'systemctl': {}", source))] SystemctlExecution { source: io::Error }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Failed to retrieve networkctl status: {}", source))] NetworkDInterfaceStatus { source: networkd_status::NetworkDStatusError, }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to determine primary interface IP Address: {}", source))] PrimaryInterfaceAddress { source: networkd_status::NetworkDStatusError, diff --git a/sources/api/netdog/src/cli/node_ip.rs b/sources/netdog/src/cli/node_ip.rs similarity index 100% rename from sources/api/netdog/src/cli/node_ip.rs rename to sources/netdog/src/cli/node_ip.rs diff --git a/sources/api/netdog/src/cli/remove.rs b/sources/netdog/src/cli/remove.rs similarity index 100% rename from sources/api/netdog/src/cli/remove.rs rename to sources/netdog/src/cli/remove.rs diff --git a/sources/api/netdog/src/cli/set_hostname.rs b/sources/netdog/src/cli/set_hostname.rs similarity index 100% rename from sources/api/netdog/src/cli/set_hostname.rs rename to sources/netdog/src/cli/set_hostname.rs diff --git a/sources/api/netdog/src/cli/write_network_status.rs b/sources/netdog/src/cli/write_network_status.rs similarity index 100% rename from sources/api/netdog/src/cli/write_network_status.rs rename to sources/netdog/src/cli/write_network_status.rs diff --git a/sources/api/netdog/src/cli/write_resolv_conf.rs b/sources/netdog/src/cli/write_resolv_conf.rs similarity index 91% rename from sources/api/netdog/src/cli/write_resolv_conf.rs rename to sources/netdog/src/cli/write_resolv_conf.rs index 81256ff420a..e7098875c3d 100644 --- a/sources/api/netdog/src/cli/write_resolv_conf.rs +++ b/sources/netdog/src/cli/write_resolv_conf.rs @@ -3,22 +3,22 @@ use crate::dns::DnsSettings; use argh::FromArgs; use snafu::ResultExt; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::lease::{dhcp_lease_path, LeaseInfo}; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::cli::Command; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use snafu::ensure; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] static SYSTEMCTL: &str = "/usr/bin/systemctl"; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::cli::fetch_net_config; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd::config::NETWORKD_CONFIG_DIR; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use std::{fs, path::Path}; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use systemd_derive::{SystemdUnit, SystemdUnitSection}; #[derive(FromArgs, PartialEq, Debug)] @@ -27,7 +27,7 @@ use systemd_derive::{SystemdUnit, SystemdUnitSection}; pub(crate) struct WriteResolvConfArgs {} /// A struct representing an interface drop-in that overrides DNS-via-DHCP settings -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnit)] struct InterfaceDNSDropIn { network: Option, @@ -36,7 +36,7 @@ struct InterfaceDNSDropIn { ipv6_accept_ra: Option, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnitSection)] #[systemd(section = "Network")] struct NetworkSection { @@ -44,7 +44,7 @@ struct NetworkSection { dns_default_route: Option, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnitSection)] #[systemd(section = "DHCPv4")] struct Dhcp4Section { @@ -54,7 +54,7 @@ struct Dhcp4Section { use_domains: Option, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnitSection)] #[systemd(section = "DHCPv6")] struct Dhcp6Section { @@ -64,7 +64,7 @@ struct Dhcp6Section { use_domains: Option, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnitSection)] #[systemd(section = "IPv6AcceptRA")] struct IPv6AcceptRASection { @@ -74,7 +74,7 @@ struct IPv6AcceptRASection { use_domains: Option, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] impl InterfaceDNSDropIn { /// Given API DNS settings create an appropriate drop-in for a network interface. fn new(settings: &DnsSettings, is_primary: bool) -> Self { @@ -117,7 +117,7 @@ impl InterfaceDNSDropIn { // corresponding values in the DHCP lease. If we don't, then we want to use the values from DHCP. // Toggle this functionality via a networkd interface drop-in. Also write the global settings from // the API as a systemd-resolved drop-in. -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] fn handle_dns_settings(primary_interface: String) -> Result<()> { let dns_settings = DnsSettings::from_config().context(error::GetDnsSettingsSnafu)?; @@ -180,7 +180,7 @@ fn handle_dns_settings(primary_interface: String) -> Result<()> { // Use DNS API settings if they exist, supplementing any missing settings with settings derived // from the primary interface's DHCP lease if it exists. Static leases don't contain any DNS // data, so don't bother looking there. -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] fn handle_dns_settings(primary_interface: String) -> Result<()> { let primary_lease_path = dhcp_lease_path(primary_interface); let dns_settings = if let Some(primary_lease_path) = primary_lease_path { diff --git a/sources/api/netdog/src/dns.rs b/sources/netdog/src/dns.rs similarity index 93% rename from sources/api/netdog/src/dns.rs rename to sources/netdog/src/dns.rs index a9a59560be5..68477891608 100644 --- a/sources/api/netdog/src/dns.rs +++ b/sources/netdog/src/dns.rs @@ -10,18 +10,18 @@ use std::fs; use std::net::IpAddr; use std::path::Path; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::lease::LeaseInfo; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::REAL_RESOLV_CONF; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use std::fmt::Write; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use systemd_derive::{SystemdUnit, SystemdUnitSection}; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] static RESOLVED_CONF_DROPIN_DIR: &str = "/etc/systemd/resolved.conf.d"; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] static RESOLVED_CONF_DROPIN_FILE: &str = "10-resolv.conf"; static DNS_CONFIG: &str = "/etc/netdog.toml"; @@ -37,7 +37,7 @@ pub(crate) struct DnsSettings { impl DnsSettings { /// Create a DnsSettings from TOML config file, supplementing missing settings with settings /// from DHCP lease if provided. (In the case of static addressing, a DHCP lease won't exist) - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] pub(crate) fn from_config_or_lease(lease: Option<&LeaseInfo>) -> Result { let mut settings = Self::from_config()?; if let Some(lease) = lease { @@ -47,7 +47,7 @@ impl DnsSettings { } /// Merge missing DNS settings into `self` using DHCP lease - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn merge_lease(&mut self, lease: &LeaseInfo) { if self.nameservers.is_none() { self.nameservers = lease.dns_servers.clone(); @@ -96,12 +96,12 @@ impl DnsSettings { } /// Write resolver configuration for libc. - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] pub(crate) fn write_resolv_conf(&self) -> Result<()> { Self::write_resolv_conf_impl(self, REAL_RESOLV_CONF) } - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn write_resolv_conf_impl

(&self, path: P) -> Result<()> where P: AsRef, @@ -128,7 +128,7 @@ impl DnsSettings { } /// Write a drop-in file for systemd-resolved - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] pub(crate) fn write_resolved_dropin(&self) -> Result<()> { fs::create_dir_all(RESOLVED_CONF_DROPIN_DIR).context(error::CreateDirSnafu { path: RESOLVED_CONF_DROPIN_DIR, @@ -138,7 +138,7 @@ impl DnsSettings { Self::write_resolved_dropin_impl(self, dropin_path) } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn write_resolved_dropin_impl

(&self, path: P) -> Result<()> where P: AsRef, @@ -150,24 +150,24 @@ impl DnsSettings { .context(error::ResolvConfWriteFailedSnafu { path }) } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] pub(crate) fn has_name_servers(&self) -> bool { self.nameservers.is_some() } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] pub(crate) fn has_search_domains(&self) -> bool { self.search.is_some() } } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnit)] struct ResolvedConfDropin { resolve: Option, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] #[derive(Debug, SystemdUnitSection)] #[systemd(section = "Resolve")] struct ResolveSection { @@ -177,7 +177,7 @@ struct ResolveSection { domains: Vec, } -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] impl ResolvedConfDropin { fn from_dns_settings(dns: &DnsSettings) -> Self { let domains = if let Some(domains) = &dns.search { @@ -210,7 +210,7 @@ mod error { #[derive(Debug, Snafu)] #[snafu(visibility(pub(crate)))] pub(crate) enum Error { - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to create directory '{}': {}", path.display(),source))] CreateDir { path: PathBuf, source: io::Error }, @@ -276,7 +276,7 @@ mod tests { } #[test] - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn dns_from_lease_file() { let lease_path = test_data().join("leaseinfo.eth0.dhcp.ipv4"); let lease = LeaseInfo::from_lease(lease_path).unwrap(); @@ -295,7 +295,7 @@ mod tests { } #[test] - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn write_resolv_conf_from_lease_single_nameserver() { let lease_path = test_data().join("leaseinfo.eth0.dhcp.ipv4"); let lease = LeaseInfo::from_lease(lease_path).unwrap(); @@ -310,7 +310,7 @@ mod tests { } #[test] - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn write_resolv_conf_from_lease_multiple_nameservers() { let lease_path = test_data().join("leaseinfo.eth0.dhcp.ipv4.multiple-dns"); let lease = LeaseInfo::from_lease(lease_path).unwrap(); @@ -333,7 +333,7 @@ mod tests { } #[test] - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn write_resolv_conf_from_config_multiple_nameservers() { let fake_file = tempfile::NamedTempFile::new().unwrap(); let config = test_data().join("netdog.toml"); @@ -351,7 +351,7 @@ mod tests { } #[test] - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn write_resolved_dropin_single_nameserver() { let fake_file = tempfile::NamedTempFile::new().unwrap(); let config = test_data().join("single_nameserver_netdog.toml"); @@ -364,7 +364,7 @@ mod tests { } #[test] - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn write_resolved_dropin_multiple_domains() { let fake_file = tempfile::NamedTempFile::new().unwrap(); let config = test_data().join("multiple_domains_netdog.toml"); @@ -377,7 +377,7 @@ mod tests { } #[test] - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn write_resolved_dropin_multiple_domains_nameservers() { let fake_file = tempfile::NamedTempFile::new().unwrap(); let config = test_data().join("netdog.toml"); diff --git a/sources/api/netdog/src/interface_id.rs b/sources/netdog/src/interface_id.rs similarity index 100% rename from sources/api/netdog/src/interface_id.rs rename to sources/netdog/src/interface_id.rs diff --git a/sources/api/netdog/src/lease.rs b/sources/netdog/src/lease.rs similarity index 100% rename from sources/api/netdog/src/lease.rs rename to sources/netdog/src/lease.rs diff --git a/sources/api/netdog/src/main.rs b/sources/netdog/src/main.rs similarity index 89% rename from sources/api/netdog/src/main.rs rename to sources/netdog/src/main.rs index 0fa9dfa11c2..1b3e8ba6332 100644 --- a/sources/api/netdog/src/main.rs +++ b/sources/netdog/src/main.rs @@ -37,14 +37,14 @@ mod interface_id; mod net_config; mod vlan_id; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] mod lease; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] mod wicked; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] mod networkd; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] mod networkd_status; use argh::FromArgs; @@ -59,21 +59,21 @@ static DEFAULT_NET_CONFIG_FILE: &str = "/var/lib/bottlerocket/net.toml"; static OVERRIDE_NET_CONFIG_FILE: &str = "/var/lib/netdog/net.toml"; static PRIMARY_SYSCTL_CONF: &str = "/etc/sysctl.d/90-primary_interface.conf"; static SYSCTL_MARKER_FILE: &str = "/run/netdog/primary_sysctls_set"; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] static LEASE_DIR: &str = "/run/wicked"; static SYS_CLASS_NET: &str = "/sys/class/net"; static SYSTEMD_SYSCTL: &str = "/usr/lib/systemd/systemd-sysctl"; static NETDOG_RESOLV_CONF: &str = "/run/netdog/resolv.conf"; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] static REAL_RESOLV_CONF: &str = "/etc/resolv.conf"; // This is the path to systemd-resolved's generated simple resolv.conf; see // https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues for // the reasoning behind using this path. -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] static REAL_RESOLV_CONF: &str = "/run/systemd/resolve/resolv.conf"; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] static NETWORKCTL: &str = "/usr/bin/networkctl"; /// Stores user-supplied arguments. @@ -86,32 +86,32 @@ struct Args { #[derive(FromArgs, PartialEq, Debug)] #[argh(subcommand)] enum SubCommand { - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] Install(cli::InstallArgs), - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] Remove(cli::RemoveArgs), NodeIp(cli::NodeIpArgs), GenerateHostname(cli::GenerateHostnameArgs), GenerateNetConfig(cli::GenerateNetConfigArgs), SetHostname(cli::SetHostnameArgs), WriteResolvConf(cli::WriteResolvConfArgs), - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] WriteNetworkStatus(cli::WriteNetworkStatusArgs), } async fn run() -> cli::Result<()> { let args: Args = argh::from_env(); match args.subcommand { - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] SubCommand::Install(args) => cli::install::run(args)?, - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] SubCommand::Remove(args) => cli::remove::run(args)?, SubCommand::NodeIp(_) => cli::node_ip::run()?, SubCommand::GenerateHostname(_) => cli::generate_hostname::run().await?, SubCommand::GenerateNetConfig(_) => cli::generate_net_config::run()?, SubCommand::SetHostname(args) => cli::set_hostname::run(args)?, SubCommand::WriteResolvConf(_) => cli::write_resolv_conf::run()?, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] SubCommand::WriteNetworkStatus(_) => cli::write_network_status::run()?, } Ok(()) diff --git a/sources/api/netdog/src/net_config/devices/bond.rs b/sources/netdog/src/net_config/devices/bond.rs similarity index 100% rename from sources/api/netdog/src/net_config/devices/bond.rs rename to sources/netdog/src/net_config/devices/bond.rs diff --git a/sources/api/netdog/src/net_config/devices/interface.rs b/sources/netdog/src/net_config/devices/interface.rs similarity index 100% rename from sources/api/netdog/src/net_config/devices/interface.rs rename to sources/netdog/src/net_config/devices/interface.rs diff --git a/sources/api/netdog/src/net_config/devices/mod.rs b/sources/netdog/src/net_config/devices/mod.rs similarity index 100% rename from sources/api/netdog/src/net_config/devices/mod.rs rename to sources/netdog/src/net_config/devices/mod.rs diff --git a/sources/api/netdog/src/net_config/devices/vlan.rs b/sources/netdog/src/net_config/devices/vlan.rs similarity index 100% rename from sources/api/netdog/src/net_config/devices/vlan.rs rename to sources/netdog/src/net_config/devices/vlan.rs diff --git a/sources/api/netdog/src/net_config/error.rs b/sources/netdog/src/net_config/error.rs similarity index 95% rename from sources/api/netdog/src/net_config/error.rs rename to sources/netdog/src/net_config/error.rs index 52db3d25266..e477a1bb2ef 100644 --- a/sources/api/netdog/src/net_config/error.rs +++ b/sources/netdog/src/net_config/error.rs @@ -3,7 +3,7 @@ use snafu::Snafu; use std::io; use std::path::PathBuf; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd; #[derive(Debug, Snafu)] @@ -42,7 +42,7 @@ pub(crate) enum Error { #[snafu(display("Failed to parse network config: {}", source))] NetConfigParse { source: toml::de::Error }, - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] #[snafu(display("Unable to create systemd-networkd config: {}", source))] NetworkDConfigCreate { source: networkd::Error }, } diff --git a/sources/api/netdog/src/net_config/mod.rs b/sources/netdog/src/net_config/mod.rs similarity index 96% rename from sources/api/netdog/src/net_config/mod.rs rename to sources/netdog/src/net_config/mod.rs index 5c3145bfad5..1e8d75240b8 100644 --- a/sources/api/netdog/src/net_config/mod.rs +++ b/sources/netdog/src/net_config/mod.rs @@ -21,12 +21,12 @@ use std::path::Path; use std::str::FromStr; pub(crate) use v1::NetConfigV1; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::wicked::WickedInterface; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] pub(crate) use v1::NetInterfaceV1; static DEFAULT_INTERFACE_PREFIX: &str = "netdog.default-interface="; @@ -43,10 +43,10 @@ pub(crate) trait Interfaces { /// Converts the network config into a list of `WickedInterface` structs, suitable for writing /// to file - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn as_wicked_interfaces(&self) -> Vec; - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn as_networkd_config(&self) -> Result; } @@ -63,12 +63,12 @@ impl Interfaces for Box { (**self).interfaces() } - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn as_wicked_interfaces(&self) -> Vec { (**self).as_wicked_interfaces() } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn as_networkd_config(&self) -> Result { (**self).as_networkd_config() } diff --git a/sources/api/netdog/src/net_config/test_macros/basic.rs b/sources/netdog/src/net_config/test_macros/basic.rs similarity index 100% rename from sources/api/netdog/src/net_config/test_macros/basic.rs rename to sources/netdog/src/net_config/test_macros/basic.rs diff --git a/sources/api/netdog/src/net_config/test_macros/bonding.rs b/sources/netdog/src/net_config/test_macros/bonding.rs similarity index 100% rename from sources/api/netdog/src/net_config/test_macros/bonding.rs rename to sources/netdog/src/net_config/test_macros/bonding.rs diff --git a/sources/api/netdog/src/net_config/test_macros/dhcp.rs b/sources/netdog/src/net_config/test_macros/dhcp.rs similarity index 100% rename from sources/api/netdog/src/net_config/test_macros/dhcp.rs rename to sources/netdog/src/net_config/test_macros/dhcp.rs diff --git a/sources/api/netdog/src/net_config/test_macros/mod.rs b/sources/netdog/src/net_config/test_macros/mod.rs similarity index 100% rename from sources/api/netdog/src/net_config/test_macros/mod.rs rename to sources/netdog/src/net_config/test_macros/mod.rs diff --git a/sources/api/netdog/src/net_config/test_macros/static_address.rs b/sources/netdog/src/net_config/test_macros/static_address.rs similarity index 100% rename from sources/api/netdog/src/net_config/test_macros/static_address.rs rename to sources/netdog/src/net_config/test_macros/static_address.rs diff --git a/sources/api/netdog/src/net_config/test_macros/vlan.rs b/sources/netdog/src/net_config/test_macros/vlan.rs similarity index 100% rename from sources/api/netdog/src/net_config/test_macros/vlan.rs rename to sources/netdog/src/net_config/test_macros/vlan.rs diff --git a/sources/api/netdog/src/net_config/v1.rs b/sources/netdog/src/net_config/v1.rs similarity index 98% rename from sources/api/netdog/src/net_config/v1.rs rename to sources/netdog/src/net_config/v1.rs index a05e483d9f4..8f250375049 100644 --- a/sources/api/netdog/src/net_config/v1.rs +++ b/sources/netdog/src/net_config/v1.rs @@ -11,10 +11,10 @@ use snafu::{ensure, OptionExt, ResultExt}; use std::{collections::HashSet, str::FromStr}; use std::{convert::TryInto, ops::Deref}; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::wicked::{WickedDhcp4, WickedDhcp6, WickedInterface}; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd::NetworkDConfig; #[derive(Debug, Deserialize)] @@ -60,7 +60,7 @@ impl Interfaces for NetConfigV1 { .collect() } - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn as_wicked_interfaces(&self) -> Vec { let mut wicked_interfaces = Vec::with_capacity(self.interfaces.len()); for (name, config) in &self.interfaces { @@ -76,7 +76,7 @@ impl Interfaces for NetConfigV1 { wicked_interfaces } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn as_networkd_config(&self) -> Result { let devices = self.interfaces.clone().into_iter().collect(); NetworkDConfig::new(devices).context(error::NetworkDConfigCreateSnafu) diff --git a/sources/api/netdog/src/net_config/v2.rs b/sources/netdog/src/net_config/v2.rs similarity index 92% rename from sources/api/netdog/src/net_config/v2.rs rename to sources/netdog/src/net_config/v2.rs index ab7e9d27792..6edb769d8bb 100644 --- a/sources/api/netdog/src/net_config/v2.rs +++ b/sources/netdog/src/net_config/v2.rs @@ -8,14 +8,14 @@ use indexmap::IndexMap; use serde::Deserialize; use snafu::ensure; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::wicked::{ wicked_from, WickedDhcp4, WickedDhcp6, WickedInterface, WickedRoutes, WickedStaticAddress, }; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd::NetworkDConfig; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use snafu::ResultExt; #[derive(Debug, Deserialize)] @@ -44,7 +44,7 @@ impl Interfaces for NetConfigV2 { .collect() } - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn as_wicked_interfaces(&self) -> Vec { let mut wicked_interfaces = Vec::with_capacity(self.interfaces.len()); for (name, config) in &self.interfaces { @@ -56,7 +56,7 @@ impl Interfaces for NetConfigV2 { wicked_interfaces } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn as_networkd_config(&self) -> Result { let devices = self.interfaces.clone().into_iter().collect(); NetworkDConfig::new(devices).context(error::NetworkDConfigCreateSnafu) diff --git a/sources/api/netdog/src/net_config/v3.rs b/sources/netdog/src/net_config/v3.rs similarity index 96% rename from sources/api/netdog/src/net_config/v3.rs rename to sources/netdog/src/net_config/v3.rs index 54deca6a1d4..286de6ca194 100644 --- a/sources/api/netdog/src/net_config/v3.rs +++ b/sources/netdog/src/net_config/v3.rs @@ -9,12 +9,12 @@ use serde::Deserialize; use snafu::ensure; use std::collections::HashSet; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] use crate::wicked::{WickedInterface, WickedLinkConfig}; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use crate::networkd::NetworkDConfig; -#[cfg(net_backend = "systemd-networkd")] +#[cfg(not(feature = "wicked"))] use snafu::ResultExt; #[derive(Debug, Deserialize)] @@ -40,7 +40,7 @@ impl Interfaces for NetConfigV3 { self.net_devices.keys().cloned().collect() } - #[cfg(net_backend = "wicked")] + #[cfg(feature = "wicked")] fn as_wicked_interfaces(&self) -> Vec { let mut wicked_interfaces = Vec::new(); for (name, config) in &self.net_devices { @@ -69,7 +69,7 @@ impl Interfaces for NetConfigV3 { wicked_interfaces } - #[cfg(net_backend = "systemd-networkd")] + #[cfg(not(feature = "wicked"))] fn as_networkd_config(&self) -> Result { let devices = self.net_devices.clone().into_iter().collect(); NetworkDConfig::new(devices).context(error::NetworkDConfigCreateSnafu) diff --git a/sources/api/netdog/src/networkd/config/mod.rs b/sources/netdog/src/networkd/config/mod.rs similarity index 100% rename from sources/api/netdog/src/networkd/config/mod.rs rename to sources/netdog/src/networkd/config/mod.rs diff --git a/sources/api/netdog/src/networkd/config/netdev.rs b/sources/netdog/src/networkd/config/netdev.rs similarity index 99% rename from sources/api/netdog/src/networkd/config/netdev.rs rename to sources/netdog/src/networkd/config/netdev.rs index f3b6aa5d5a7..0b00a017311 100644 --- a/sources/api/netdog/src/networkd/config/netdev.rs +++ b/sources/netdog/src/networkd/config/netdev.rs @@ -142,7 +142,7 @@ impl Display for NetDevMacAddress { } impl NetDevConfig { - const FILE_EXT: &str = "netdev"; + const FILE_EXT: &'static str = "netdev"; /// Write the config to the proper directory with the proper prefix and file extention pub(crate) fn write_config_file>(&self, config_dir: P) -> Result<()> { diff --git a/sources/api/netdog/src/networkd/config/network.rs b/sources/netdog/src/networkd/config/network.rs similarity index 99% rename from sources/api/netdog/src/networkd/config/network.rs rename to sources/netdog/src/networkd/config/network.rs index db9fbcd8571..11f163bdb73 100644 --- a/sources/api/netdog/src/networkd/config/network.rs +++ b/sources/netdog/src/networkd/config/network.rs @@ -208,7 +208,7 @@ impl Display for KeepConfiguration { } impl NetworkConfig { - const FILE_EXT: &str = "network"; + const FILE_EXT: &'static str = "network"; fn new_with_name(name: InterfaceName) -> Self { Self { diff --git a/sources/api/netdog/src/networkd/conversions.rs b/sources/netdog/src/networkd/conversions.rs similarity index 100% rename from sources/api/netdog/src/networkd/conversions.rs rename to sources/netdog/src/networkd/conversions.rs diff --git a/sources/api/netdog/src/networkd/devices/bond.rs b/sources/netdog/src/networkd/devices/bond.rs similarity index 100% rename from sources/api/netdog/src/networkd/devices/bond.rs rename to sources/netdog/src/networkd/devices/bond.rs diff --git a/sources/api/netdog/src/networkd/devices/interface.rs b/sources/netdog/src/networkd/devices/interface.rs similarity index 100% rename from sources/api/netdog/src/networkd/devices/interface.rs rename to sources/netdog/src/networkd/devices/interface.rs diff --git a/sources/api/netdog/src/networkd/devices/mod.rs b/sources/netdog/src/networkd/devices/mod.rs similarity index 100% rename from sources/api/netdog/src/networkd/devices/mod.rs rename to sources/netdog/src/networkd/devices/mod.rs diff --git a/sources/api/netdog/src/networkd/devices/vlan.rs b/sources/netdog/src/networkd/devices/vlan.rs similarity index 100% rename from sources/api/netdog/src/networkd/devices/vlan.rs rename to sources/netdog/src/networkd/devices/vlan.rs diff --git a/sources/api/netdog/src/networkd/mod.rs b/sources/netdog/src/networkd/mod.rs similarity index 100% rename from sources/api/netdog/src/networkd/mod.rs rename to sources/netdog/src/networkd/mod.rs diff --git a/sources/api/netdog/src/networkd_status.rs b/sources/netdog/src/networkd_status.rs similarity index 100% rename from sources/api/netdog/src/networkd_status.rs rename to sources/netdog/src/networkd_status.rs diff --git a/sources/api/netdog/src/vlan_id.rs b/sources/netdog/src/vlan_id.rs similarity index 100% rename from sources/api/netdog/src/vlan_id.rs rename to sources/netdog/src/vlan_id.rs diff --git a/sources/api/netdog/src/wicked/bonding.rs b/sources/netdog/src/wicked/bonding.rs similarity index 100% rename from sources/api/netdog/src/wicked/bonding.rs rename to sources/netdog/src/wicked/bonding.rs diff --git a/sources/api/netdog/src/wicked/dhcp.rs b/sources/netdog/src/wicked/dhcp.rs similarity index 100% rename from sources/api/netdog/src/wicked/dhcp.rs rename to sources/netdog/src/wicked/dhcp.rs diff --git a/sources/api/netdog/src/wicked/mod.rs b/sources/netdog/src/wicked/mod.rs similarity index 99% rename from sources/api/netdog/src/wicked/mod.rs rename to sources/netdog/src/wicked/mod.rs index 188084216a5..c43fc581b46 100644 --- a/sources/api/netdog/src/wicked/mod.rs +++ b/sources/netdog/src/wicked/mod.rs @@ -322,7 +322,7 @@ mod error { type Result = std::result::Result; -#[cfg(net_backend = "wicked")] +#[cfg(feature = "wicked")] #[cfg(test)] mod tests { use super::*; diff --git a/sources/api/netdog/src/wicked/static_address.rs b/sources/netdog/src/wicked/static_address.rs similarity index 100% rename from sources/api/netdog/src/wicked/static_address.rs rename to sources/netdog/src/wicked/static_address.rs diff --git a/sources/api/netdog/src/wicked/vlan.rs b/sources/netdog/src/wicked/vlan.rs similarity index 100% rename from sources/api/netdog/src/wicked/vlan.rs rename to sources/netdog/src/wicked/vlan.rs diff --git a/sources/api/netdog/systemd-derive/Cargo.toml b/sources/netdog/systemd-derive/Cargo.toml similarity index 87% rename from sources/api/netdog/systemd-derive/Cargo.toml rename to sources/netdog/systemd-derive/Cargo.toml index f98af79fc59..027ddd4dde0 100644 --- a/sources/api/netdog/systemd-derive/Cargo.toml +++ b/sources/netdog/systemd-derive/Cargo.toml @@ -20,4 +20,4 @@ quote = "1" syn = { version = "2", default-features = false, features = ["derive"] } [build-dependencies] -generate-readme = { path = "../../../generate-readme", version = "0.1" } +generate-readme = { path = "../../generate-readme", version = "0.1" } diff --git a/sources/api/netdog/systemd-derive/README.md b/sources/netdog/systemd-derive/README.md similarity index 100% rename from sources/api/netdog/systemd-derive/README.md rename to sources/netdog/systemd-derive/README.md diff --git a/sources/api/netdog/systemd-derive/README.tpl b/sources/netdog/systemd-derive/README.tpl similarity index 100% rename from sources/api/netdog/systemd-derive/README.tpl rename to sources/netdog/systemd-derive/README.tpl diff --git a/sources/api/netdog/systemd-derive/build.rs b/sources/netdog/systemd-derive/build.rs similarity index 100% rename from sources/api/netdog/systemd-derive/build.rs rename to sources/netdog/systemd-derive/build.rs diff --git a/sources/api/netdog/systemd-derive/src/lib.rs b/sources/netdog/systemd-derive/src/lib.rs similarity index 100% rename from sources/api/netdog/systemd-derive/src/lib.rs rename to sources/netdog/systemd-derive/src/lib.rs diff --git a/sources/api/netdog/systemd-derive/tests/tests.rs b/sources/netdog/systemd-derive/tests/tests.rs similarity index 100% rename from sources/api/netdog/systemd-derive/tests/tests.rs rename to sources/netdog/systemd-derive/tests/tests.rs diff --git a/sources/api/netdog/test_data/cmdline/multiple_interfaces b/sources/netdog/test_data/cmdline/multiple_interfaces similarity index 100% rename from sources/api/netdog/test_data/cmdline/multiple_interfaces rename to sources/netdog/test_data/cmdline/multiple_interfaces diff --git a/sources/api/netdog/test_data/cmdline/no_interfaces b/sources/netdog/test_data/cmdline/no_interfaces similarity index 100% rename from sources/api/netdog/test_data/cmdline/no_interfaces rename to sources/netdog/test_data/cmdline/no_interfaces diff --git a/sources/api/netdog/test_data/cmdline/ok b/sources/netdog/test_data/cmdline/ok similarity index 100% rename from sources/api/netdog/test_data/cmdline/ok rename to sources/netdog/test_data/cmdline/ok diff --git a/sources/api/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4 b/sources/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4 similarity index 100% rename from sources/api/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4 rename to sources/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4 diff --git a/sources/api/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4.multiple-dns b/sources/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4.multiple-dns similarity index 100% rename from sources/api/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4.multiple-dns rename to sources/netdog/test_data/dns/leaseinfo.eth0.dhcp.ipv4.multiple-dns diff --git a/sources/api/netdog/test_data/dns/multiple_domains_netdog.toml b/sources/netdog/test_data/dns/multiple_domains_netdog.toml similarity index 100% rename from sources/api/netdog/test_data/dns/multiple_domains_netdog.toml rename to sources/netdog/test_data/dns/multiple_domains_netdog.toml diff --git a/sources/api/netdog/test_data/dns/netdog.toml b/sources/netdog/test_data/dns/netdog.toml similarity index 100% rename from sources/api/netdog/test_data/dns/netdog.toml rename to sources/netdog/test_data/dns/netdog.toml diff --git a/sources/api/netdog/test_data/dns/single_nameserver_netdog.toml b/sources/netdog/test_data/dns/single_nameserver_netdog.toml similarity index 100% rename from sources/api/netdog/test_data/dns/single_nameserver_netdog.toml rename to sources/netdog/test_data/dns/single_nameserver_netdog.toml diff --git a/sources/api/netdog/test_data/net_config.toml b/sources/netdog/test_data/net_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config.toml rename to sources/netdog/test_data/net_config.toml diff --git a/sources/api/netdog/test_data/net_config/basic/bad_version.toml b/sources/netdog/test_data/net_config/basic/bad_version.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/basic/bad_version.toml rename to sources/netdog/test_data/net_config/basic/bad_version.toml diff --git a/sources/api/netdog/test_data/net_config/basic/invalid_interface_config.toml b/sources/netdog/test_data/net_config/basic/invalid_interface_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/basic/invalid_interface_config.toml rename to sources/netdog/test_data/net_config/basic/invalid_interface_config.toml diff --git a/sources/api/netdog/test_data/net_config/basic/multiple_primary.toml b/sources/netdog/test_data/net_config/basic/multiple_primary.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/basic/multiple_primary.toml rename to sources/netdog/test_data/net_config/basic/multiple_primary.toml diff --git a/sources/api/netdog/test_data/net_config/basic/net_config.toml b/sources/netdog/test_data/net_config/basic/net_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/basic/net_config.toml rename to sources/netdog/test_data/net_config/basic/net_config.toml diff --git a/sources/api/netdog/test_data/net_config/basic/no_interfaces.toml b/sources/netdog/test_data/net_config/basic/no_interfaces.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/basic/no_interfaces.toml rename to sources/netdog/test_data/net_config/basic/no_interfaces.toml diff --git a/sources/api/netdog/test_data/net_config/basic/no_primary.toml b/sources/netdog/test_data/net_config/basic/no_primary.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/basic/no_primary.toml rename to sources/netdog/test_data/net_config/basic/no_primary.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/arpmon_no_targets.toml b/sources/netdog/test_data/net_config/bonding/arpmon_no_targets.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/arpmon_no_targets.toml rename to sources/netdog/test_data/net_config/bonding/arpmon_no_targets.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/both_monitoring.toml b/sources/netdog/test_data/net_config/bonding/both_monitoring.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/both_monitoring.toml rename to sources/netdog/test_data/net_config/bonding/both_monitoring.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/disabled_arpmon.toml b/sources/netdog/test_data/net_config/bonding/disabled_arpmon.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/disabled_arpmon.toml rename to sources/netdog/test_data/net_config/bonding/disabled_arpmon.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/disabled_miimon.toml b/sources/netdog/test_data/net_config/bonding/disabled_miimon.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/disabled_miimon.toml rename to sources/netdog/test_data/net_config/bonding/disabled_miimon.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/mac_as_identifier.toml b/sources/netdog/test_data/net_config/bonding/mac_as_identifier.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/mac_as_identifier.toml rename to sources/netdog/test_data/net_config/bonding/mac_as_identifier.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/mac_in_interfaces.toml b/sources/netdog/test_data/net_config/bonding/mac_in_interfaces.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/mac_in_interfaces.toml rename to sources/netdog/test_data/net_config/bonding/mac_in_interfaces.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/missing_kind.toml b/sources/netdog/test_data/net_config/bonding/missing_kind.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/missing_kind.toml rename to sources/netdog/test_data/net_config/bonding/missing_kind.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/net_config.toml b/sources/netdog/test_data/net_config/bonding/net_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/net_config.toml rename to sources/netdog/test_data/net_config/bonding/net_config.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/no_interfaces.toml b/sources/netdog/test_data/net_config/bonding/no_interfaces.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/no_interfaces.toml rename to sources/netdog/test_data/net_config/bonding/no_interfaces.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/no_monitoring.toml b/sources/netdog/test_data/net_config/bonding/no_monitoring.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/no_monitoring.toml rename to sources/netdog/test_data/net_config/bonding/no_monitoring.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/too_many_min_links.toml b/sources/netdog/test_data/net_config/bonding/too_many_min_links.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/too_many_min_links.toml rename to sources/netdog/test_data/net_config/bonding/too_many_min_links.toml diff --git a/sources/api/netdog/test_data/net_config/bonding/vlan_using_bond.toml b/sources/netdog/test_data/net_config/bonding/vlan_using_bond.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/bonding/vlan_using_bond.toml rename to sources/netdog/test_data/net_config/bonding/vlan_using_bond.toml diff --git a/sources/api/netdog/test_data/net_config/dhcp/dhcp4_missing_enabled.toml b/sources/netdog/test_data/net_config/dhcp/dhcp4_missing_enabled.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/dhcp/dhcp4_missing_enabled.toml rename to sources/netdog/test_data/net_config/dhcp/dhcp4_missing_enabled.toml diff --git a/sources/api/netdog/test_data/net_config/dhcp/dhcp6_missing_enabled.toml b/sources/netdog/test_data/net_config/dhcp/dhcp6_missing_enabled.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/dhcp/dhcp6_missing_enabled.toml rename to sources/netdog/test_data/net_config/dhcp/dhcp6_missing_enabled.toml diff --git a/sources/api/netdog/test_data/net_config/dhcp/invalid_dhcp4_options.toml b/sources/netdog/test_data/net_config/dhcp/invalid_dhcp4_options.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/dhcp/invalid_dhcp4_options.toml rename to sources/netdog/test_data/net_config/dhcp/invalid_dhcp4_options.toml diff --git a/sources/api/netdog/test_data/net_config/dhcp/invalid_dhcp6_options.toml b/sources/netdog/test_data/net_config/dhcp/invalid_dhcp6_options.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/dhcp/invalid_dhcp6_options.toml rename to sources/netdog/test_data/net_config/dhcp/invalid_dhcp6_options.toml diff --git a/sources/api/netdog/test_data/net_config/dhcp/invalid_dhcp_config.toml b/sources/netdog/test_data/net_config/dhcp/invalid_dhcp_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/dhcp/invalid_dhcp_config.toml rename to sources/netdog/test_data/net_config/dhcp/invalid_dhcp_config.toml diff --git a/sources/api/netdog/test_data/net_config/net_config.toml b/sources/netdog/test_data/net_config/net_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/net_config.toml rename to sources/netdog/test_data/net_config/net_config.toml diff --git a/sources/api/netdog/test_data/net_config/no_interfaces.toml b/sources/netdog/test_data/net_config/no_interfaces.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/no_interfaces.toml rename to sources/netdog/test_data/net_config/no_interfaces.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/dhcp_and_routes.toml b/sources/netdog/test_data/net_config/static_address/dhcp_and_routes.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/dhcp_and_routes.toml rename to sources/netdog/test_data/net_config/static_address/dhcp_and_routes.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/dhcp_and_static.toml b/sources/netdog/test_data/net_config/static_address/dhcp_and_static.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/dhcp_and_static.toml rename to sources/netdog/test_data/net_config/static_address/dhcp_and_static.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/invalid_static_config.toml b/sources/netdog/test_data/net_config/static_address/invalid_static_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/invalid_static_config.toml rename to sources/netdog/test_data/net_config/static_address/invalid_static_config.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/ipv4_in_static6.toml b/sources/netdog/test_data/net_config/static_address/ipv4_in_static6.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/ipv4_in_static6.toml rename to sources/netdog/test_data/net_config/static_address/ipv4_in_static6.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/ipv6_in_static4.toml b/sources/netdog/test_data/net_config/static_address/ipv6_in_static4.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/ipv6_in_static4.toml rename to sources/netdog/test_data/net_config/static_address/ipv6_in_static4.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/net_config.toml b/sources/netdog/test_data/net_config/static_address/net_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/net_config.toml rename to sources/netdog/test_data/net_config/static_address/net_config.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/no_dhcp_or_static.toml b/sources/netdog/test_data/net_config/static_address/no_dhcp_or_static.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/no_dhcp_or_static.toml rename to sources/netdog/test_data/net_config/static_address/no_dhcp_or_static.toml diff --git a/sources/api/netdog/test_data/net_config/static_address/routes_no_addresses.toml b/sources/netdog/test_data/net_config/static_address/routes_no_addresses.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/static_address/routes_no_addresses.toml rename to sources/netdog/test_data/net_config/static_address/routes_no_addresses.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/mac_as_identifier.toml b/sources/netdog/test_data/net_config/vlan/mac_as_identifier.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/mac_as_identifier.toml rename to sources/netdog/test_data/net_config/vlan/mac_as_identifier.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/mac_in_device.toml b/sources/netdog/test_data/net_config/vlan/mac_in_device.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/mac_in_device.toml rename to sources/netdog/test_data/net_config/vlan/mac_in_device.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/missing_kind.toml b/sources/netdog/test_data/net_config/vlan/missing_kind.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/missing_kind.toml rename to sources/netdog/test_data/net_config/vlan/missing_kind.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/net_config.toml b/sources/netdog/test_data/net_config/vlan/net_config.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/net_config.toml rename to sources/netdog/test_data/net_config/vlan/net_config.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/no_device.toml b/sources/netdog/test_data/net_config/vlan/no_device.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/no_device.toml rename to sources/netdog/test_data/net_config/vlan/no_device.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/no_id.toml b/sources/netdog/test_data/net_config/vlan/no_id.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/no_id.toml rename to sources/netdog/test_data/net_config/vlan/no_id.toml diff --git a/sources/api/netdog/test_data/net_config/vlan/oob_id.toml b/sources/netdog/test_data/net_config/vlan/oob_id.toml similarity index 100% rename from sources/api/netdog/test_data/net_config/vlan/oob_id.toml rename to sources/netdog/test_data/net_config/vlan/oob_id.toml diff --git a/sources/api/netdog/test_data/networkd/builder.toml b/sources/netdog/test_data/networkd/builder.toml similarity index 100% rename from sources/api/netdog/test_data/networkd/builder.toml rename to sources/netdog/test_data/networkd/builder.toml diff --git a/sources/api/netdog/test_data/networkd/has_search_domains_networkctl_output.json b/sources/netdog/test_data/networkd/has_search_domains_networkctl_output.json similarity index 100% rename from sources/api/netdog/test_data/networkd/has_search_domains_networkctl_output.json rename to sources/netdog/test_data/networkd/has_search_domains_networkctl_output.json diff --git a/sources/api/netdog/test_data/networkd/netdev/bond0.netdev b/sources/netdog/test_data/networkd/netdev/bond0.netdev similarity index 100% rename from sources/api/netdog/test_data/networkd/netdev/bond0.netdev rename to sources/netdog/test_data/networkd/netdev/bond0.netdev diff --git a/sources/api/netdog/test_data/networkd/netdev/bond1.netdev b/sources/netdog/test_data/networkd/netdev/bond1.netdev similarity index 100% rename from sources/api/netdog/test_data/networkd/netdev/bond1.netdev rename to sources/netdog/test_data/networkd/netdev/bond1.netdev diff --git a/sources/api/netdog/test_data/networkd/netdev/bond2.netdev b/sources/netdog/test_data/networkd/netdev/bond2.netdev similarity index 100% rename from sources/api/netdog/test_data/networkd/netdev/bond2.netdev rename to sources/netdog/test_data/networkd/netdev/bond2.netdev diff --git a/sources/api/netdog/test_data/networkd/netdev/mystaticvlan.netdev b/sources/netdog/test_data/networkd/netdev/mystaticvlan.netdev similarity index 100% rename from sources/api/netdog/test_data/networkd/netdev/mystaticvlan.netdev rename to sources/netdog/test_data/networkd/netdev/mystaticvlan.netdev diff --git a/sources/api/netdog/test_data/networkd/netdev/myvlan.netdev b/sources/netdog/test_data/networkd/netdev/myvlan.netdev similarity index 100% rename from sources/api/netdog/test_data/networkd/netdev/myvlan.netdev rename to sources/netdog/test_data/networkd/netdev/myvlan.netdev diff --git a/sources/api/netdog/test_data/networkd/netdev/vlancfgdev.netdev b/sources/netdog/test_data/networkd/netdev/vlancfgdev.netdev similarity index 100% rename from sources/api/netdog/test_data/networkd/netdev/vlancfgdev.netdev rename to sources/netdog/test_data/networkd/netdev/vlancfgdev.netdev diff --git a/sources/api/netdog/test_data/networkd/network/bond0.network b/sources/netdog/test_data/networkd/network/bond0.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/bond0.network rename to sources/netdog/test_data/networkd/network/bond0.network diff --git a/sources/api/netdog/test_data/networkd/network/bond1.network b/sources/netdog/test_data/networkd/network/bond1.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/bond1.network rename to sources/netdog/test_data/networkd/network/bond1.network diff --git a/sources/api/netdog/test_data/networkd/network/bond2.network b/sources/netdog/test_data/networkd/network/bond2.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/bond2.network rename to sources/netdog/test_data/networkd/network/bond2.network diff --git a/sources/api/netdog/test_data/networkd/network/c874a4d53265.network b/sources/netdog/test_data/networkd/network/c874a4d53265.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/c874a4d53265.network rename to sources/netdog/test_data/networkd/network/c874a4d53265.network diff --git a/sources/api/netdog/test_data/networkd/network/eno1-ra.network b/sources/netdog/test_data/networkd/network/eno1-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno1-ra.network rename to sources/netdog/test_data/networkd/network/eno1-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno1.network b/sources/netdog/test_data/networkd/network/eno1.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno1.network rename to sources/netdog/test_data/networkd/network/eno1.network diff --git a/sources/api/netdog/test_data/networkd/network/eno10-ra.network b/sources/netdog/test_data/networkd/network/eno10-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno10-ra.network rename to sources/netdog/test_data/networkd/network/eno10-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno10.network b/sources/netdog/test_data/networkd/network/eno10.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno10.network rename to sources/netdog/test_data/networkd/network/eno10.network diff --git a/sources/api/netdog/test_data/networkd/network/eno100.network b/sources/netdog/test_data/networkd/network/eno100.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno100.network rename to sources/netdog/test_data/networkd/network/eno100.network diff --git a/sources/api/netdog/test_data/networkd/network/eno1000.network b/sources/netdog/test_data/networkd/network/eno1000.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno1000.network rename to sources/netdog/test_data/networkd/network/eno1000.network diff --git a/sources/api/netdog/test_data/networkd/network/eno1001.network b/sources/netdog/test_data/networkd/network/eno1001.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno1001.network rename to sources/netdog/test_data/networkd/network/eno1001.network diff --git a/sources/api/netdog/test_data/networkd/network/eno11.network b/sources/netdog/test_data/networkd/network/eno11.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno11.network rename to sources/netdog/test_data/networkd/network/eno11.network diff --git a/sources/api/netdog/test_data/networkd/network/eno12.network b/sources/netdog/test_data/networkd/network/eno12.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno12.network rename to sources/netdog/test_data/networkd/network/eno12.network diff --git a/sources/api/netdog/test_data/networkd/network/eno13.network b/sources/netdog/test_data/networkd/network/eno13.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno13.network rename to sources/netdog/test_data/networkd/network/eno13.network diff --git a/sources/api/netdog/test_data/networkd/network/eno14.network b/sources/netdog/test_data/networkd/network/eno14.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno14.network rename to sources/netdog/test_data/networkd/network/eno14.network diff --git a/sources/api/netdog/test_data/networkd/network/eno15.network b/sources/netdog/test_data/networkd/network/eno15.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno15.network rename to sources/netdog/test_data/networkd/network/eno15.network diff --git a/sources/api/netdog/test_data/networkd/network/eno16.network b/sources/netdog/test_data/networkd/network/eno16.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno16.network rename to sources/netdog/test_data/networkd/network/eno16.network diff --git a/sources/api/netdog/test_data/networkd/network/eno17.network b/sources/netdog/test_data/networkd/network/eno17.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno17.network rename to sources/netdog/test_data/networkd/network/eno17.network diff --git a/sources/api/netdog/test_data/networkd/network/eno18.network b/sources/netdog/test_data/networkd/network/eno18.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno18.network rename to sources/netdog/test_data/networkd/network/eno18.network diff --git a/sources/api/netdog/test_data/networkd/network/eno19.network b/sources/netdog/test_data/networkd/network/eno19.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno19.network rename to sources/netdog/test_data/networkd/network/eno19.network diff --git a/sources/api/netdog/test_data/networkd/network/eno2-ra.network b/sources/netdog/test_data/networkd/network/eno2-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno2-ra.network rename to sources/netdog/test_data/networkd/network/eno2-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno2.network b/sources/netdog/test_data/networkd/network/eno2.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno2.network rename to sources/netdog/test_data/networkd/network/eno2.network diff --git a/sources/api/netdog/test_data/networkd/network/eno20.network b/sources/netdog/test_data/networkd/network/eno20.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno20.network rename to sources/netdog/test_data/networkd/network/eno20.network diff --git a/sources/api/netdog/test_data/networkd/network/eno21.network b/sources/netdog/test_data/networkd/network/eno21.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno21.network rename to sources/netdog/test_data/networkd/network/eno21.network diff --git a/sources/api/netdog/test_data/networkd/network/eno3.network b/sources/netdog/test_data/networkd/network/eno3.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno3.network rename to sources/netdog/test_data/networkd/network/eno3.network diff --git a/sources/api/netdog/test_data/networkd/network/eno4.network b/sources/netdog/test_data/networkd/network/eno4.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno4.network rename to sources/netdog/test_data/networkd/network/eno4.network diff --git a/sources/api/netdog/test_data/networkd/network/eno5-ra.network b/sources/netdog/test_data/networkd/network/eno5-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno5-ra.network rename to sources/netdog/test_data/networkd/network/eno5-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno5.network b/sources/netdog/test_data/networkd/network/eno5.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno5.network rename to sources/netdog/test_data/networkd/network/eno5.network diff --git a/sources/api/netdog/test_data/networkd/network/eno51.network b/sources/netdog/test_data/networkd/network/eno51.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno51.network rename to sources/netdog/test_data/networkd/network/eno51.network diff --git a/sources/api/netdog/test_data/networkd/network/eno52.network b/sources/netdog/test_data/networkd/network/eno52.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno52.network rename to sources/netdog/test_data/networkd/network/eno52.network diff --git a/sources/api/netdog/test_data/networkd/network/eno53.network b/sources/netdog/test_data/networkd/network/eno53.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno53.network rename to sources/netdog/test_data/networkd/network/eno53.network diff --git a/sources/api/netdog/test_data/networkd/network/eno54.network b/sources/netdog/test_data/networkd/network/eno54.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno54.network rename to sources/netdog/test_data/networkd/network/eno54.network diff --git a/sources/api/netdog/test_data/networkd/network/eno55.network b/sources/netdog/test_data/networkd/network/eno55.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno55.network rename to sources/netdog/test_data/networkd/network/eno55.network diff --git a/sources/api/netdog/test_data/networkd/network/eno56.network b/sources/netdog/test_data/networkd/network/eno56.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno56.network rename to sources/netdog/test_data/networkd/network/eno56.network diff --git a/sources/api/netdog/test_data/networkd/network/eno57.network b/sources/netdog/test_data/networkd/network/eno57.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno57.network rename to sources/netdog/test_data/networkd/network/eno57.network diff --git a/sources/api/netdog/test_data/networkd/network/eno6.network b/sources/netdog/test_data/networkd/network/eno6.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno6.network rename to sources/netdog/test_data/networkd/network/eno6.network diff --git a/sources/api/netdog/test_data/networkd/network/eno7-ra.network b/sources/netdog/test_data/networkd/network/eno7-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno7-ra.network rename to sources/netdog/test_data/networkd/network/eno7-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno7.network b/sources/netdog/test_data/networkd/network/eno7.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno7.network rename to sources/netdog/test_data/networkd/network/eno7.network diff --git a/sources/api/netdog/test_data/networkd/network/eno8-ra.network b/sources/netdog/test_data/networkd/network/eno8-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno8-ra.network rename to sources/netdog/test_data/networkd/network/eno8-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno8.network b/sources/netdog/test_data/networkd/network/eno8.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno8.network rename to sources/netdog/test_data/networkd/network/eno8.network diff --git a/sources/api/netdog/test_data/networkd/network/eno9-ra.network b/sources/netdog/test_data/networkd/network/eno9-ra.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno9-ra.network rename to sources/netdog/test_data/networkd/network/eno9-ra.network diff --git a/sources/api/netdog/test_data/networkd/network/eno9.network b/sources/netdog/test_data/networkd/network/eno9.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/eno9.network rename to sources/netdog/test_data/networkd/network/eno9.network diff --git a/sources/api/netdog/test_data/networkd/network/f874a4d53264.network b/sources/netdog/test_data/networkd/network/f874a4d53264.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/f874a4d53264.network rename to sources/netdog/test_data/networkd/network/f874a4d53264.network diff --git a/sources/api/netdog/test_data/networkd/network/f874a4d53265.network b/sources/netdog/test_data/networkd/network/f874a4d53265.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/f874a4d53265.network rename to sources/netdog/test_data/networkd/network/f874a4d53265.network diff --git a/sources/api/netdog/test_data/networkd/network/f874a4d53266.network b/sources/netdog/test_data/networkd/network/f874a4d53266.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/f874a4d53266.network rename to sources/netdog/test_data/networkd/network/f874a4d53266.network diff --git a/sources/api/netdog/test_data/networkd/network/mystaticvlan.network b/sources/netdog/test_data/networkd/network/mystaticvlan.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/mystaticvlan.network rename to sources/netdog/test_data/networkd/network/mystaticvlan.network diff --git a/sources/api/netdog/test_data/networkd/network/myvlan.network b/sources/netdog/test_data/networkd/network/myvlan.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/myvlan.network rename to sources/netdog/test_data/networkd/network/myvlan.network diff --git a/sources/api/netdog/test_data/networkd/network/vlancfgdev.network b/sources/netdog/test_data/networkd/network/vlancfgdev.network similarity index 100% rename from sources/api/netdog/test_data/networkd/network/vlancfgdev.network rename to sources/netdog/test_data/networkd/network/vlancfgdev.network diff --git a/sources/api/netdog/test_data/networkd/no_search_domains_networkctl_output.json b/sources/netdog/test_data/networkd/no_search_domains_networkctl_output.json similarity index 100% rename from sources/api/netdog/test_data/networkd/no_search_domains_networkctl_output.json rename to sources/netdog/test_data/networkd/no_search_domains_networkctl_output.json diff --git a/sources/api/netdog/test_data/wicked/bond0.xml b/sources/netdog/test_data/wicked/bond0.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/bond0.xml rename to sources/netdog/test_data/wicked/bond0.xml diff --git a/sources/api/netdog/test_data/wicked/bond1.xml b/sources/netdog/test_data/wicked/bond1.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/bond1.xml rename to sources/netdog/test_data/wicked/bond1.xml diff --git a/sources/api/netdog/test_data/wicked/bond2.xml b/sources/netdog/test_data/wicked/bond2.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/bond2.xml rename to sources/netdog/test_data/wicked/bond2.xml diff --git a/sources/api/netdog/test_data/wicked/c874a4d53265.xml b/sources/netdog/test_data/wicked/c874a4d53265.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/c874a4d53265.xml rename to sources/netdog/test_data/wicked/c874a4d53265.xml diff --git a/sources/api/netdog/test_data/wicked/eno1-ra.xml b/sources/netdog/test_data/wicked/eno1-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno1-ra.xml rename to sources/netdog/test_data/wicked/eno1-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno1.xml b/sources/netdog/test_data/wicked/eno1.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno1.xml rename to sources/netdog/test_data/wicked/eno1.xml diff --git a/sources/api/netdog/test_data/wicked/eno10-ra.xml b/sources/netdog/test_data/wicked/eno10-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno10-ra.xml rename to sources/netdog/test_data/wicked/eno10-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno10.xml b/sources/netdog/test_data/wicked/eno10.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno10.xml rename to sources/netdog/test_data/wicked/eno10.xml diff --git a/sources/api/netdog/test_data/wicked/eno1001.xml b/sources/netdog/test_data/wicked/eno1001.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno1001.xml rename to sources/netdog/test_data/wicked/eno1001.xml diff --git a/sources/api/netdog/test_data/wicked/eno11.xml b/sources/netdog/test_data/wicked/eno11.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno11.xml rename to sources/netdog/test_data/wicked/eno11.xml diff --git a/sources/api/netdog/test_data/wicked/eno12.xml b/sources/netdog/test_data/wicked/eno12.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno12.xml rename to sources/netdog/test_data/wicked/eno12.xml diff --git a/sources/api/netdog/test_data/wicked/eno13.xml b/sources/netdog/test_data/wicked/eno13.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno13.xml rename to sources/netdog/test_data/wicked/eno13.xml diff --git a/sources/api/netdog/test_data/wicked/eno14.xml b/sources/netdog/test_data/wicked/eno14.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno14.xml rename to sources/netdog/test_data/wicked/eno14.xml diff --git a/sources/api/netdog/test_data/wicked/eno15.xml b/sources/netdog/test_data/wicked/eno15.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno15.xml rename to sources/netdog/test_data/wicked/eno15.xml diff --git a/sources/api/netdog/test_data/wicked/eno16.xml b/sources/netdog/test_data/wicked/eno16.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno16.xml rename to sources/netdog/test_data/wicked/eno16.xml diff --git a/sources/api/netdog/test_data/wicked/eno17.xml b/sources/netdog/test_data/wicked/eno17.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno17.xml rename to sources/netdog/test_data/wicked/eno17.xml diff --git a/sources/api/netdog/test_data/wicked/eno18.xml b/sources/netdog/test_data/wicked/eno18.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno18.xml rename to sources/netdog/test_data/wicked/eno18.xml diff --git a/sources/api/netdog/test_data/wicked/eno19.xml b/sources/netdog/test_data/wicked/eno19.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno19.xml rename to sources/netdog/test_data/wicked/eno19.xml diff --git a/sources/api/netdog/test_data/wicked/eno2-ra.xml b/sources/netdog/test_data/wicked/eno2-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno2-ra.xml rename to sources/netdog/test_data/wicked/eno2-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno2.xml b/sources/netdog/test_data/wicked/eno2.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno2.xml rename to sources/netdog/test_data/wicked/eno2.xml diff --git a/sources/api/netdog/test_data/wicked/eno20.xml b/sources/netdog/test_data/wicked/eno20.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno20.xml rename to sources/netdog/test_data/wicked/eno20.xml diff --git a/sources/api/netdog/test_data/wicked/eno21.xml b/sources/netdog/test_data/wicked/eno21.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno21.xml rename to sources/netdog/test_data/wicked/eno21.xml diff --git a/sources/api/netdog/test_data/wicked/eno3.xml b/sources/netdog/test_data/wicked/eno3.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno3.xml rename to sources/netdog/test_data/wicked/eno3.xml diff --git a/sources/api/netdog/test_data/wicked/eno4.xml b/sources/netdog/test_data/wicked/eno4.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno4.xml rename to sources/netdog/test_data/wicked/eno4.xml diff --git a/sources/api/netdog/test_data/wicked/eno5-ra.xml b/sources/netdog/test_data/wicked/eno5-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno5-ra.xml rename to sources/netdog/test_data/wicked/eno5-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno5.xml b/sources/netdog/test_data/wicked/eno5.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno5.xml rename to sources/netdog/test_data/wicked/eno5.xml diff --git a/sources/api/netdog/test_data/wicked/eno51.xml b/sources/netdog/test_data/wicked/eno51.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno51.xml rename to sources/netdog/test_data/wicked/eno51.xml diff --git a/sources/api/netdog/test_data/wicked/eno52.xml b/sources/netdog/test_data/wicked/eno52.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno52.xml rename to sources/netdog/test_data/wicked/eno52.xml diff --git a/sources/api/netdog/test_data/wicked/eno53.xml b/sources/netdog/test_data/wicked/eno53.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno53.xml rename to sources/netdog/test_data/wicked/eno53.xml diff --git a/sources/api/netdog/test_data/wicked/eno54.xml b/sources/netdog/test_data/wicked/eno54.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno54.xml rename to sources/netdog/test_data/wicked/eno54.xml diff --git a/sources/api/netdog/test_data/wicked/eno55.xml b/sources/netdog/test_data/wicked/eno55.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno55.xml rename to sources/netdog/test_data/wicked/eno55.xml diff --git a/sources/api/netdog/test_data/wicked/eno56.xml b/sources/netdog/test_data/wicked/eno56.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno56.xml rename to sources/netdog/test_data/wicked/eno56.xml diff --git a/sources/api/netdog/test_data/wicked/eno57.xml b/sources/netdog/test_data/wicked/eno57.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno57.xml rename to sources/netdog/test_data/wicked/eno57.xml diff --git a/sources/api/netdog/test_data/wicked/eno6.xml b/sources/netdog/test_data/wicked/eno6.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno6.xml rename to sources/netdog/test_data/wicked/eno6.xml diff --git a/sources/api/netdog/test_data/wicked/eno7-ra.xml b/sources/netdog/test_data/wicked/eno7-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno7-ra.xml rename to sources/netdog/test_data/wicked/eno7-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno7.xml b/sources/netdog/test_data/wicked/eno7.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno7.xml rename to sources/netdog/test_data/wicked/eno7.xml diff --git a/sources/api/netdog/test_data/wicked/eno8-ra.xml b/sources/netdog/test_data/wicked/eno8-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno8-ra.xml rename to sources/netdog/test_data/wicked/eno8-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno8.xml b/sources/netdog/test_data/wicked/eno8.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno8.xml rename to sources/netdog/test_data/wicked/eno8.xml diff --git a/sources/api/netdog/test_data/wicked/eno9-ra.xml b/sources/netdog/test_data/wicked/eno9-ra.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno9-ra.xml rename to sources/netdog/test_data/wicked/eno9-ra.xml diff --git a/sources/api/netdog/test_data/wicked/eno9.xml b/sources/netdog/test_data/wicked/eno9.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/eno9.xml rename to sources/netdog/test_data/wicked/eno9.xml diff --git a/sources/api/netdog/test_data/wicked/f874a4d53264.xml b/sources/netdog/test_data/wicked/f874a4d53264.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/f874a4d53264.xml rename to sources/netdog/test_data/wicked/f874a4d53264.xml diff --git a/sources/api/netdog/test_data/wicked/f874a4d53265.xml b/sources/netdog/test_data/wicked/f874a4d53265.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/f874a4d53265.xml rename to sources/netdog/test_data/wicked/f874a4d53265.xml diff --git a/sources/api/netdog/test_data/wicked/f874a4d53266.xml b/sources/netdog/test_data/wicked/f874a4d53266.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/f874a4d53266.xml rename to sources/netdog/test_data/wicked/f874a4d53266.xml diff --git a/sources/api/netdog/test_data/wicked/mystaticvlan.xml b/sources/netdog/test_data/wicked/mystaticvlan.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/mystaticvlan.xml rename to sources/netdog/test_data/wicked/mystaticvlan.xml diff --git a/sources/api/netdog/test_data/wicked/myvlan.xml b/sources/netdog/test_data/wicked/myvlan.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/myvlan.xml rename to sources/netdog/test_data/wicked/myvlan.xml diff --git a/sources/api/netdog/test_data/wicked/vlancfgdev.xml b/sources/netdog/test_data/wicked/vlancfgdev.xml similarity index 100% rename from sources/api/netdog/test_data/wicked/vlancfgdev.xml rename to sources/netdog/test_data/wicked/vlancfgdev.xml diff --git a/variants/Cargo.lock b/variants/Cargo.lock index e9787a7d724..56d257fcde4 100644 --- a/variants/Cargo.lock +++ b/variants/Cargo.lock @@ -1058,6 +1058,15 @@ dependencies = [ name = "microcode" version = "0.1.0" +[[package]] +name = "netdog" +version = "0.1.0" +dependencies = [ + "glibc", + "systemd", + "wicked", +] + [[package]] name = "nvidia-container-toolkit" version = "0.1.0" @@ -1161,6 +1170,7 @@ dependencies = [ "libkcapi", "libstd-rust", "makedumpfile", + "netdog", "oci-add-hooks", "os", "policycoreutils", @@ -1169,7 +1179,6 @@ dependencies = [ "shim", "systemd", "util-linux", - "wicked", "xfsprogs", ]