Skip to content

Commit c4084ff

Browse files
committed
Merge branch '1.0-dev' into 1.0
2 parents a9e2afa + 51f5a8b commit c4084ff

25 files changed

+936
-129
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From dc22786980a05129c5971e68ae37b1a9f76f882d Mon Sep 17 00:00:00 2001
2+
From: James Falcon <[email protected]>
3+
Date: Fri, 17 Sep 2021 16:25:22 -0500
4+
Subject: [PATCH] Set Azure to apply networking config every BOOT (#1023)
5+
6+
In #1006, we set Azure to apply networking config every
7+
BOOT_NEW_INSTANCE because the BOOT_LEGACY option was causing problems
8+
applying networking the second time per boot. However,
9+
BOOT_NEW_INSTANCE is also wrong as Azure needs to apply networking
10+
once per boot, during init-local phase.
11+
12+
Signed-off-by: Henry Beberman <[email protected]>
13+
14+
---
15+
cloudinit/sources/DataSourceAzure.py | 6 +++++-
16+
tests/integration_tests/modules/test_user_events.py | 10 ++++++----
17+
2 files changed, 11 insertions(+), 5 deletions(-)
18+
19+
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
20+
index 3fb564c8dd..f8641dfd2f 100755
21+
--- a/cloudinit/sources/DataSourceAzure.py
22+
+++ b/cloudinit/sources/DataSourceAzure.py
23+
@@ -22,7 +22,7 @@
24+
from cloudinit import dmi
25+
from cloudinit import log as logging
26+
from cloudinit import net
27+
-from cloudinit.event import EventType
28+
+from cloudinit.event import EventScope, EventType
29+
from cloudinit.net import device_driver
30+
from cloudinit.net.dhcp import EphemeralDHCPv4
31+
from cloudinit import sources
32+
@@ -339,6 +339,10 @@ def temporary_hostname(temp_hostname, cfg, hostname_command='hostname'):
33+
class DataSourceAzure(sources.DataSource):
34+
35+
dsname = 'Azure'
36+
+ default_update_events = {EventScope.NETWORK: {
37+
+ EventType.BOOT_NEW_INSTANCE,
38+
+ EventType.BOOT,
39+
+ }}
40+
_negotiated = False
41+
_metadata_imds = sources.UNSET
42+
_ci_pkl_version = 1

SPECS/cloud-init/cloud-init.spec

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Cloud instance init scripts
44
Name: cloud-init
55
Version: 21.3
6-
Release: 3%{?dist}
6+
Release: 4%{?dist}
77
License: GPLv3
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -18,6 +18,8 @@ Patch2: ds-vmware-mariner.patch
1818
Patch3: cloud-cfg.patch
1919
Patch4: networkd.patch
2020
Patch5: mariner.patch
21+
Patch6: update-metadata-on-BOOT_NEW_INSTANCE.patch
22+
Patch7: apply-netconfig-every-boot.patch
2123
BuildRequires: automake
2224
BuildRequires: dbus
2325
BuildRequires: iproute
@@ -158,6 +160,9 @@ rm -rf %{buildroot}
158160
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/10-azure-kvp.cfg
159161

160162
%changelog
163+
* Tue Feb 22 2022 Henry Beberman <[email protected]> - 21.3-4
164+
- Add patches from upstream to resolve a hang when reinitializing preprovisioned VMs.
165+
161166
* Mon Oct 18 2021 Henry Beberman <[email protected]> - 21.3-3
162167
- Add azure-kvp subpackage.
163168

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From e69a88745e37061e0ab0a1e67ad11015cca610c1 Mon Sep 17 00:00:00 2001
2+
From: James Falcon <[email protected]>
3+
Date: Fri, 3 Sep 2021 12:57:20 -0500
4+
Subject: [PATCH] Set Azure to only update metadata on BOOT_NEW_INSTANCE
5+
(#1006)
6+
7+
In #834, we refactored the handling of events for fetching new metadata.
8+
Previously, in Azure's __init__, the BOOT event was added to the
9+
update_events, so it was assumed that Azure required the standard BOOT
10+
behavior, which is to apply metadata twice every boot: once during
11+
local-init, then again during standard init phase.
12+
https://github.com/canonical/cloud-init/blob/21.2/cloudinit/sources/DataSourceAzure.py#L356
13+
14+
However, this line was effectively meaningless. After the metadata was
15+
fetched in local-init, it was then pickled out to disk. Because
16+
"update_events" was a class variable, the EventType.BOOT was not
17+
persisted into the pickle. When the pickle was then unpickled in the
18+
init phase, metadata did not get re-fetched because EventType.BOOT was
19+
not present, so Azure is effectely only BOOT_NEW_INSTANCE.
20+
21+
Fetching metadata twice during boot causes some issue for
22+
pre-provisioning on Azure because updating metadata during
23+
re-provisioning will cause cloud-init to poll for reprovisiondata again
24+
in DataSourceAzure, which will infinitely return 404(reprovisiondata
25+
is deleted from IMDS after health signal was sent by cloud-init during
26+
init-local). This makes cloud-init stuck in 'init'
27+
28+
Signed-off-by: Henry Beberman <[email protected]>
29+
30+
---
31+
cloudinit/sources/DataSourceAzure.py | 9 +--------
32+
1 file changed, 1 insertion(+), 8 deletions(-)
33+
34+
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
35+
index caffa944f3..3fb564c8dd 100755
36+
--- a/cloudinit/sources/DataSourceAzure.py
37+
+++ b/cloudinit/sources/DataSourceAzure.py
38+
@@ -22,7 +22,7 @@
39+
from cloudinit import dmi
40+
from cloudinit import log as logging
41+
from cloudinit import net
42+
-from cloudinit.event import EventScope, EventType
43+
+from cloudinit.event import EventType
44+
from cloudinit.net import device_driver
45+
from cloudinit.net.dhcp import EphemeralDHCPv4
46+
from cloudinit import sources
47+
@@ -339,13 +339,6 @@ def temporary_hostname(temp_hostname, cfg, hostname_command='hostname'):
48+
class DataSourceAzure(sources.DataSource):
49+
50+
dsname = 'Azure'
51+
- # Regenerate network config new_instance boot and every boot
52+
- default_update_events = {EventScope.NETWORK: {
53+
- EventType.BOOT_NEW_INSTANCE,
54+
- EventType.BOOT,
55+
- EventType.BOOT_LEGACY
56+
- }}
57+
-
58+
_negotiated = False
59+
_metadata_imds = sources.UNSET
60+
_ci_pkl_version = 1

SPECS/expat/expat.signatures.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"expat-2.4.4.tar.bz2": "14c58c2a0b5b8b31836514dfab41bd191836db7aa7b84ae5c47bc0327a20d64a"
3+
"expat-2.4.6.tar.bz2": "ce317706b07cae150f90cddd4253f5b4fba929607488af5ac47bf2bc08e31f09"
44
}
5-
}
5+
}

