[Merge] ~tobijk/livecd-rootfs/+git/livecd-rootfs:feature/implicit-core-seeding into livecd-rootfs:ubuntu/master
Ćukasz Zemczak
lukasz.zemczak at canonical.com
Fri Apr 12 12:54:15 UTC 2019
Review: Needs Fixing
Ok, after some thinking I guess you are right regarding that we're still missing one thing here.
So the snapd snap has a base specified, but doesn't actually depend on it. For instance for our ubuntu-core images we pull in the snapd snap from stable without core, just with core18 instead, and it all works. What we'd have to do here sadly is special-case snapd a bit, e.g. pulling in snapd without pulling its base.
Also, what this MP doesn't do (which I guess it should, but maybe we need Steve to comment?) is to actually check if *all* the snaps we're pulling in were providing a base: or not. Because IIUC, when we actually have to install core (because it's a base of one of the preinstalled snaps, other than snapd itself), then we don't need to pull snapd explicitly as well (since we can use the snapd that's in core). So, even though the current implemented logic is nice and clean, I guess we need to change it. We need to support the following scenarios:
a) All snaps provide a base: (that's different than 'core') -> pull in the base snaps + snapd
b) Some snaps provide a base, some are still using core -> pull in the base snaps (along with core)
c) All snaps don't provide a base (using core) -> pull in all the base snaps (so just core in this case)
How about doing most of the work maybe actually not in _snap_preseed() but in snap_preseed()? We could add a nice private function for clarity, like _check_base_snap() or something, that would do the snap-tool info dance and call it from snap_preseed(). We could then either install the base snaps in that function (by calling the private _snap_preseed() function safely now), or maybe just use that function to write down all the base snaps that will be needed and then in snap_prepare() use that list to preseed those base snap combinations we need. And then, since we'll be using _snap_preseed() for the preseeding, there will be no risk that adding snapd there would recursively pull in core again.
--
https://code.launchpad.net/~tobijk/livecd-rootfs/+git/livecd-rootfs/+merge/365878
Your team Ubuntu Core Development Team is subscribed to branch livecd-rootfs:ubuntu/master.
More information about the Ubuntu-reviews
mailing list