From f361e562cc209170f22a685e933e41684493b412 Mon Sep 17 00:00:00 2001 From: Robert Fairley Date: Fri, 21 Jun 2019 14:57:38 +0000 Subject: [PATCH] Update to 4.1.1 Also: Regenerate specfile using rust2rpm 10 with DynamicBuildRequires Signed-off-by: Robert Fairley --- .gitignore | 1 + 0001-Use-pnet_-subcrates.patch | 115 ------------------ ...-sshkeys-unit-on-supported-platforms.patch | 32 ----- ...stemd-add-comment-to-sshkeys-service.patch | 25 ---- afterburn-fix-metadata.diff | 27 +--- rust-afterburn.spec | 53 ++------ sources | 2 +- 7 files changed, 20 insertions(+), 235 deletions(-) delete mode 100644 0001-Use-pnet_-subcrates.patch delete mode 100644 0002-systemd-enable-sshkeys-unit-on-supported-platforms.patch delete mode 100644 0003-systemd-add-comment-to-sshkeys-service.patch diff --git a/.gitignore b/.gitignore index ade8b26..c88353a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /afterburn-4.1.0.crate +/afterburn-4.1.1.crate diff --git a/0001-Use-pnet_-subcrates.patch b/0001-Use-pnet_-subcrates.patch deleted file mode 100644 index 2f050b0..0000000 --- a/0001-Use-pnet_-subcrates.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 96d1972ca872559fc70ad847a53bf9e20417e505 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko -Date: Sun, 28 Apr 2019 10:43:24 +0200 -Subject: [PATCH] Use pnet_* subcrates - -Signed-off-by: Igor Gnatenko ---- - src/main.rs | 1 - - src/network.rs | 2 +- - src/providers/digitalocean/mod.rs | 2 +- - src/providers/packet/mod.rs | 2 +- - src/providers/vagrant_virtualbox/mod.rs | 6 +++--- - src/util/mod.rs | 4 ++-- - 6 files changed, 8 insertions(+), 9 deletions(-) - -diff --git a/src/main.rs b/src/main.rs -index 337f3da..9743425 100644 ---- a/src/main.rs -+++ b/src/main.rs -@@ -22,7 +22,6 @@ extern crate ipnetwork; - extern crate nix; - extern crate openssh_keys; - extern crate openssl; --extern crate pnet; - extern crate reqwest; - #[macro_use] - extern crate serde_derive; -diff --git a/src/network.rs b/src/network.rs -index f084a75..d12037d 100644 ---- a/src/network.rs -+++ b/src/network.rs -@@ -16,7 +16,7 @@ - //! interface unit files. All that is left is to write the resulting string to - //! the necessary unit. - --use pnet::util::MacAddr; -+use pnet_base::MacAddr; - use std::net::IpAddr; - use std::string::String; - use std::string::ToString; -diff --git a/src/providers/digitalocean/mod.rs b/src/providers/digitalocean/mod.rs -index eeaa7c2..e6ad868 100644 ---- a/src/providers/digitalocean/mod.rs -+++ b/src/providers/digitalocean/mod.rs -@@ -21,7 +21,7 @@ use std::str::FromStr; - use ipnetwork; - use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; - use openssh_keys::PublicKey; --use pnet::util::MacAddr; -+use pnet_base::MacAddr; - - use crate::errors::*; - use crate::network; -diff --git a/src/providers/packet/mod.rs b/src/providers/packet/mod.rs -index f471baf..3a42520 100644 ---- a/src/providers/packet/mod.rs -+++ b/src/providers/packet/mod.rs -@@ -23,7 +23,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; - use std::str::FromStr; - - use openssh_keys::PublicKey; --use pnet::util::MacAddr; -+use pnet_base::MacAddr; - - use crate::errors::*; - use crate::network::{self, Device, Interface, NetworkRoute, Section}; -diff --git a/src/providers/vagrant_virtualbox/mod.rs b/src/providers/vagrant_virtualbox/mod.rs -index e4d4109..5d5ee40 100644 ---- a/src/providers/vagrant_virtualbox/mod.rs -+++ b/src/providers/vagrant_virtualbox/mod.rs -@@ -21,7 +21,7 @@ use std::time::Duration; - - use hostname; - use openssh_keys::PublicKey; --use pnet; -+use pnet_datalink; - - use crate::errors::*; - use crate::network; -@@ -52,8 +52,8 @@ impl VagrantVirtualboxProvider { - Err("eth1 was not found!".into()) - } - -- fn find_eth1() -> Option { -- let mut ifaces = pnet::datalink::interfaces(); -+ fn find_eth1() -> Option { -+ let mut ifaces = pnet_datalink::interfaces(); - ifaces.retain(|i| i.name == "eth1"); - if !ifaces.is_empty() { - Some(ifaces[0].clone()) -diff --git a/src/util/mod.rs b/src/util/mod.rs -index 80ab3c7..daa49b1 100644 ---- a/src/util/mod.rs -+++ b/src/util/mod.rs -@@ -16,7 +16,7 @@ - - use crate::errors::*; - use crate::retry; --use pnet; -+use pnet_datalink; - use std::fs::File; - use std::io::{BufRead, BufReader, Read}; - use std::path::Path; -@@ -52,7 +52,7 @@ pub fn key_lookup(delim: char, key: &str, reader: R) -> Result Result { -- let interfaces = pnet::datalink::interfaces(); -+ let interfaces = pnet_datalink::interfaces(); - trace!("interfaces - {:?}", interfaces); - - retry::Retry::new() --- -2.21.0 - diff --git a/0002-systemd-enable-sshkeys-unit-on-supported-platforms.patch b/0002-systemd-enable-sshkeys-unit-on-supported-platforms.patch deleted file mode 100644 index aa489fb..0000000 --- a/0002-systemd-enable-sshkeys-unit-on-supported-platforms.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 25ed3f304937ef502cf0a2562f108511f927b70f Mon Sep 17 00:00:00 2001 -From: Robert Fairley -Date: Tue, 14 May 2019 17:22:14 -0400 -Subject: [PATCH] systemd: enable sshkeys unit on supported platforms - -Add `ConditionKernelCommandLine` triggering conditions so that -the `afterburn-sshkeys@.service` unit is enabled on supported -platforms only. - -Note this only adds conditions for platforms where the cloud -metadata provider is also identified through `ignition.platform.id`. - -Part of: https://github.com/coreos/fedora-coreos-tracker/issues/4 ---- - systemd/afterburn-sshkeys@.service.in | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/systemd/afterburn-sshkeys@.service.in b/systemd/afterburn-sshkeys@.service.in -index 3bc8ff4..f0677e0 100644 ---- a/systemd/afterburn-sshkeys@.service.in -+++ b/systemd/afterburn-sshkeys@.service.in -@@ -1,5 +1,10 @@ - [Unit] - Description=Afterburn (SSH Keys) -+ConditionKernelCommandLine=|ignition.platform.id=aws -+ConditionKernelCommandLine=|ignition.platform.id=azure -+ConditionKernelCommandLine=|ignition.platform.id=digitalocean -+ConditionKernelCommandLine=|ignition.platform.id=gcp -+ConditionKernelCommandLine=|ignition.platform.id=packet - - [Service] - Type=oneshot diff --git a/0003-systemd-add-comment-to-sshkeys-service.patch b/0003-systemd-add-comment-to-sshkeys-service.patch deleted file mode 100644 index eefb260..0000000 --- a/0003-systemd-add-comment-to-sshkeys-service.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 97e21b89edc80d52f2ddf0f34890752e0ab1c4b4 Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Fri, 17 May 2019 12:05:04 -0400 -Subject: [PATCH] systemd: add comment to sshkeys@.service - -This should help readers trying to piece together how SSH key -provisioning is wired up. ---- - systemd/afterburn-sshkeys@.service.in | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/systemd/afterburn-sshkeys@.service.in b/systemd/afterburn-sshkeys@.service.in -index f0677e0..f5a94d6 100644 ---- a/systemd/afterburn-sshkeys@.service.in -+++ b/systemd/afterburn-sshkeys@.service.in -@@ -1,5 +1,9 @@ - [Unit] - Description=Afterburn (SSH Keys) -+# Platforms which support SSH keys and provide a consistent source of metadata. -+# Platforms which support SSH keys but require selecting from multiple metadata -+# sources are not listed here; for those platforms, CT writes a drop-in which -+# adds the appropriate triggering condition and sets AFTERBURN_OPT_PROVIDER. - ConditionKernelCommandLine=|ignition.platform.id=aws - ConditionKernelCommandLine=|ignition.platform.id=azure - ConditionKernelCommandLine=|ignition.platform.id=digitalocean diff --git a/afterburn-fix-metadata.diff b/afterburn-fix-metadata.diff index be2aa12..3e05334 100644 --- a/afterburn-fix-metadata.diff +++ b/afterburn-fix-metadata.diff @@ -1,27 +1,10 @@ ---- afterburn-4.1.0/Cargo.toml 1970-01-01T00:00:00+00:00 -+++ afterburn-4.1.0/Cargo.toml 2019-06-05T00:15:37.660452+00:00 -@@ -56,7 +56,7 @@ - version = "0.3" - - [dependencies.nix] --version = "^0.13.0" -+version = "^0.14.0" - - [dependencies.openssh-keys] - version = "^0.4.1" -@@ -64,11 +64,14 @@ - [dependencies.openssl] - version = "^0.10.20" - --[dependencies.pnet] -+[dependencies.pnet_base] -+version = "0.22" -+ -+[dependencies.pnet_datalink] - version = "0.22" +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -71,7 +71,7 @@ version = "^0.22.0" + version = "^0.22.0" [dependencies.reqwest] --version = "^0.9.15" +-version = "^0.9.18" +version = "^0.9.13" [dependencies.serde] diff --git a/rust-afterburn.spec b/rust-afterburn.spec index f8d8924..42835b6 100644 --- a/rust-afterburn.spec +++ b/rust-afterburn.spec @@ -1,11 +1,12 @@ -# Generated by rust2rpm +# Generated by rust2rpm 10 %bcond_without check +%global __cargo_skip_build 0 %global crate afterburn Name: rust-%{crate} -Version: 4.1.0 -Release: 3%{?dist} +Version: 4.1.1 +Release: 1%{?dist} Summary: Simple cloud provider agent # Upstream license specification: Apache-2.0 @@ -13,51 +14,16 @@ License: ASL 2.0 URL: https://crates.io/crates/afterburn Source: %{crates_source} # Initial patched metadata -# * Switch to split version of pnet_* # * Downgrade reqwest to 0.9.13 temporarily -# * Bump nix to 0.14, https://github.com/coreos/afterburn/pull/221 Patch0: afterburn-fix-metadata.diff -# Finish splitting pnet_* -Patch0001: 0001-Use-pnet_-subcrates.patch -Patch0002: 0002-systemd-enable-sshkeys-unit-on-supported-platforms.patch -Patch0003: 0003-systemd-add-comment-to-sshkeys-service.patch ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging -BuildRequires: (crate(base64/default) >= 0.10.1 with crate(base64/default) < 0.11.0) -BuildRequires: (crate(byteorder/default) >= 1.3.0 with crate(byteorder/default) < 2.0.0) -BuildRequires: (crate(clap/default) >= 2.33.0 with crate(clap/default) < 3.0.0) -BuildRequires: (crate(error-chain) >= 0.12.0 with crate(error-chain) < 0.13.0) -BuildRequires: (crate(hostname/default) >= 0.1.0 with crate(hostname/default) < 0.2.0) -BuildRequires: (crate(ipnetwork/default) >= 0.14.0 with crate(ipnetwork/default) < 0.15.0) -BuildRequires: (crate(mime/default) >= 0.3.0 with crate(mime/default) < 0.4.0) -BuildRequires: (crate(nix/default) >= 0.14.0 with crate(nix/default) < 0.15.0) -BuildRequires: (crate(openssh-keys/default) >= 0.4.1 with crate(openssh-keys/default) < 0.5.0) -BuildRequires: (crate(openssl/default) >= 0.10.20 with crate(openssl/default) < 0.11.0) -BuildRequires: (crate(pnet_base/default) >= 0.22.0 with crate(pnet_base/default) < 0.23.0) -BuildRequires: (crate(pnet_datalink/default) >= 0.22.0 with crate(pnet_datalink/default) < 0.23.0) -BuildRequires: (crate(reqwest/default) >= 0.9.13 with crate(reqwest/default) < 0.10.0) -BuildRequires: (crate(serde-xml-rs/default) >= 0.3.0 with crate(serde-xml-rs/default) < 0.4.0) -BuildRequires: (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0) -BuildRequires: (crate(serde_derive/default) >= 1.0.0 with crate(serde_derive/default) < 2.0.0) -BuildRequires: (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0) -BuildRequires: (crate(slog-async/default) >= 2.1.0 with crate(slog-async/default) < 3.0.0) -BuildRequires: (crate(slog-scope/default) >= 4.1.0 with crate(slog-scope/default) < 4.2.0) -BuildRequires: (crate(slog-term/default) >= 2.2.0 with crate(slog-term/default) < 3.0.0) -BuildRequires: (crate(slog/default) >= 2.0.0 with crate(slog/default) < 3.0.0) -BuildRequires: (crate(slog/max_level_trace) >= 2.0.0 with crate(slog/max_level_trace) < 3.0.0) -BuildRequires: (crate(slog/release_max_level_info) >= 2.0.0 with crate(slog/release_max_level_info) < 3.0.0) -BuildRequires: (crate(tempdir/default) >= 0.3.0 with crate(tempdir/default) < 0.4.0) -BuildRequires: (crate(tempfile/default) >= 3.0.7 with crate(tempfile/default) < 4.0.0) -BuildRequires: (crate(users/default) >= 0.9.1 with crate(users/default) < 0.10.0) -%if %{with check} -BuildRequires: (crate(mockito/default) >= 0.17.0 with crate(mockito/default) < 0.18.0) -%endif BuildRequires: systemd -%global _description \ -A simple cloud provider agent. +%global _description %{expand: +Simple cloud provider agent.} %description %{_description} @@ -104,6 +70,9 @@ sed -e 's,@DEFAULT_INSTANCE@,core,' < \ systemd/afterburn-sshkeys@.service %cargo_prep +%generate_buildrequires +%cargo_generate_buildrequires + %build %cargo_build @@ -118,6 +87,10 @@ sed -e 's,@DEFAULT_INSTANCE@,core,' < \ %endif %changelog +* Fri Jun 21 2019 Robert Fairley - 4.1.1-1 +- Update to 4.1.1 +- Regenerate specfile using rust2rpm 10 with DynamicBuildRequires + * Wed Jun 05 2019 Josh Stone - 4.1.0-3 - Bump nix to 0.14 diff --git a/sources b/sources index 0537999..43a3d9d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (afterburn-4.1.0.crate) = 171f24befd2af780840d75be98d84130590a2a62c3c8a961c6c408ce561555084d6c8c19ca6746891175fe0fc597066cdaef23e22524fbc38866729102b47598 +SHA512 (afterburn-4.1.1.crate) = 22199a01c2fc9caf3333a69201f30ffe279ea28643d9849c1a1f649f23ac67a039a382eb92afc5c965e6574493904cf3c773beec2dcef69da965eb3448988e12