From 920e831126553e9459fa8d85c0eb0ccc52bc6cb7 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Wed, 11 Sep 2024 16:29:39 -0600 Subject: [PATCH 1/6] chore(actions): add packaging label for any branches modifying debian/* (#5693) --- .github/labeler.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index b17d7a4a131..59717315da9 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -5,3 +5,9 @@ documentation: - 'doc/**' - 'cloudinit/config/schemas/**' - base-branch: ['main'] +packaging: +- any: + - changed-files: + - any-glob-to-any-file: + - 'debian/**' + - base-branch: ['ubuntu/**'] From b88f91010cd0e4178ab1309c9f743af33a84e59d Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 12 Sep 2024 13:22:54 -0600 Subject: [PATCH 2/6] ci: fix labeler (#5697) --- .github/labeler.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 59717315da9..4b8e9af3fc3 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,7 @@ +# Changes to labeler do not run in pull requests because this only runs against +# the base branch by default +# +# https://github.com/actions/labeler/tree/main?tab=readme-ov-file#initial-set-up-of-the-labeler-action documentation: - all: - changed-files: @@ -10,4 +14,5 @@ packaging: - changed-files: - any-glob-to-any-file: - 'debian/**' - - base-branch: ['ubuntu/**'] + - base-branch: ['ubuntu/*'] + From 7a32eff8ab5bb888d909af9a7b64de56aeefdbba Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 12 Sep 2024 13:41:39 -0600 Subject: [PATCH 3/6] fix: use cross-distro netcat name (#5696) --- systemd/cloud-config.service.tmpl | 2 +- systemd/cloud-final.service.tmpl | 2 +- systemd/cloud-init-local.service.tmpl | 2 +- systemd/cloud-init-network.service.tmpl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/systemd/cloud-config.service.tmpl b/systemd/cloud-config.service.tmpl index 9067d6e4bc0..9713bbc9ac3 100644 --- a/systemd/cloud-config.service.tmpl +++ b/systemd/cloud-config.service.tmpl @@ -17,7 +17,7 @@ Type=oneshot # process has completed this stage. The output from the return socket is piped # into a shell so that the process can send a completion message (defaults to # "done", otherwise includes an error message) and an exit code to systemd. -ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/config.sock -s /run/cloud-init/share/config-return.sock | sh' +ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/config.sock -s /run/cloud-init/share/config-return.sock | sh' RemainAfterExit=yes TimeoutSec=0 diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl index 9fb2f681f73..3be7c40b92f 100644 --- a/systemd/cloud-final.service.tmpl +++ b/systemd/cloud-final.service.tmpl @@ -22,7 +22,7 @@ Type=oneshot # process has completed this stage. The output from the return socket is piped # into a shell so that the process can send a completion message (defaults to # "done", otherwise includes an error message) and an exit code to systemd. -ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/final.sock -s /run/cloud-init/share/final-return.sock | sh' +ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/final.sock -s /run/cloud-init/share/final-return.sock | sh' RemainAfterExit=yes TimeoutSec=0 {% if variant in ["almalinux", "cloudlinux", "rhel"] %} diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl index b0a534b8f9a..fc37c93b365 100644 --- a/systemd/cloud-init-local.service.tmpl +++ b/systemd/cloud-init-local.service.tmpl @@ -44,7 +44,7 @@ ExecStartPre=/usr/bin/touch /run/cloud-init/enabled # process has completed this stage. The output from the return socket is piped # into a shell so that the process can send a completion message (defaults to # "done", otherwise includes an error message) and an exit code to systemd. -ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/local.sock -s /run/cloud-init/share/local-return.sock | sh' +ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/local.sock -s /run/cloud-init/share/local-return.sock | sh' RemainAfterExit=yes TimeoutSec=0 diff --git a/systemd/cloud-init-network.service.tmpl b/systemd/cloud-init-network.service.tmpl index 6957b39f1ee..b1037b7cc26 100644 --- a/systemd/cloud-init-network.service.tmpl +++ b/systemd/cloud-init-network.service.tmpl @@ -53,7 +53,7 @@ Type=oneshot # process has completed this stage. The output from the return socket is piped # into a shell so that the process can send a completion message (defaults to # "done", otherwise includes an error message) and an exit code to systemd. -ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/network.sock -s /run/cloud-init/share/network-return.sock | sh' +ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/network.sock -s /run/cloud-init/share/network-return.sock | sh' RemainAfterExit=yes TimeoutSec=0 From a9c6b1407714b70c11b72b1c32489dacf4bc4000 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 12 Sep 2024 22:42:00 -0600 Subject: [PATCH 4/6] test: make verify_clean_boot respect return code by series (#5695) Include a workaround for GH Actions CI. Also update stdout / stderr output format. --- tests/integration_tests/util.py | 17 +++++++++++++---- tox.ini | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/integration_tests/util.py b/tests/integration_tests/util.py index 7c8055830d2..aa66b55c441 100644 --- a/tests/integration_tests/util.py +++ b/tests/integration_tests/util.py @@ -15,6 +15,7 @@ from cloudinit.subp import subp from tests.integration_tests.integration_settings import PLATFORM +from tests.integration_tests.releases import CURRENT_RELEASE, NOBLE LOG = logging.getLogger("integration_testing.util") @@ -347,15 +348,23 @@ def _verify_clean_boot( out = instance.execute("cloud-init status --long") assert 1 != out.return_code, ( f"Unexpected return code from `cloud-init status`. Expected rc=0 " - f"or rc=2, received rc={out.return_code}\nstdout: " - f"{out.stdout}\nstderr: {out.stderr}" + f"or rc=2, received rc={out.return_code}\nstdout:\n" + f"{out.stdout}\nstderr:\n{out.stderr}" ) else: # we know that we should have a return code of 2 out = instance.execute("cloud-init status --long") - assert 2 == out.return_code, ( + rc = 2 + if CURRENT_RELEASE < NOBLE and "main" != os.environ.get( + "GITHUB_BASE_REF" + ): + # Old releases return 0 for backwards compatibility + rc = 0 + assert rc == out.return_code, ( + # CI on main doen't patch out this behavior so despite running on + # old releases it behaves as tip of main does f"Unexpected return code from `cloud-init status`. " - f"Expected rc=2, received rc={out.return_code}\nstdout: " + f"Expected rc={rc}, received rc={out.return_code}\nstdout: " f"{out.stdout}\nstderr: {out.stderr}" ) schema = instance.execute("cloud-init schema --system --annotate") diff --git a/tox.ini b/tox.ini index c2ae17ca168..520467312ac 100644 --- a/tox.ini +++ b/tox.ini @@ -243,6 +243,7 @@ passenv = CLOUD_INIT_* SSH_AUTH_SOCK OS_* + GITHUB_* setenv = PYTEST_ADDOPTS="-m ci and not adhoc" From 290b0ccf685247dc9f5fe54fabbd3efb0a22b8ec Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Fri, 13 Sep 2024 08:17:27 -0600 Subject: [PATCH 5/6] refresh patches due to 7a32eff8 - d/p/no-single-process.patch --- debian/patches/no-single-process.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/patches/no-single-process.patch b/debian/patches/no-single-process.patch index 88e8621db37..5377d4f5de9 100644 --- a/debian/patches/no-single-process.patch +++ b/debian/patches/no-single-process.patch @@ -17,7 +17,7 @@ Last-Update: 2024-08-02 -# process has completed this stage. The output from the return socket is piped -# into a shell so that the process can send a completion message (defaults to -# "done", otherwise includes an error message) and an exit code to systemd. --ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/config.sock -s /run/cloud-init/share/config-return.sock | sh' +-ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/config.sock -s /run/cloud-init/share/config-return.sock | sh' +ExecStart=/usr/bin/cloud-init modules --mode=config RemainAfterExit=yes TimeoutSec=0 @@ -35,7 +35,7 @@ Last-Update: 2024-08-02 -# process has completed this stage. The output from the return socket is piped -# into a shell so that the process can send a completion message (defaults to -# "done", otherwise includes an error message) and an exit code to systemd. --ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/final.sock -s /run/cloud-init/share/final-return.sock | sh' +-ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/final.sock -s /run/cloud-init/share/final-return.sock | sh' +ExecStart=/usr/bin/cloud-init modules --mode=final RemainAfterExit=yes TimeoutSec=0 @@ -64,7 +64,7 @@ Last-Update: 2024-08-02 -# process has completed this stage. The output from the return socket is piped -# into a shell so that the process can send a completion message (defaults to -# "done", otherwise includes an error message) and an exit code to systemd. --ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/local.sock -s /run/cloud-init/share/local-return.sock | sh' +-ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/local.sock -s /run/cloud-init/share/local-return.sock | sh' +ExecStart=/usr/bin/cloud-init init --local RemainAfterExit=yes TimeoutSec=0 @@ -181,7 +181,7 @@ Last-Update: 2024-08-02 -# process has completed this stage. The output from the return socket is piped -# into a shell so that the process can send a completion message (defaults to -# "done", otherwise includes an error message) and an exit code to systemd. --ExecStart=sh -c 'echo "start" | nc.openbsd -Uu -W1 /run/cloud-init/share/network.sock -s /run/cloud-init/share/network-return.sock | sh' +-ExecStart=sh -c 'echo "start" | netcat -Uu -W1 /run/cloud-init/share/network.sock -s /run/cloud-init/share/network-return.sock | sh' -RemainAfterExit=yes -TimeoutSec=0 - From d348ceaa10e16b8fba2e5484333400c21bc639a5 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Fri, 13 Sep 2024 08:17:58 -0600 Subject: [PATCH 6/6] update changelog (new upstream snapshot) --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 736195cd3de..1cee0540f56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,9 +3,9 @@ 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-single-process.patch - * Upstream snapshot based on upstream/main at 313390f8. + * Upstream snapshot based on upstream/main at a9c6b140. - -- Chad Smith Wed, 11 Sep 2024 14:21:43 -0600 + -- Chad Smith Fri, 13 Sep 2024 08:17:58 -0600 cloud-init (24.3.1-0ubuntu0~22.04.1) jammy; urgency=medium