Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure lxd is installed before attempting snap refresh #930

Merged
merged 6 commits into from
Jan 7, 2025

Conversation

bschimke95
Copy link
Contributor

@bschimke95 bschimke95 commented Jan 7, 2025

  • Add a check to determine if the lxd snap is already installed before attempting to refresh or install it. This is required because the LXD snap is not shipped by default in 24.04 anymore.

  • Replace the use of sg lxd -c with sudo --user "$USER". This eliminates the need for password entry during the lxc command execution.
    See sg and newgrp require password to run actions/runner-images#9932 (comment)

This change checks if the lxd snap is installed before running `snap refresh lxd`,
preventing failures when lxd is missing. If lxd is not found,
it installs the snap using the specified channel.
This is required because the LXD snap is not shipped by default in 24.04 anymore.
@bschimke95 bschimke95 requested a review from a team as a code owner January 7, 2025 11:11
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ben!

@eaudetcobello eaudetcobello merged commit e706ed3 into main Jan 7, 2025
30 checks passed
@eaudetcobello eaudetcobello deleted the bschimke95/fix-lxd-installation branch January 7, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants