mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
hooks: Fix monitoring of multiple directories
This isn't an issue with podman, which will only ever use one directory. But CRI-O generally uses two directories, and we want to make sure that changes to the fallback directory are not clobbering hooks configured in the override directory. More background in [1]. I've split the handling into a single-directory block and a multiple-directory block so we don't waste time polling the filesystem for single-directory removals. I'm using the single-directory block for the the zero-directory case as well. Managers with zero directories should not be receiving fsnotify events, so I don't think it really matters which block handles them. If we want to handle this case robustly (because we're concerned about something in the hook package adjusted the private .directories property on the fly?), then we'll probably want to add an explicit zero-directory block in future work. [1]: https://github.com/kubernetes-incubator/cri-o/pull/1470 Signed-off-by: W. Trevor King <wking@tremily.us> Closes: #757 Approved by: rhatdan
This commit is contained in:

committed by
Atomic Bot

parent
4704c138ae
commit
c45d4c6d5c
@ -1,4 +1,4 @@
|
||||
// Package hooks implements CRI-O's hook handling.
|
||||
// Package hooks implements hook configuration and handling for CRI-O and libpod.
|
||||
package hooks
|
||||
|
||||
import (
|
||||
|
Reference in New Issue
Block a user