Skip to content

Commit

Permalink
Merge pull request #1978 from flatcar/kai/azure-hostname
Browse files Browse the repository at this point in the history
app-emulation/wa-linux-agent: Use networkctl to propagate hostname
  • Loading branch information
pothos authored May 3, 2024
2 parents cd849d6 + 6d6ffc0 commit f06ebd3
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 7382c63bb2c90a1173393faf093002341f830a09 Mon Sep 17 00:00:00 2001
From 948c6075656fde25703ba402f8cd94715feaa774 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Mon, 27 Feb 2023 15:59:21 +0100
Subject: [PATCH] flatcar changes
Expand All @@ -12,9 +12,9 @@ Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
.../common/persist_firewall_rules.py | 1 +
config/flatcar/waagent.conf | 122 ++++++++++++++++++
init/flatcar/10-waagent-sysext.conf | 2 +
init/flatcar/waagent.service | 30 +++++
init/flatcar/waagent.service | 31 +++++
setup.py | 20 ++-
9 files changed, 312 insertions(+), 43 deletions(-)
9 files changed, 313 insertions(+), 43 deletions(-)
create mode 100644 azurelinuxagent/common/osutil/coreoscommon.py
create mode 100644 azurelinuxagent/common/osutil/flatcar.py
create mode 100644 config/flatcar/waagent.conf
Expand Down Expand Up @@ -83,7 +83,7 @@ index 373727e2..63578932 100644
pass
diff --git a/azurelinuxagent/common/osutil/coreoscommon.py b/azurelinuxagent/common/osutil/coreoscommon.py
new file mode 100644
index 00000000..66eae16e
index 00000000..9008ff20
--- /dev/null
+++ b/azurelinuxagent/common/osutil/coreoscommon.py
@@ -0,0 +1,59 @@
Expand Down Expand Up @@ -169,10 +169,10 @@ index 83123e3f..b9257a9b 100644
if distro_name in ("suse", "sle_hpc", "sles", "opensuse"):
diff --git a/azurelinuxagent/common/osutil/flatcar.py b/azurelinuxagent/common/osutil/flatcar.py
new file mode 100644
index 00000000..e31b2923
index 00000000..eeaf25ce
--- /dev/null
+++ b/azurelinuxagent/common/osutil/flatcar.py
@@ -0,0 +1,80 @@
@@ -0,0 +1,78 @@
+#
+# Copyright 2023 Microsoft Corporation
+#
Expand Down Expand Up @@ -240,11 +240,9 @@ index 00000000..e31b2923
+ Restart an interface by bouncing the link. systemd-networkd observes
+ this event, and forces a renew of DHCP.
+ """
+ logger.info("not restarting interface {}".format(ifname))
+ return
+ retry_limit = retries + 1
+ for attempt in range(1, retry_limit):
+ return_code = shellutil.run("ip link set {0} down && ip link set {0} up".format(ifname))
+ return_code = shellutil.run("networkctl reconfigure {0}".format(ifname))
+ if return_code == 0:
+ return
+ logger.warn("failed to restart {0}: return code {1}".format(ifname, return_code))
Expand Down Expand Up @@ -403,7 +401,7 @@ index 00000000..f756dbc9
+Upholds=waagent.service
diff --git a/init/flatcar/waagent.service b/init/flatcar/waagent.service
new file mode 100644
index 00000000..d0d6f7c8
index 00000000..8d2c1f09
--- /dev/null
+++ b/init/flatcar/waagent.service
@@ -0,0 +1,31 @@
Expand Down Expand Up @@ -471,5 +469,5 @@ index 8f5d92b4..35400e09 100755
set_bin_files(data_files, dest=agent_bin_path)
set_conf_files(data_files, dest="/usr/share/defaults/waagent",
--
2.39.2
2.45.0

0 comments on commit f06ebd3

Please sign in to comment.