mirror of
https://github.com/opencontainers/runc.git
synced 2026-06-30 19:58:25 +00:00
libcontainer: expose annotations in hooks
Annotations weren't passed to hooks. This patch fixes that by passing annotations to stdin for hooks. Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
@@ -63,10 +63,12 @@ func destroy(c *linuxContainer) error {
|
||||
|
||||
func runPoststopHooks(c *linuxContainer) error {
|
||||
if c.config.Hooks != nil {
|
||||
bundle, annotations := utils.Annotations(c.config.Labels)
|
||||
s := configs.HookState{
|
||||
Version: c.config.Version,
|
||||
ID: c.id,
|
||||
Bundle: utils.SearchLabels(c.config.Labels, "bundle"),
|
||||
Version: c.config.Version,
|
||||
ID: c.id,
|
||||
Bundle: bundle,
|
||||
Annotations: annotations,
|
||||
}
|
||||
for _, hook := range c.config.Hooks.Poststop {
|
||||
if err := hook.Run(s); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user