1
0

fix: pass container by pointer to allow changing logs

This commit is contained in:
dump_stack() 2024-10-08 12:01:35 +00:00
parent 5bb4e3ff45
commit 287ef19530
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB

View File

@ -466,7 +466,7 @@ func (c Container) build(imagePath string) (output string, err error) {
return return
} }
func (c Container) Run(workdir string, cmds []string) (out string, err error) { func (c *Container) Run(workdir string, cmds []string) (out string, err error) {
flog := c.Log.With(). flog := c.Log.With().
Str("workdir", workdir). Str("workdir", workdir).
Str("command", fmt.Sprintf("%v", cmds)). Str("command", fmt.Sprintf("%v", cmds)).
@ -535,7 +535,7 @@ func (c Container) Run(workdir string, cmds []string) (out string, err error) {
} }
c.handleCommandsOutput(m) c.handleCommandsOutput(m)
out += m + "\n" out += m + "\n"
flog.Trace().Str("stdout", m).Msg("") flog.Trace().Str("container stdout", m).Msg("")
} }
}() }()