Skip to content

Commit

Permalink
fix: use lxd from "5.21/stable"
Browse files Browse the repository at this point in the history
That is the currently recommended LTS release the use, and in fact the one
that works with Rockcraft ("latest/stable" has issues with overlays)
  • Loading branch information
tigarmo committed Aug 8, 2024
1 parent 3cf3eb6 commit fd0ac92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/rockcraft-pack-action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20062,7 +20062,7 @@ async function ensureLXD() {
haveSnapLXD ? "refresh" : "install",
"lxd",
"--channel",
"latest/stable"
"5.21/stable"
]);
core.info("Initialising LXD...");
await exec.exec("sudo", ["lxd", "init", "--auto"]);
Expand Down
3 changes: 2 additions & 1 deletion src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ export async function ensureLXD(): Promise<void> {
])

// Install a specific version of LXD that we know works well with Rockcraft
// (latest LTS release, tracked in 5.21/stable)
const haveSnapLXD = await haveExecutable('/snap/bin/lxd')
core.info('Installing LXD...')
await exec.exec('sudo', [
'snap',
haveSnapLXD ? 'refresh' : 'install',
'lxd',
'--channel',
'latest/stable'
'5.21/stable'
])

core.info('Initialising LXD...')
Expand Down
4 changes: 2 additions & 2 deletions tests/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ test('ensureLXD installs the snap version of LXD if needed', async () => {
'install',
'lxd',
'--channel',
'latest/stable'
'5.21/stable'
])
expect(execMock).toHaveBeenNthCalledWith(4, 'sudo', ['lxd', 'init', '--auto'])
})
Expand Down Expand Up @@ -249,7 +249,7 @@ test('ensureLXD still calls "lxd init" if LXD is installed', async () => {
'refresh',
'lxd',
'--channel',
'latest/stable'
'5.21/stable'
])
expect(execMock).toHaveBeenNthCalledWith(4, 'sudo', ['lxd', 'init', '--auto'])
})
Expand Down

0 comments on commit fd0ac92

Please sign in to comment.