mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
Create volume path before state initialization
Strictly speaking we don't need the path yet, but it existing prevents a lot of strangeness in our path-checking logic to validate the current Podman configuration, as it was the only path that might not exist this early in init. Fixes #23515 Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -369,6 +369,14 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
|
|||||||
return fmt.Errorf("creating runtime temporary files directory: %w", err)
|
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.
|
// Set up the state.
|
||||||
runtime.state, err = getDBState(runtime)
|
runtime.state, err = getDBState(runtime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -194,6 +194,13 @@ host.slirp4netns.executable | $expr_path
|
|||||||
|
|
||||||
ln -s /home $new_home
|
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
|
# Just need the command to run cleanly
|
||||||
HOME=$PODMAN_TMPDIR/$HOME run_podman info
|
HOME=$PODMAN_TMPDIR/$HOME run_podman info
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user