mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
podman: remember hooks-dir on restarts
When podman restarts config values within the Engine are lost. Add --hook-dirs arguments as appropriate to the cleanup command so that hooks are preserved on restarts due to the on-restart setting Tests: add a check that prestart/poststop hooks ran every time after 2 restarts. `wait_for_restart_count` was re-used to wait for restarts and moved to helpers file. Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> Fixes: #17935
This commit is contained in:
@ -285,6 +285,9 @@ func CreateExitCommandArgs(storageConfig storageTypes.StoreOptions, config *conf
|
||||
"--db-backend", config.Engine.DBBackend,
|
||||
fmt.Sprintf("--transient-store=%t", storageConfig.TransientStore),
|
||||
}
|
||||
for _, dir := range config.Engine.HooksDir.Get() {
|
||||
command = append(command, []string{"--hooks-dir", dir}...)
|
||||
}
|
||||
if storageConfig.ImageStore != "" {
|
||||
command = append(command, []string{"--imagestore", storageConfig.ImageStore}...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user