Skip to content

Commit 2883e95

Browse files
Merge pull request #27294 from mheon/warn_on_boltdb
Warn on BoltDB usage
2 parents bc3b910 + 9ea18b7 commit 2883e95

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

contrib/cirrus/runner.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function _run_sys() {
8181
}
8282

8383
function _run_upgrade_test() {
84+
export SUPPRESS_BOLTDB_WARNING=true
8485
showrun bats test/upgrade |& logformatter
8586
}
8687

libpod/boltdb_state.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,24 @@ func NewBoltState(path string, runtime *Runtime) (State, error) {
8181

8282
logrus.Debugf("Initializing boltdb state at %s", path)
8383

84+
ciDesiredDB := os.Getenv("CI_DESIRED_DATABASE")
85+
8486
// BoltDB is deprecated and, as of Podman 5.0, we no longer allow the
8587
// creation of new Bolt states.
8688
// If the DB does not already exist, error out.
8789
// To continue testing in CI, allow creation iff an undocumented env
8890
// var is set.
89-
if os.Getenv("CI_DESIRED_DATABASE") != "boltdb" {
91+
if ciDesiredDB != "boltdb" {
9092
if err := fileutils.Exists(path); err != nil && errors.Is(err, fs.ErrNotExist) {
9193
return nil, fmt.Errorf("the BoltDB backend has been deprecated, no new BoltDB databases can be created: %w", define.ErrInvalidArg)
9294
}
9395
} else {
9496
logrus.Debugf("Allowing deprecated database backend due to CI_DESIRED_DATABASE.")
9597
}
9698

97-
// TODO: Up this to WARN level in 5.7, ERROR level in 5.8
98-
if os.Getenv("SUPPRESS_BOLTDB_WARNING") == "" {
99-
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.")
99+
// TODO: Up this to ERROR level in 5.8
100+
if os.Getenv("SUPPRESS_BOLTDB_WARNING") == "" && ciDesiredDB != "boltdb" {
101+
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.")
100102
}
101103

102104
db, err := bolt.Open(path, 0o600, nil)

test/system/005-info.bats

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ EOF
289289

290290
}
291291

292+
# TODO 6.0: Remove this
292293
@test "podman - BoltDB cannot create new databases" {
293294
skip_if_remote "DB checks only work for local Podman"
294295

@@ -302,7 +303,7 @@ EOF
302303
assert "$output" =~ "Allowing deprecated database backend" \
303304
"with CI_DESIRED_DATABASE"
304305

305-
run_podman $safe_opts system reset --force
306+
SUPPRESS_BOLTDB_WARNING=true run_podman $safe_opts system reset --force
306307
}
307308

308309
@test "podman - empty string defaults for certain values" {

test/system/252-quadlet.bats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ function wait_for_journal() {
207207
# Ref https://github.com/containers/podman/pull/21563#issuecomment-1965145324
208208
local quadlet_file=$PODMAN_TMPDIR/basic_$(safename).container
209209
cat > $quadlet_file <<EOF
210+
[Service]
211+
Environment=SUPPRESS_BOLTDB_WARNING=true
210212
[Container]
211213
Image=$IMAGE
212214
# Note it is important that the trap is before the ready message,

0 commit comments

Comments
 (0)