Merge ~ack/maas:1941050-3.0 into maas:3.0

Proposed by Alberto Donato
Status: Merged
Approved by: Alberto Donato
Approved revision: d1b50a519612ff51952d9922998947982088946c
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ack/maas:1941050-3.0
Merge into: maas:3.0
Diff against target: 37 lines (+8/-6)
2 files modified
src/metadataserver/tests/test_vendor_data.py (+2/-1)
src/metadataserver/vendor_data.py (+6/-5)
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
Review via email: mp+407671@code.launchpad.net

Commit message

LP:1941050 always install lxd from latest/stable when deploying a LXD VM host

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/metadataserver/tests/test_vendor_data.py b/src/metadataserver/tests/test_vendor_data.py
2index e8fddfd..becbf22 100644
3--- a/src/metadataserver/tests/test_vendor_data.py
4+++ b/src/metadataserver/tests/test_vendor_data.py
5@@ -396,7 +396,8 @@ class TestGenerateKVMPodConfiguration(MAASServerTestCase):
6 "runcmd",
7 [
8 "apt autoremove --purge --yes lxd lxd-client lxcfs",
9- "snap install lxd --channel=4.0",
10+ "snap install lxd --channel=latest",
11+ "snap refresh lxd --channel=latest",
12 f'lxd init --auto --network-address=[::] --trust-password="{password}"',
13 ],
14 ),
15diff --git a/src/metadataserver/vendor_data.py b/src/metadataserver/vendor_data.py
16index dabf7e1..931e890 100644
17--- a/src/metadataserver/vendor_data.py
18+++ b/src/metadataserver/vendor_data.py
19@@ -177,13 +177,14 @@ def generate_kvm_pod_configuration(node):
20 key=LXD_PASSWORD_METADATA_KEY,
21 defaults={"value": password},
22 )
23- # when installing LXD, make sure no deb packages conflict with the snap
24- # installation. If the snap is not already installed (as in bionic, install
25- # 4.0 which is enough for features required by MAAS). If it's already
26- # installed (as in focal), just keep the existing version.
27+ # When installing LXD, ensure no deb packages are installed, since they
28+ # would conflict with the snap. Also, ensure that the snap version is
29+ # the latest, since MAAS requires features not present in the one
30+ # installed by default in Focal.
31 yield "runcmd", [
32 "apt autoremove --purge --yes lxd lxd-client lxcfs",
33- "snap install lxd --channel=4.0",
34+ "snap install lxd --channel=latest",
35+ "snap refresh lxd --channel=latest",
36 f'lxd init --auto --network-address=[::] --trust-password="{password}"',
37 ]
38

Subscribers

People subscribed via source and target branches