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:
Kir Kolyshkin
2024-12-22 17:32:02 -08:00
committed by lfbzhm
parent c49b891681
commit 6171da6005
6 changed files with 29 additions and 15 deletions
+2 -2
View File
@@ -1256,8 +1256,8 @@ func createHooks(rspec *specs.Spec, config *configs.Config) {
}
}
func createCommandHook(h specs.Hook) configs.Command {
cmd := configs.Command{
func createCommandHook(h specs.Hook) *configs.Command {
cmd := &configs.Command{
Path: h.Path,
Args: h.Args,
Env: h.Env,