From 9a9023c9201f00bce0928dafa86ac0087b332cc7 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Tue, 17 Sep 2024 14:06:08 -0500 Subject: [PATCH 1/3] manually refresh patches --- debian/patches/no-single-process.patch | 16 +++++----- ...560d-cloud-config-after-snap-seeding.patch | 31 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/debian/patches/no-single-process.patch b/debian/patches/no-single-process.patch index 5377d4f5de9..23cdc08efa2 100644 --- a/debian/patches/no-single-process.patch +++ b/debian/patches/no-single-process.patch @@ -7,7 +7,7 @@ Last-Update: 2024-08-02 --- a/systemd/cloud-config.service.tmpl +++ b/systemd/cloud-config.service.tmpl @@ -10,14 +10,7 @@ - + [Service] Type=oneshot -# This service is a shim which preserves systemd ordering while allowing a @@ -21,11 +21,11 @@ Last-Update: 2024-08-02 +ExecStart=/usr/bin/cloud-init modules --mode=config RemainAfterExit=yes TimeoutSec=0 - + --- a/systemd/cloud-final.service.tmpl +++ b/systemd/cloud-final.service.tmpl @@ -15,16 +15,10 @@ - + [Service] Type=oneshot -# This service is a shim which preserves systemd ordering while allowing a @@ -40,9 +40,9 @@ Last-Update: 2024-08-02 RemainAfterExit=yes TimeoutSec=0 +KillMode=process - {% if variant in ["almalinux", "cloudlinux", "rhel"] %} - # Restart NetworkManager if it is present and running. - ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \ + TasksMax=infinity + + # Output needs to appear in instance console output --- a/systemd/cloud-init-local.service.tmpl +++ b/systemd/cloud-init-local.service.tmpl @@ -7,6 +7,7 @@ @@ -68,7 +68,7 @@ Last-Update: 2024-08-02 +ExecStart=/usr/bin/cloud-init init --local RemainAfterExit=yes TimeoutSec=0 - + --- a/systemd/cloud-init-main.service.tmpl +++ /dev/null @@ -1,51 +0,0 @@ @@ -294,7 +294,7 @@ Last-Update: 2024-08-02 --- a/systemd/cloud-config.target +++ b/systemd/cloud-config.target @@ -14,5 +14,5 @@ - + [Unit] Description=Cloud-config availability -Wants=cloud-init-local.service cloud-init-network.service diff --git a/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch b/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch index 256c8172209..4c69f6f3e6a 100644 --- a/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch +++ b/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch @@ -147,22 +147,21 @@ Last-Update: 2024-02-14 install = cc.distro.install_packages for backend, cmd, package in BACKEND_DEF: -@@ -88,23 +84,21 @@ class TestLxd(t_help.CiTestCase): - if backend == "lvm": - self.assertEqual( - [ +@@ -85,22 +81,14 @@ class TestLxd(t_help.CiTestCase): + subp.call_args_list, + ) + +- if backend == "lvm": +- self.assertEqual( +- [ - mock.call(sem_file), - mock.call( - "/lib/modules/mykernel/" - "kernel/drivers/md/dm-thin-pool.ko" -- ), -+ ) - ], - exists.call_args_list, - ) - else: +- ], +- exists.call_args_list, +- ) +- else: - self.assertEqual([mock.call(sem_file)], exists.call_args_list) - del_file(sem_file) ++ if backend != "lvm": + self.assertEqual([], exists.call_args_list) @mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default") @@ -174,7 +173,7 @@ Last-Update: 2024-02-14 cc.distro = mock.MagicMock() mock_subp.which.return_value = None cc_lxd.handle("cc_lxd", LXD_INIT_CFG, cc, []) -@@ -118,7 +112,7 @@ class TestLxd(t_help.CiTestCase): +@@ -114,7 +102,7 @@ class TestLxd(t_help.CiTestCase): @mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default") @mock.patch("cloudinit.config.cc_lxd.subp") def test_no_init_does_nothing(self, mock_subp, m_maybe_clean): @@ -183,7 +182,7 @@ Last-Update: 2024-02-14 cc.distro = mock.MagicMock() cc_lxd.handle("cc_lxd", {"lxd": {}}, cc, []) self.assertFalse(cc.distro.install_packages.called) -@@ -128,17 +122,16 @@ class TestLxd(t_help.CiTestCase): +@@ -124,17 +112,16 @@ class TestLxd(t_help.CiTestCase): @mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default") @mock.patch("cloudinit.config.cc_lxd.subp") def test_no_lxd_does_nothing(self, mock_subp, m_maybe_clean): @@ -204,7 +203,7 @@ Last-Update: 2024-02-14 cc.distro = mock.MagicMock() cc_lxd.handle( "cc_lxd", -@@ -153,7 +146,6 @@ class TestLxd(t_help.CiTestCase): +@@ -149,7 +136,6 @@ class TestLxd(t_help.CiTestCase): ], mock_subp.subp.call_args_list, ) From a0c84d507ad4c06de1dd97fe32e880a5bd1e2026 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Tue, 17 Sep 2024 14:06:35 -0500 Subject: [PATCH 2/3] refresh patches against upstream/main patches: debian/patches/no-nocloud-network.patch debian/patches/no-single-process.patch debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch --- debian/patches/no-nocloud-network.patch | 26 +++++++++---------- debian/patches/no-single-process.patch | 26 +++++++++---------- ...560d-cloud-config-after-snap-seeding.patch | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/debian/patches/no-nocloud-network.patch b/debian/patches/no-nocloud-network.patch index 69c0308d46b..6924e149f55 100644 --- a/debian/patches/no-nocloud-network.patch +++ b/debian/patches/no-nocloud-network.patch @@ -7,7 +7,7 @@ Last-Update: 2024-08-02 --- a/cloudinit/sources/DataSourceNoCloud.py +++ b/cloudinit/sources/DataSourceNoCloud.py -@@ -190,7 +190,7 @@ +@@ -190,7 +190,7 @@ class DataSourceNoCloud(sources.DataSour # This could throw errors, but the user told us to do it # so if errors are raised, let them raise @@ -16,7 +16,7 @@ Last-Update: 2024-08-02 LOG.debug("Using seeded cache data from %s", seedfrom) # Values in the command line override those from the seed -@@ -199,7 +199,6 @@ +@@ -199,7 +199,6 @@ class DataSourceNoCloud(sources.DataSour ) mydata["user-data"] = ud mydata["vendor-data"] = vd @@ -26,7 +26,7 @@ Last-Update: 2024-08-02 # Now that we have exhausted any other places merge in the defaults --- a/cloudinit/util.py +++ b/cloudinit/util.py -@@ -1059,7 +1059,6 @@ +@@ -1059,7 +1059,6 @@ def read_seeded(base="", ext="", timeout ud_url = base.replace("%s", "user-data" + ext) vd_url = base.replace("%s", "vendor-data" + ext) md_url = base.replace("%s", "meta-data" + ext) @@ -34,7 +34,7 @@ Last-Update: 2024-08-02 else: if features.NOCLOUD_SEED_URL_APPEND_FORWARD_SLASH: if base[-1] != "/" and parse.urlparse(base).query == "": -@@ -1068,17 +1067,7 @@ +@@ -1068,17 +1067,7 @@ def read_seeded(base="", ext="", timeout ud_url = "%s%s%s" % (base, "user-data", ext) vd_url = "%s%s%s" % (base, "vendor-data", ext) md_url = "%s%s%s" % (base, "meta-data", ext) @@ -54,7 +54,7 @@ Last-Update: 2024-08-02 ) --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py -@@ -2481,7 +2481,7 @@ +@@ -2481,7 +2481,7 @@ class TestReadOptionalSeed: { "meta-data": {"md": "val"}, "user-data": b"ud", @@ -63,7 +63,7 @@ Last-Update: 2024-08-02 "vendor-data": None, }, True, -@@ -2536,7 +2536,7 @@ +@@ -2536,7 +2536,7 @@ class TestReadSeeded: assert found_md == {"key1": "val1"} assert found_ud == ud assert found_vd == vd @@ -72,7 +72,7 @@ Last-Update: 2024-08-02 @pytest.mark.parametrize( "base, feature_flag, req_urls", -@@ -2545,7 +2545,6 @@ +@@ -2545,7 +2545,6 @@ class TestReadSeeded: "http://10.0.0.1/%s?qs=1", True, [ @@ -80,7 +80,7 @@ Last-Update: 2024-08-02 "http://10.0.0.1/meta-data?qs=1", "http://10.0.0.1/user-data?qs=1", "http://10.0.0.1/vendor-data?qs=1", -@@ -2556,7 +2555,6 @@ +@@ -2556,7 +2555,6 @@ class TestReadSeeded: "https://10.0.0.1:8008/", True, [ @@ -88,7 +88,7 @@ Last-Update: 2024-08-02 "https://10.0.0.1:8008/meta-data", "https://10.0.0.1:8008/user-data", "https://10.0.0.1:8008/vendor-data", -@@ -2567,7 +2565,6 @@ +@@ -2567,7 +2565,6 @@ class TestReadSeeded: "https://10.0.0.1:8008", True, [ @@ -96,7 +96,7 @@ Last-Update: 2024-08-02 "https://10.0.0.1:8008/meta-data", "https://10.0.0.1:8008/user-data", "https://10.0.0.1:8008/vendor-data", -@@ -2578,7 +2575,6 @@ +@@ -2578,7 +2575,6 @@ class TestReadSeeded: "https://10.0.0.1:8008", False, [ @@ -104,7 +104,7 @@ Last-Update: 2024-08-02 "https://10.0.0.1:8008meta-data", "https://10.0.0.1:8008user-data", "https://10.0.0.1:8008vendor-data", -@@ -2589,7 +2585,6 @@ +@@ -2589,7 +2585,6 @@ class TestReadSeeded: "https://10.0.0.1:8008?qs=", True, [ @@ -112,7 +112,7 @@ Last-Update: 2024-08-02 "https://10.0.0.1:8008?qs=meta-data", "https://10.0.0.1:8008?qs=user-data", "https://10.0.0.1:8008?qs=vendor-data", -@@ -2628,7 +2623,7 @@ +@@ -2628,7 +2623,7 @@ class TestReadSeeded: # user-data, vendor-data read raw. It could be scripts or other format assert found_ud == "/user-data: 1" assert found_vd == "/vendor-data: 1" @@ -121,7 +121,7 @@ Last-Update: 2024-08-02 assert [ mock.call(req_url, timeout=5, retries=10) for req_url in req_urls ] == m_read.call_args_list -@@ -2658,7 +2653,7 @@ +@@ -2658,7 +2653,7 @@ class TestReadSeededWithoutVendorData(he self.assertEqual(found_md, {"key1": "val1"}) self.assertEqual(found_ud, ud) self.assertEqual(found_vd, vd) diff --git a/debian/patches/no-single-process.patch b/debian/patches/no-single-process.patch index 23cdc08efa2..f94034faa75 100644 --- a/debian/patches/no-single-process.patch +++ b/debian/patches/no-single-process.patch @@ -6,8 +6,8 @@ Last-Update: 2024-08-02 --- a/systemd/cloud-config.service.tmpl +++ b/systemd/cloud-config.service.tmpl -@@ -10,14 +10,7 @@ - +@@ -10,14 +10,7 @@ ConditionEnvironment=!KERNEL_CMDLINE=clo + [Service] Type=oneshot -# This service is a shim which preserves systemd ordering while allowing a @@ -21,11 +21,11 @@ Last-Update: 2024-08-02 +ExecStart=/usr/bin/cloud-init modules --mode=config RemainAfterExit=yes TimeoutSec=0 - + --- a/systemd/cloud-final.service.tmpl +++ b/systemd/cloud-final.service.tmpl -@@ -15,16 +15,10 @@ - +@@ -15,16 +15,10 @@ ConditionEnvironment=!KERNEL_CMDLINE=clo + [Service] Type=oneshot -# This service is a shim which preserves systemd ordering while allowing a @@ -41,11 +41,11 @@ Last-Update: 2024-08-02 TimeoutSec=0 +KillMode=process TasksMax=infinity - + # Output needs to appear in instance console output --- a/systemd/cloud-init-local.service.tmpl +++ b/systemd/cloud-init-local.service.tmpl -@@ -7,6 +7,7 @@ +@@ -7,6 +7,7 @@ DefaultDependencies=no {% endif %} Wants=network-pre.target After=hv_kvp_daemon.service @@ -53,7 +53,7 @@ Last-Update: 2024-08-02 {% if variant in ["almalinux", "cloudlinux", "rhel"] %} Requires=dbus.socket After=dbus.socket -@@ -37,14 +38,7 @@ +@@ -37,14 +38,7 @@ ExecStartPre=/bin/mkdir -p /run/cloud-in ExecStartPre=/sbin/restorecon /run/cloud-init ExecStartPre=/usr/bin/touch /run/cloud-init/enabled {% endif %} @@ -68,7 +68,7 @@ Last-Update: 2024-08-02 +ExecStart=/usr/bin/cloud-init init --local RemainAfterExit=yes TimeoutSec=0 - + --- a/systemd/cloud-init-main.service.tmpl +++ /dev/null @@ -1,51 +0,0 @@ @@ -252,7 +252,7 @@ Last-Update: 2024-08-02 +WantedBy=cloud-init.target --- a/cloudinit/cmd/status.py +++ b/cloudinit/cmd/status.py -@@ -321,9 +321,8 @@ +@@ -321,9 +321,8 @@ def systemd_failed(wait: bool) -> bool: for service in [ "cloud-final.service", "cloud-config.service", @@ -265,7 +265,7 @@ Last-Update: 2024-08-02 stdout = query_systemctl( --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py -@@ -525,7 +525,7 @@ +@@ -525,7 +525,7 @@ def handle(name: str, cfg: Config, cloud # fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno uses_systemd = cloud.distro.uses_systemd() default_mount_options = ( @@ -294,7 +294,7 @@ Last-Update: 2024-08-02 --- a/systemd/cloud-config.target +++ b/systemd/cloud-config.target @@ -14,5 +14,5 @@ - + [Unit] Description=Cloud-config availability -Wants=cloud-init-local.service cloud-init-network.service @@ -303,7 +303,7 @@ Last-Update: 2024-08-02 +After=cloud-init-local.service cloud-init.service --- a/tests/unittests/config/test_cc_mounts.py +++ b/tests/unittests/config/test_cc_mounts.py -@@ -566,9 +566,9 @@ +@@ -566,9 +566,9 @@ class TestFstabHandling: LABEL=keepme none ext4 defaults 0 0 LABEL=UEFI /dev/sda4 /mnt2 auto nofail,comment=cloudconfig 1 2 diff --git a/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch b/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch index 4c69f6f3e6a..aea3afbc82f 100644 --- a/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch +++ b/debian/patches/revert-551f560d-cloud-config-after-snap-seeding.patch @@ -150,7 +150,7 @@ Last-Update: 2024-02-14 @@ -85,22 +81,14 @@ class TestLxd(t_help.CiTestCase): subp.call_args_list, ) - + - if backend == "lvm": - self.assertEqual( - [ From 7a45399192522322a06e6c3acb44dac2755d9d85 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Tue, 17 Sep 2024 14:13:40 -0500 Subject: [PATCH 3/3] update changelog --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1cee0540f56..9c557db0852 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ cloud-init (24.3.1-0ubuntu0~22.04.2) UNRELEASED; urgency=medium * refresh patches: - d/p/keep-dhclient-as-priority-client.patch + - d/p/no-nocloud-network.patch - d/p/no-single-process.patch - * Upstream snapshot based on upstream/main at a9c6b140. + - d/p/revert-551f560d-cloud-config-after-snap-seeding.patch + * Upstream snapshot based on upstream/main at df75b526.. -- Chad Smith Fri, 13 Sep 2024 08:17:58 -0600