1
0

feat: add container timeout parameter to kernel command

This commit is contained in:
dump_stack() 2023-05-26 17:01:53 +00:00
parent 852680e944
commit 8c49680675
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 7 additions and 1 deletions

View File

@ -104,7 +104,7 @@ func ReadOutOfTreeConf(path string) (c OutOfTree, err error) {
}
if c.Docker.Timeout.Duration == 0 {
c.Docker.Timeout.Duration = time.Minute
c.Docker.Timeout.Duration = 8 * time.Minute
}
return

View File

@ -32,6 +32,8 @@ type KernelCmd struct {
Update bool `help:"update container"`
Max int `help:"maximum kernels to download" default:"100500"`
ContainerTimeout time.Duration `help:"container timeout"`
List KernelListCmd `cmd:"" help:"list kernels"`
ListRemote KernelListRemoteCmd `cmd:"" help:"list remote kernels"`
Autogen KernelAutogenCmd `cmd:"" help:"generate kernels based on the current config"`
@ -159,6 +161,10 @@ func (cmd *KernelCmd) Generate(g *Globals, km config.Target) (err error) {
container.Commands = g.Config.Docker.Commands
container.Registry = g.Config.Docker.Registry
container.Timeout = g.Config.Docker.Timeout.Duration
if cmd.ContainerTimeout != 0 {
container.Timeout = cmd.ContainerTimeout
}
log.Info().Msgf("Generating for target %v", km)