You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, in the osbase run function it looks like the init command is only ever used if self._cachekey is truthy, and if the cached image doesn't already exist.
I noticed this when I tried to use --init-command, and I couldn't see any effect:
$ debspawn run --init-command "sh -c 'echo init command without cachekey'" sid echo "regular command"
╔════════════════════════════════════════════════╗
║ Preparing template for `test_cachekey` ║
╚════════════════════════════════════════════════╝
┌─────────────────────────────┐
│ Preparing container │
└─────────────────────────────┘
Hit:1 http://deb.debian.org/debian sid InRelease
Hit:2 http://deb.debian.org/debian experimental InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/srv
uid=0(root) gid=0(root) groups=0(root)
init command
Storing prepared image in cache
New compressed tarball size (for test_cachekey) is 610.0MiB
Using cached container image `test_cachekey`
usermod: no changes
┌─────────────────────────────┐
│ Preparing container │
└─────────────────────────────┘
Hit:1 http://deb.debian.org/debian sid InRelease
Hit:2 http://deb.debian.org/debian experimental InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
┌──────────────────────┐
│ Running Task │
└──────────────────────┘
regular command
┌────────────────────────────────────┐
│ Retrieving build artifacts │
└────────────────────────────────────┘
Copied 0 files.
Done.
The doc says something about the init command being ignored if the cachekey already exists (which is correct!), but not about the init command being ignored if there is no cachekey, so I assume this may be a bug?
The text was updated successfully, but these errors were encountered:
Hello, in the osbase run function it looks like the init command is only ever used if
self._cachekey
is truthy, and if the cached image doesn't already exist.I noticed this when I tried to use
--init-command
, and I couldn't see any effect:$ debspawn run --init-command "sh -c 'echo init command without cachekey'" sid echo "regular command"
With a cachekey, the init command is run as expected:
$ debspawn run --init-command "sh -c 'pwd;id;echo init command'" --cachekey test_cachekey sid echo "regular command"
The doc says something about the init command being ignored if the cachekey already exists (which is correct!), but not about the init command being ignored if there is no cachekey, so I assume this may be a bug?
The text was updated successfully, but these errors were encountered: