mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct/configs: add HookList.SetDefaultEnv
1. Make CommandHook.Command a pointer, which reduces the amount of data being copied when using hooks, and allows to modify command hooks. 2. Add SetDefaultEnv, which is to be used by the next commit. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -1022,13 +1022,13 @@ func TestHook(t *testing.T) {
|
||||
}),
|
||||
},
|
||||
configs.CreateContainer: configs.HookList{
|
||||
configs.NewCommandHook(configs.Command{
|
||||
configs.NewCommandHook(&configs.Command{
|
||||
Path: "/bin/bash",
|
||||
Args: []string{"/bin/bash", "-c", fmt.Sprintf("touch ./%s", hookFiles[configs.CreateContainer])},
|
||||
}),
|
||||
},
|
||||
configs.StartContainer: configs.HookList{
|
||||
configs.NewCommandHook(configs.Command{
|
||||
configs.NewCommandHook(&configs.Command{
|
||||
Path: "/bin/sh",
|
||||
Args: []string{"/bin/sh", "-c", fmt.Sprintf("touch /%s", hookFiles[configs.StartContainer])},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user