Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v5.2] Create volume path before state initialization #23647

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
return fmt.Errorf("creating runtime temporary files directory: %w", err)
}

// Create the volume path if needed.
// This is not strictly necessary at this point, but the path not
// existing can cause troubles with DB path validation on OSTree based
// systems. Ref: /~https://github.com/containers/podman/issues/23515
if err := os.MkdirAll(runtime.config.Engine.VolumePath, 0700); err != nil {
return fmt.Errorf("creating runtime volume path directory: %w", err)
}

// Set up the state.
runtime.state, err = getDBState(runtime)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions test/system/005-info.bats
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ host.slirp4netns.executable | $expr_path

ln -s /home $new_home

# Remove volume directory. This doesn't break Podman but can cause our DB
# validation to break if Podman misbehaves. Ref:
# /~https://github.com/containers/podman/issues/23515
# (Unfortunately, we can't just use a new directory, that will just trip DB
# validation that it doesn't match the path we were using before)
rm -rf $PODMAN_TMPDIR/$HOME/.local/share/containers/storage/volumes

# Just need the command to run cleanly
HOME=$PODMAN_TMPDIR/$HOME run_podman info

Expand Down