BastilleBSD / bastille

Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD.
https://bastillebsd.org
BSD 3-Clause "New" or "Revised" License
783 stars 130 forks source link

[BUG] "bastille setup zfs" can result in invalid bastiile_zroot #669

Open michael-o opened 5 months ago

michael-o commented 5 months ago

Newly introduced "bastille setup zfs" https://github.com/BastilleBSD/bastille/blob/3a4ebc63bb84b66d456713e608be86e4cba3b637/usr/local/share/bastille/setup.sh#L108-L117 will fail here:

root@deblndw013x:~
# zpool list | grep -v NAME |  awk '{print $1}'
hp-large
hp-medium
zroot
root@deblndw013x:~
# bastille_zroot=$(zpool list | grep -v NAME | awk '{print $1}')
root@deblndw013x:~
# echo $bastille_zroot
hp-large hp-medium zroot

Further using that auto-set value will make the rest fail...

Manually set:

root@deblndw013x:~
# sysrc -f /usr/local/etc/bastille/bastille.conf bastille_zfs_zpool
bastille_zfs_zpool: hp-large

will work.

This command should fail-fast if there is more than one zpool on the system.