Merge pull request #2697 from flatcar/dongsu/wa-linux-agent-main

overlay wa-linux-agent: apply patch to fix ssh public key override issue (main)
This commit is contained in:
Dongsu Park 2025-03-03 13:04:13 +01:00 committed by GitHub
commit 7e69d4cb42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 38 additions and 8 deletions

View File

@ -0,0 +1 @@
- azure: Fixed issue of wa-linux-agent overriding ssh public key from ignition configuration during provisioning ([flatcar/Flatcar#1661](https://github.com/flatcar/Flatcar/issues/1661))

View File

@ -0,0 +1 @@
- azure: wa-linux-agent ([2.12.0.4](https://github.com/Azure/WALinuxAgent/releases/tag/v2.12.0.4))

View File

@ -1 +1 @@
DIST wa-linux-agent-2.9.1.1.tar.gz 1986486 BLAKE2B ce630830886fe9bb729cfa7d92ac40bf158d26272b83e099fa2957928761642f84af2eef28ad691a076a89af6304f6ae67d7aa37ecf8629b3b973d083e619ae7 SHA512 3f44aecc16ac545db4b550586f168dbbdef34289aad6775973517bf645e5a1d486864c01e974f03a71b3e946c14e1ca140673a75c1cd602aac28725eaa68e83d
DIST wa-linux-agent-2.12.0.4.tar.gz 2143917 BLAKE2B 4c4091569c3fc302de81c1d8467f33f8e3e817387697c339e98eb8def3100939a9cd99044fb934f7b4ce0830ae626bb5501c60f76931a614fa1392fdcd179e20 SHA512 09cfa8072f705dd4c96dda9c6a0b24b6050fcb57a0ad9bd5307ec07c7bb8270e48c17fd0fcb13cc2c8ca59472ec60af1657b536089eb9f116ca77658f6112595

View File

@ -162,7 +162,7 @@ index 83123e3f..b9257a9b 100644
return DebianOSBaseUtil()
if distro_name in ("flatcar", "coreos") or distro_code_name in ("flatcar", "coreos"):
+ if Version(distro_version) >= Version("3550"):
+ if DistroVersion(distro_version) >= DistroVersion("3550"):
+ return FlatcarUtil()
return CoreOSUtil()
@ -251,15 +251,16 @@ index 00000000..eeaf25ce
+ time.sleep(wait)
+ else:
+ logger.warn("exceeded restart retries")
diff --git a/azurelinuxagent/common/persist_firewall_rules.py b/azurelinuxagent/common/persist_firewall_rules.py
diff --git a/azurelinuxagent/ga/persist_firewall_rules.py b/azurelinuxagent/ga/persist_firewall_rules.py
index 74b878ce..22562c96 100644
--- a/azurelinuxagent/common/persist_firewall_rules.py
+++ b/azurelinuxagent/common/persist_firewall_rules.py
@@ -35,6 +35,7 @@ class PersistFirewallRulesHandler(object):
--- a/azurelinuxagent/ga/persist_firewall_rules.py
+++ b/azurelinuxagent/ga/persist_firewall_rules.py
@@ -35,7 +35,7 @@ class PersistFirewallRulesHandler(object):
# Do not edit.
[Unit]
Description=Setup network rules for WALinuxAgent
+After=systemd-sysext.service
Description=Setup network rules for WALinuxAgent
-After=local-fs.target
+After=local-fs.target systemd-sysext.service
Before=network-pre.target
Wants=network-pre.target
DefaultDependencies=no

View File

@ -0,0 +1,26 @@
From 0c8db73c3567039e50ffa7447bb093ca812dedf6 Mon Sep 17 00:00:00 2001
Message-Id: <0c8db73c3567039e50ffa7447bb093ca812dedf6.1740577844.git.dpark@linux.microsoft.com>
From: Peyton Robertson <93797227+peytonr18@users.noreply.github.com>
Date: Tue, 28 Jan 2025 14:17:43 -0800
Subject: [PATCH] Applying patch to prevent ssh public key override (#3309)
---
azurelinuxagent/common/osutil/default.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py
index 584515dc..746c4363 100644
--- a/azurelinuxagent/common/osutil/default.py
+++ b/azurelinuxagent/common/osutil/default.py
@@ -346,7 +346,7 @@ GEN2_DEVICE_ID = 'f8b3781a-1e82-4818-a1c3-63d806ec15bb'
raise OSUtilError("Bad public key: {0}".format(value))
if not value.endswith("\n"):
value += "\n"
- fileutil.write_file(path, value)
+ fileutil.write_file(path, value, append=True)
elif thumbprint is not None:
lib_dir = conf.get_lib_dir()
crt_path = os.path.join(lib_dir, thumbprint + '.crt')
--
2.39.5

View File

@ -30,4 +30,5 @@ S="${WORKDIR}/WALinuxAgent-${PV}"
PATCHES=(
"${FILESDIR}/0001-flatcar-changes.patch"
"${FILESDIR}/0002-prevent-ssh-public-key-override.patch"
)