-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17999 from jack-w-shaw/JUJU-6609_install_loca…
…l_mongo_snap juju#17999 When this feature was originally implemented some 5 years ago, it was only half-implemented Complete this process. Allow users to deploy juju with a local juju-db snap using --db-snap and --db-snap-asserts. This involved fixing the mongo snap service code to look in the correct directory for the .snap file. We also completely neglected the .assert file. Pick that up at the same time. Our snap service code, as well, also needed some serious refactoring to support: - installing local snaps from .snap files - acknowledging the assert file of local snaps We should probably add an integration test for this, but that is out of scope. ## Checklist - [x] Code style: imports ordered, good names, simple structure, etc - [x] Comments saying why design decisions were made - [x] Go unit tests, with comments saying what you're testing - [ ] [Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing ## QA steps ### Happy path ``` $ snap download juju-db --channel 4.4/stable Fetching snap "juju-db" Fetching assertions for "juju-db" Install the snap with: snap ack juju-db_178.assert snap install juju-db_178.snap $ juju bootstrap lxd lxd --db-snap ./juju-db_178.snap --db-snap-asserts ./juju-db_178.assert ``` Then check `juju debug-log -m controller --replay` for: ``` INFO juju.mongo Ensuring mongo server is running; data directory /var/snap/juju-db/common; port 37017 INFO juju.service.snap running snap command: [ack /var/lib/juju/snap/juju-db_178.assert] INFO juju.service.snap running snap command: [install /var/lib/juju/snap/juju-db_178.snap] ``` ### Sad path ``` $ rm ./juju-db_178.snap $ rm ./juju-db_178.assert $ touch ./juju-db_178.snap $ touch ./juju-db_178.assert $ juju bootstrap lxd lxd --db-snap ./juju-db_178.snap --db-snap-asserts ./juju-db_178.assert ... INFO juju.service.snap snap.go:418 running snap command: [install /var/lib/juju/snap/juju-db_178.snap] ERROR failed to start mongo: cannot install mongod: output: : attempt count exceeded: exit status 1 ERROR failed to bootstrap model: subprocess encountered error code 1 ``` ## Links **Launchpad bug:** https://bugs.launchpad.net/juju/+bug/2075182
- Loading branch information
Showing
10 changed files
with
394 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.