Warn on boltdb use

We started logging this in 5.6. In 5.7, we up to a warning. The
upcoming 5.8 will up the warnings further to errors.

Required as we're removing BoltDB support in 6.0 next Spring.

Signed-off-by: Matt Heon <matthew.heon@pm.me>
This commit is contained in:
Matt Heon
2025-10-14 15:00:49 -04:00
parent 24872421a8
commit 9ea18b78fa
4 changed files with 11 additions and 5 deletions

View File

@@ -81,6 +81,7 @@ function _run_sys() {
}
function _run_upgrade_test() {
export SUPPRESS_BOLTDB_WARNING=true
showrun bats test/upgrade |& logformatter
}

View File

@@ -81,12 +81,14 @@ func NewBoltState(path string, runtime *Runtime) (State, error) {
logrus.Debugf("Initializing boltdb state at %s", path)
ciDesiredDB := os.Getenv("CI_DESIRED_DATABASE")
// BoltDB is deprecated and, as of Podman 5.0, we no longer allow the
// creation of new Bolt states.
// If the DB does not already exist, error out.
// To continue testing in CI, allow creation iff an undocumented env
// var is set.
if os.Getenv("CI_DESIRED_DATABASE") != "boltdb" {
if ciDesiredDB != "boltdb" {
if err := fileutils.Exists(path); err != nil && errors.Is(err, fs.ErrNotExist) {
return nil, fmt.Errorf("the BoltDB backend has been deprecated, no new BoltDB databases can be created: %w", define.ErrInvalidArg)
}
@@ -94,9 +96,9 @@ func NewBoltState(path string, runtime *Runtime) (State, error) {
logrus.Debugf("Allowing deprecated database backend due to CI_DESIRED_DATABASE.")
}
// TODO: Up this to WARN level in 5.7, ERROR level in 5.8
if os.Getenv("SUPPRESS_BOLTDB_WARNING") == "" {
logrus.Infof("The deprecated BoltDB database driver is in use. This driver will be removed in the upcoming Podman 6.0 release in mid 2026. It is advised that you migrate to SQLite to avoid issues when this occurs. Set SUPPRESS_BOLTDB_WARNING environment variable to remove this message.")
// TODO: Up this to ERROR level in 5.8
if os.Getenv("SUPPRESS_BOLTDB_WARNING") == "" && ciDesiredDB != "boltdb" {
logrus.Warnf("The deprecated BoltDB database driver is in use. This driver will be removed in the upcoming Podman 6.0 release in mid 2026. It is advised that you migrate to SQLite to avoid issues when this occurs. Set SUPPRESS_BOLTDB_WARNING environment variable to remove this message.")
}
db, err := bolt.Open(path, 0o600, nil)

View File

@@ -289,6 +289,7 @@ EOF
}
# TODO 6.0: Remove this
@test "podman - BoltDB cannot create new databases" {
skip_if_remote "DB checks only work for local Podman"
@@ -302,7 +303,7 @@ EOF
assert "$output" =~ "Allowing deprecated database backend" \
"with CI_DESIRED_DATABASE"
run_podman $safe_opts system reset --force
SUPPRESS_BOLTDB_WARNING=true run_podman $safe_opts system reset --force
}
@test "podman - empty string defaults for certain values" {

View File

@@ -207,6 +207,8 @@ function wait_for_journal() {
# Ref https://github.com/containers/podman/pull/21563#issuecomment-1965145324
local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container
cat > $quadlet_file <<EOF
[Service]
Environment=SUPPRESS_BOLTDB_WARNING=true
[Container]
Image=$IMAGE
# Note it is important that the trap is before the ready message,