From 9925bcd7db6a96ab972d67e4ff9de13a1a9c87c9 Mon Sep 17 00:00:00 2001 From: Jon Maloy Date: Fri, 2 Feb 2024 13:55:59 -0500 Subject: [PATCH] * Fri Feb 02 2024 Jon Maloy - 23.4-3 - ci-fix-clean-stop-warning-when-running-clean-command-47.patch [RHEL-21530] - ci-test-jsonschema-Pin-jsonschema-version-4781.patch [RHEL-21530] - Resolves: RHEL-21530 ([RHEL-8.10]subp.py[WARNING]: skipping /etc/cloud/clean.d/README when do cloud-init clean) --- ...arning-when-running-clean-command-47.patch | 132 ++++++++++++++++++ ...onschema-Pin-jsonschema-version-4781.patch | 48 +++++++ cloud-init.spec | 13 +- 3 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 ci-fix-clean-stop-warning-when-running-clean-command-47.patch create mode 100644 ci-test-jsonschema-Pin-jsonschema-version-4781.patch diff --git a/ci-fix-clean-stop-warning-when-running-clean-command-47.patch b/ci-fix-clean-stop-warning-when-running-clean-command-47.patch new file mode 100644 index 0000000..636aff0 --- /dev/null +++ b/ci-fix-clean-stop-warning-when-running-clean-command-47.patch @@ -0,0 +1,132 @@ +From a622a094a1f497c87a66932382265c2dbf1b88a2 Mon Sep 17 00:00:00 2001 +From: d1r3ct0r +Date: Sat, 20 Jan 2024 02:11:47 +0300 +Subject: [PATCH 1/2] fix(clean): stop warning when running clean command + (#4761) + +RH-Author: Ani Sinha +RH-MergeRequest: 121: fix(clean): stop warning when running clean command (#4761) +RH-Jira: RHEL-21530 +RH-Acked-by: Cathy Avery +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Commit: [1/2] f7a20c627afabf00db20c80ecd6e7f577053863b + +When the clean command is run, runparts is called and README in +/etc/cloud/clean.d is not executable which leads to a warning. + +No longer deliver the README in our deb package, move content +to our online docs. Continue to deliver the /etc/cloud/clean.d +directory as it is used by installers like subiquity. + +Fixes: GH-4760 +(cherry picked from commit da08a260965e35fa63def1cd8b8b472f7c354ffe) + +There is a downstream only change that is squashed with the upstream commit. +The spec file under `redhat/` has been updated so as to not include +`/etc/cloud/clean.d/README` file. Otherwise, we shall see errors like the +following during the build process: + +`error: File not found: /builddir/build/.../etc/cloud/clean.d/README` + +After a rebase, we can only maintain the downstream spec file change as +the rest of it is clean cherry-pick from upstream. + +X-downstream-only: true +Signed-off-by: Ani Sinha +--- + config/clean.d/README | 18 ------------------ + doc/rtd/reference/cli.rst | 27 +++++++++++++++++++++++++++ + packages/redhat/cloud-init.spec.in | 1 - + packages/suse/cloud-init.spec.in | 1 - + 4 files changed, 27 insertions(+), 20 deletions(-) + delete mode 100644 config/clean.d/README + +diff --git a/config/clean.d/README b/config/clean.d/README +deleted file mode 100644 +index 9b0feebe..00000000 +--- a/config/clean.d/README ++++ /dev/null +@@ -1,18 +0,0 @@ +--- cloud-init's clean.d run-parts directory -- +- +-This directory is provided for third party applications which need +-additional configuration artifact cleanup from the filesystem when +-the command `cloud-init clean` is invoked. +- +-The `cloud-init clean` operation is typically performed by image creators +-when preparing a golden image for clone and redeployment. The clean command +-removes any cloud-init semaphores, allowing cloud-init to treat the next +-boot of this image as the "first boot". When the image is next booted +-cloud-init will performing all initial configuration based on any valid +-datasource meta-data and user-data. +- +-Any executable scripts in this subdirectory will be invoked in lexicographical +-order with run-parts by the command: sudo cloud-init clean. +- +-Typical format of such scripts would be a ##- like the following: +- /etc/cloud/clean.d/99-live-installer +diff --git a/doc/rtd/reference/cli.rst b/doc/rtd/reference/cli.rst +index 04e05c55..c36775a8 100644 +--- a/doc/rtd/reference/cli.rst ++++ b/doc/rtd/reference/cli.rst +@@ -83,6 +83,33 @@ re-run all stages as it did on first boot. + config files for ssh daemon. Argument `network` removes all generated + config files for network. `all` removes config files of all types. + ++.. note:: ++ ++ Cloud-init provides the directory :file:`/etc/cloud/clean.d/` for third party ++ applications which need additional configuration artifact cleanup from ++ the fileystem when the `clean` command is invoked. ++ ++ The :command:`clean` operation is typically performed by image creators ++ when preparing a golden image for clone and redeployment. The clean command ++ removes any cloud-init semaphores, allowing cloud-init to treat the next ++ boot of this image as the "first boot". When the image is next booted ++ cloud-init will performing all initial configuration based on any valid ++ datasource meta-data and user-data. ++ ++ Any executable scripts in this subdirectory will be invoked in lexicographical ++ order with run-parts when running the :command:`clean` command. ++ ++ Typical format of such scripts would be a ##- like the following: ++ :file:`/etc/cloud/clean.d/99-live-installer` ++ ++ An example of a script is: ++ ++ .. code-block:: bash ++ ++ sudo rm -rf /var/lib/installer_imgs/ ++ sudo rm -rf /var/log/installer/ ++ ++ + .. _cli_collect_logs: + + :command:`collect-logs` +diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in +index 97e95096..accfb1b6 100644 +--- a/packages/redhat/cloud-init.spec.in ++++ b/packages/redhat/cloud-init.spec.in +@@ -190,7 +190,6 @@ fi + # Configs + %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg + %dir %{_sysconfdir}/cloud/clean.d +-%config(noreplace) %{_sysconfdir}/cloud/clean.d/README + %dir %{_sysconfdir}/cloud/cloud.cfg.d + %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg + %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/README +diff --git a/packages/suse/cloud-init.spec.in b/packages/suse/cloud-init.spec.in +index 62a9129b..fae3c12b 100644 +--- a/packages/suse/cloud-init.spec.in ++++ b/packages/suse/cloud-init.spec.in +@@ -115,7 +115,6 @@ version_pys=$(cd "%{buildroot}" && find . -name version.py -type f) + + # Configs + %dir %{_sysconfdir}/cloud/clean.d +-%config(noreplace) %{_sysconfdir}/cloud/clean.d/README + %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg + %dir %{_sysconfdir}/cloud/cloud.cfg.d + %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg +-- +2.41.0 + diff --git a/ci-test-jsonschema-Pin-jsonschema-version-4781.patch b/ci-test-jsonschema-Pin-jsonschema-version-4781.patch new file mode 100644 index 0000000..fde374b --- /dev/null +++ b/ci-test-jsonschema-Pin-jsonschema-version-4781.patch @@ -0,0 +1,48 @@ +From c43791eeb00bc9000abff0125c18aa6a7e8b7160 Mon Sep 17 00:00:00 2001 +From: Brett Holman +Date: Tue, 16 Jan 2024 12:43:17 -0700 +Subject: [PATCH 2/2] test(jsonschema): Pin jsonschema version (#4781) + +RH-Author: Ani Sinha +RH-MergeRequest: 121: fix(clean): stop warning when running clean command (#4761) +RH-Jira: RHEL-21530 +RH-Acked-by: Cathy Avery +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Commit: [2/2] f864085d47723b3fb462c3b6fc6e24b90bf040aa + +Release 4.21.0 broke tests + +(cherry picked from commit 034a5cdf10582da0492321f861b2b8b42182a54e) +--- + requirements.txt | 2 +- + test-requirements.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/requirements.txt b/requirements.txt +index edec46a7..a095de18 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -28,7 +28,7 @@ requests + jsonpatch + + # For validating cloud-config sections per schema definitions +-jsonschema ++jsonschema<=4.20.0 + + # Used by DataSourceVMware to inspect the host's network configuration during + # the "setup()" function. +diff --git a/test-requirements.txt b/test-requirements.txt +index 19488b94..46a98b4c 100644 +--- a/test-requirements.txt ++++ b/test-requirements.txt +@@ -9,6 +9,6 @@ pytest!=7.3.2 + pytest-cov + pytest-mock + setuptools +-jsonschema ++jsonschema<=4.20.0 + responses + passlib +-- +2.41.0 + diff --git a/cloud-init.spec b/cloud-init.spec index bd2c2b1..0b39a84 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -6,7 +6,7 @@ Name: cloud-init Version: 23.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Cloud instance init scripts Group: System Environment/Base @@ -25,6 +25,10 @@ Patch14: ci-net-network_manager-do-not-set-may-fail-to-False-for.patch Patch15: ci-net-allow-dhcp6-configuration-from-generate_fallback.patch # For RHEL-17610 - [RHEL-8] NetworkManagerActivator brings up interface failed when using sysconfig renderer Patch16: ci-net-nm-check-for-presence-of-ifcfg-files-when-nm-con.patch +# For RHEL-21530 - [RHEL-8.10]subp.py[WARNING]: skipping /etc/cloud/clean.d/README when do cloud-init clean +Patch17: ci-fix-clean-stop-warning-when-running-clean-command-47.patch +# For RHEL-21530 - [RHEL-8.10]subp.py[WARNING]: skipping /etc/cloud/clean.d/README when do cloud-init clean +Patch18: ci-test-jsonschema-Pin-jsonschema-version-4781.patch BuildArch: noarch @@ -211,7 +215,6 @@ fi %dir %{_sysconfdir}/cloud/cloud.cfg.d %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg %doc %{_sysconfdir}/cloud/cloud.cfg.d/README -%doc %{_sysconfdir}/cloud/clean.d/README %dir %{_sysconfdir}/cloud/templates %config(noreplace) %{_sysconfdir}/cloud/templates/* %{_unitdir}/cloud-config.service @@ -241,6 +244,12 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog +* Fri Feb 02 2024 Jon Maloy - 23.4-3 +- ci-fix-clean-stop-warning-when-running-clean-command-47.patch [RHEL-21530] +- ci-test-jsonschema-Pin-jsonschema-version-4781.patch [RHEL-21530] +- Resolves: RHEL-21530 + ([RHEL-8.10]subp.py[WARNING]: skipping /etc/cloud/clean.d/README when do cloud-init clean) + * Tue Jan 16 2024 Jon Maloy - 23.4-2 - ci-net-network_manager-do-not-set-may-fail-to-False-for.patch [RHEL-7277] - ci-net-allow-dhcp6-configuration-from-generate_fallback.patch [RHEL-7277]