fix(cloud-init): update cloud-init to correctly support azl4#16938
fix(cloud-init): update cloud-init to correctly support azl4#16938ddstreet wants to merge 4 commits intomicrosoft:tomls/base/mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the cloud-init component packaging for Azure Linux 4 by ensuring the rendered templates/configs are generated with an azurelinux variant and by patching upstream templates to recognize that variant.
Changes:
- Add a patch to include
azurelinuxin cloud-init’s systemd unit/generator templates. - Add a patch to adjust
cloud.cfgtemplate behavior forazurelinux(including default user handling) and update the related unit test. - Update
cloud-init.comp.tomloverlays to apply the new patches and to replace the spec’srender-template --variant ...invocation with--variant azurelinux.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| base/comps/cloud-init/cloud-init.comp.toml | Adds new Patch/file overlays and changes the spec search/replace to force --variant azurelinux. |
| base/comps/cloud-init/add-azurelinux-to-systemd-templates.patch | Extends systemd template conditionals to treat azurelinux like Fedora/RHEL-family variants where appropriate. |
| base/comps/cloud-init/update-cloud-cfg.patch | Adjusts cloud.cfg template logic for azurelinux and updates an upstream unit test expectation. |
| section = "%install" | ||
| regex = '%py3_install -- --init-system=systemd' | ||
| replacement = '%py3_install -- --init-system=systemd --distro=fedora' | ||
| regex = 'python3 tools/render-template --variant %{\?rhel:rhel}%{!\?rhel:fedora}' |
There was a problem hiding this comment.
The spec-search-replace regex contains RPM macro braces (%{...}) that are regex metacharacters. Unescaped { / } will cause most regex engines (including Rust/Python-style) to fail to compile the pattern, so this overlay may not apply at all. Escape the braces (and keep the ? escapes), or match the whole render-template line with a brace-free pattern anchored in %install.
| regex = 'python3 tools/render-template --variant %{\?rhel:rhel}%{!\?rhel:fedora}' | |
| section = "%install" | |
| regex = '^python3 tools/render-template --variant .*$' |
| [[components.cloud-init.overlays]] | ||
| description = "Set variant to azurelinux" | ||
| type = "spec-search-replace" | ||
| section = "%install" | ||
| regex = '%py3_install -- --init-system=systemd' | ||
| replacement = '%py3_install -- --init-system=systemd --distro=fedora' | ||
| regex = 'python3 tools/render-template --variant %{\?rhel:rhel}%{!\?rhel:fedora}' | ||
| replacement = "python3 tools/render-template --variant azurelinux" |
There was a problem hiding this comment.
This overlay updates the %install render-template invocation, but the PR also removed the previous %py3_install ... --distro=... override (the current rendered spec uses --distro=fedora). If --distro isn’t passed at install time, systemd templates like cloud-init-generator may render without a variant and can regress ds-identify path selection. Consider keeping the %py3_install override and switching it to --distro=azurelinux so template rendering is consistent with the new patches.
| [[components.cloud-init.overlays]] | ||
| description = "Update cloud.cfg template" | ||
| type = "spec-add-tag" | ||
| tag = "Patch" | ||
| value = "update-cloud-cfg.patch" |
There was a problem hiding this comment.
The overlays/patch list changes here will alter the rendered spec output, but this PR doesn’t include the corresponding update to the checked-in rendered spec (specs/c/cloud-init/cloud-init.spec). Please re-render (azldev comp render -p cloud-init) and commit the updated rendered spec so the repo stays consistent.
❌ Rendered specs are out of date🚧🚧🚧🚧🚧 Warning Disregard this comment. Spec rendering is still under development and checked-in specs 🚧🚧🚧🚧🚧 FIX: — run this and commit the result: azldev component render -a --clean-staleOr download the fix patch and apply it: gh run download 25115323112 -R microsoft/azurelinux -n rendered-specs-patch
git apply rendered-specs.patch
Content diffs`specs/3/389-ds-base/389-ds-base.spec`--- committed/specs/3/389-ds-base/389-ds-base.spec
+++ rendered/specs/3/389-ds-base/389-ds-base.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 8;
@@ -1123,7 +1123,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 3.1.4-8
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 3.1.4-8
- Latest state for 389-ds-base
* Fri Feb 13 2026 Viktor Ashirov <vashirov@redhat.com> - 3.1.4-7
`specs/7/7zip/7zip.spec`--- committed/specs/7/7zip/7zip.spec
+++ rendered/specs/7/7zip/7zip.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
@@ -138,7 +138,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 25.01-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 25.01-2
- Latest state for 7zip
* Wed Nov 26 2025 Michel Lind <salimma@fedoraproject.org> - 25.01-1
`specs/a/AMF/AMF.spec`--- committed/specs/a/AMF/AMF.spec
+++ rendered/specs/a/AMF/AMF.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
@@ -87,7 +87,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 1:1.5.0-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 1:1.5.0-2
- Latest state for AMF
* Fri Oct 31 2025 Simone Caronni <negativo17@gmail.com> - 1:1.5.0-1
`specs/a/aardvark-dns/aardvark-dns.spec`--- committed/specs/a/aardvark-dns/aardvark-dns.spec
+++ rendered/specs/a/aardvark-dns/aardvark-dns.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
@@ -130,7 +130,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 2:1.17.0-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 2:1.17.0-2
- Latest state for aardvark-dns
* Wed Nov 12 2025 Packit <hello@packit.dev> - 2:1.17.0-1
`specs/a/abseil-cpp/abseil-cpp.spec`--- committed/specs/a/abseil-cpp/abseil-cpp.spec
+++ rendered/specs/a/abseil-cpp/abseil-cpp.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
@@ -267,7 +267,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 20250814.1-2
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 20250814.1-2
- Latest state for abseil-cpp
* Tue Sep 23 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 20250814.1-1
`specs/a/accountsservice/accountsservice.spec`--- committed/specs/a/accountsservice/accountsservice.spec
+++ rendered/specs/a/accountsservice/accountsservice.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 15;
@@ -130,7 +130,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 23.13.9-15
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 23.13.9-15
- Latest state for accountsservice
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 23.13.9-9
`specs/a/adobe-source-code-pro-fonts/adobe-source-code-pro-fonts.spec`--- committed/specs/a/adobe-source-code-pro-fonts/adobe-source-code-pro-fonts.spec
+++ rendered/specs/a/adobe-source-code-pro-fonts/adobe-source-code-pro-fonts.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 8;
@@ -71,7 +71,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 2.042.1.062.1.026-8
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 2.042.1.062.1.026-8
- Latest state for adobe-source-code-pro-fonts
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.042.1.062.1.026-7
`specs/a/adwaita-icon-theme-legacy/adwaita-icon-theme-legacy.spec`--- committed/specs/a/adwaita-icon-theme-legacy/adwaita-icon-theme-legacy.spec
+++ rendered/specs/a/adwaita-icon-theme-legacy/adwaita-icon-theme-legacy.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 6;
@@ -87,7 +87,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 46.2-6
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 46.2-6
- Latest state for adwaita-icon-theme-legacy
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 46.2-4
`specs/a/adwaita-icon-theme/adwaita-icon-theme.spec`--- committed/specs/a/adwaita-icon-theme/adwaita-icon-theme.spec
+++ rendered/specs/a/adwaita-icon-theme/adwaita-icon-theme.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 4;
@@ -93,7 +93,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 49.0-4
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 49.0-4
- Latest state for adwaita-icon-theme
* Mon Sep 15 2025 Michael Catanzaro <mcatanzaro@gnome.org> - 49.0-1
`specs/a/afflib/afflib.spec`--- committed/specs/a/afflib/afflib.spec
+++ rendered/specs/a/afflib/afflib.spec
@@ -1,5 +1,5 @@
## START: Set by rpmautospec
-## (rpmautospec version 0.8.4)
+## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 16;
@@ -223,7 +223,7 @@
%changelog
## START: Generated by rpmautospec
-* Wed Apr 22 2026 azldev <azurelinux@microsoft.com> - 3.7.20-16
+* Wed Apr 29 2026 azldev <azurelinux@microsoft.com> - 3.7.20-16
- Latest state for afflib
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.20-15
… and 3998 more file(s). Run the remediation command above to see all changes. Files to addThese files are produced by
… and 221 more file(s). Files to removeThese files are in your branch but are not produced by render. Remove them.
… and 262 more file(s). |
|
converting to draft temporarily, so i can get real patches set up in a branch on a forked cloud-init repo. |
This modifies the spec file to pass the variant as 'azurelinux', as well as applying patches to adjust the cloud-init templates for cloud.cfg and the systemd units.
The patches are not yet upstreamed; some review and testing of the specific template settings should be done before upstreaming.