← Back to issue list

lxd: support new style snap injection

View original Github issue

Metadata

Project
snapcraft
Number
#2222
Type
pull request
State
merged
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

Merged after implementing new style snap injection for LXD. Refactored provider logic, normalized code, and removed test duplication. Approved by two reviewers, passed CI, and verified via edge channel testing.

Suggested action:

No scores available.

Issue body

Use the same logic as the one implemented in the new provider logic. Take the opportunity to normalize and untangle the code and also fix the tests to remove duplication and unnecessary over mocking. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after implementing new style snap injection for LXD. Refactored provider logic, normalized code, and removed test duplication. Approved by two reviewers, passed CI, and verified via edge channel testing.
qwen3.6-35b-a3b-mtp-q6 Merged LXD provider updates for new style snap injection. Code was normalized, tests refactored, and injection adjusted for unprivileged containers. Successfully tested and published to the edge channel.
qwen3.6-35b-a3b-mtp-q6 Merged. Implements new LXD snap injection aligned with updated provider logic. Refactors code, removes test duplication, and eliminates sudo-based injection to enable unprivileged containers. Verified and published to the edge channel.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2621 build providers: support injection for LXD snapcraft merged Merged after approval and passing CI. Implements LXD injection support via snapd's new file API, removes legacy mounts, and refactors code for better separation of concerns across 12 files.
82%
#1865 lxd: always (re-)injects snaps snapcraft merged Merged to fix LP: #1741752 by ensuring LXD containers always re-inject snaps. Changes refactor injection logic, reorganize files, and properly handle side-loaded snap assertions. Approved by reviewer and passed CI.
81%
#1364 lxd: Inject snapcraft and core snaps into the container snapcraft merged Merged. Injects the host's snapcraft and core snaps into LXD containers to ensure build version consistency. Approved by one reviewer, modifying nine files with 360 additions and 46 deletions.
78%
#3725 tests: use lxd in clean provider test snapcraft merged Merged into snapcraft/7.0. Enables LXD in provider cleaning tests to align with destructive mode testing. Approved by one reviewer, passed CI checks, and maintained existing code coverage.
77%
#2509 build providers: initial support for LXD snapcraft merged Merged initial LXD build provider support for snapcraft, enabling the --use-lxd flag for lifecycle steps and cleaning. Passes CI. Reviewers noted minor dependency and container setup edge cases, which were clarified or deferred.
77%
#3112 spread: remove dead code for lxd setup and add debug prints snapcraft merged Merged removal of redundant elif dead code in LXD setup logic and addition of debug prints for LXD snap install failures. Approved by one reviewer, passed CI checks, and integrated.
73%
#2647 build providers: catch LXD socket error snapcraft merged Merged to catch LXD socket errors in build providers, resolving SNAPCRAFT-WA. Approved by reviewer, passed CI checks, and integrated with a 14-line addition and 6-line deletion across three files. Minor test coverage decrease noted but did not block merge.
73%
#1577 lxd: don't inject local snaps on a different arch snapcraft merged Merged a fix preventing Snapcraft from injecting local snaps into LXD containers with mismatched architectures. Cross-arch remotes now install snaps from the store. Approved by reviewers and merged after CI checks.
72%
#2098 lxd: wait for on-going refreshes to finish snapcraft merged Merged fix adding a snap watch call before injecting snaps into LXD containers to wait for ongoing refreshes. Resolves race conditions causing build failures in issues #2037 and LP: #1722049. Approved by reviewer and passed CI.
72%
#3962 Setup snapd for snapcraft_legacy providers snapcraft merged Merged a fix for failing spread tests caused by missing snapd sockets in LXD containers. The change adopts snapd initialization logic from craft-providers to properly start the service, resolving connection errors. Approved and passed CI.
72%