SPECS/expat/expat.spec

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%global underscore_version $(echo %{version} | cut -d. -f1-3 --output-delimiter="_")
22
Summary: An XML parser library
33
Name: expat
4-
Version: 2.4.4
4+
Version: 2.4.6
55
Release: 1%{?dist}
66
License: MIT
77
Vendor: Microsoft Corporation
@@ -65,6 +65,10 @@ rm -rf %{buildroot}/%{_docdir}/%{name}
6565
%{_libdir}/libexpat.so.1*
6666

6767
%changelog
68+
* Thu Feb 24 2022 Thomas Crain <[email protected]> - 2.4.6-1
69+
- Upgrade to latest upstream version to fix CVE-2022-25313, CVE-2022-25314,
70+
CVE-2022-25315, CVE-2022-25235, CVE-2022-25236
71+
6872
* Mon Jan 31 2022 Neha Agarwal <[email protected]> - 2.4.4-1
6973
- Update version to 2.4.4 to address CVE-2022-23852
7074

SPECS/mariner-release/mariner-release.spec

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: CBL-Mariner release files
22
Name: mariner-release
33
Version: 1.0
4-
Release: 33%{?dist}
4+
Release: 35%{?dist}
55
License: MIT
66
Group: System Environment/Base
77
URL: https://aka.ms/cbl-mariner
@@ -36,7 +36,7 @@ cat > %{buildroot}/usr/lib/os-release << EOF
3636
NAME="Common Base Linux Mariner"
3737
VERSION="%{mariner_release_version}"
3838
ID=mariner
39-
VERSION_ID=$version_id
39+
VERSION_ID="$version_id"
4040
PRETTY_NAME="CBL-Mariner/Linux"
4141
ANSI_COLOR="1;34"
4242
HOME_URL="%{url}"
@@ -67,6 +67,10 @@ rm -rf $RPM_BUILD_ROOT
6767
%config(noreplace) /etc/issue.net
6868

6969
%changelog
70+
* Fri Feb 25 2022 Jon Slobodzian <[email protected]> - 1.0-35
71+
- Updating version for March update.
72+
* Thu Feb 24 2022 Pawel Winogrodzki <[email protected]> - 1.0-34
73+
- Surrounding 'VERSION_ID' inside 'os-release' with double quotes.
7074
* Mon Feb 07 2022 Jon Slobodzian <[email protected]> - 1.0-33
7175
- Updating version for February update.
7276
* Wed Jan 26 2022 Jon Slobodzian <[email protected]> - 1.0-32

0 commit comments

Comments
 (0)