Documentation
¶
Overview ¶
Package namestore provides a simple store for containers to exclusively acquire and release names. All methods are safe to use concurrently. Note that locking of the store is done at the namespace level. The namestore is currently used by container create, remove, rename, and as part of the ocihook events cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNameStore = errors.New("name-store error")
ErrNameStore will wrap all errors here
Functions ¶
This section is empty.
Types ¶
type NameStore ¶
type NameStore interface { // Acquire exclusively grants `name` to container with `id`. Acquire(name, id string) error // Acquire allows the container owning a specific name to release it Release(name, id string) error // Rename allows the container owning a specific name to change it to newName (if available) Rename(oldName, id, newName string) error }
NameStore allows acquiring, releasing and renaming. "names" must abide by identifiers.ValidateDockerCompat A container cannot release or rename a name it does not own. A container cannot acquire a name that is already owned by another container. Re-acquiring a name does not error and is a no-op. Double releasing a name will error. Note that technically a given container may acquire multiple different names, although this is not something we do in the codebase.