diff --git a/launcher_go/v2/cli_runtime.go b/launcher_go/v2/cli_runtime.go index 535e7a425..c22c1ba78 100644 --- a/launcher_go/v2/cli_runtime.go +++ b/launcher_go/v2/cli_runtime.go @@ -12,6 +12,7 @@ import ( "os" "os/exec" "runtime" + "slices" "strings" "syscall" "time" @@ -229,6 +230,11 @@ type RebuildCmd struct { } func (r *RebuildCmd) Run(cli *Cli, ctx *context.Context) error { + + if slices.Contains([]string{"", "0", "false"}, os.Getenv("SKIP_VERSION_CHECK")) { + CheckVersion() + } + config, err := config.LoadConfig(cli.ConfDir, r.Config, true, cli.TemplatesDir) if err != nil { return errors.New("YAML syntax error. Please check your containers/*.yml config files.") diff --git a/launcher_go/v2/cli_runtime_test.go b/launcher_go/v2/cli_runtime_test.go index 32069d437..f06432773 100644 --- a/launcher_go/v2/cli_runtime_test.go +++ b/launcher_go/v2/cli_runtime_test.go @@ -26,6 +26,9 @@ var _ = Describe("Runtime", func() { ctx = context.Background() + //Skip version checks for tests + os.Setenv("SKIP_VERSION_CHECK", "1") + cli = &ddocker.Cli{ ConfDir: "./test/containers", TemplatesDir: "./test", diff --git a/launcher_go/v2/main.go b/launcher_go/v2/main.go index 8286c519b..05550cd58 100644 --- a/launcher_go/v2/main.go +++ b/launcher_go/v2/main.go @@ -11,7 +11,6 @@ import ( "os" "os/exec" "os/signal" - "slices" ) type Cli struct { @@ -56,10 +55,6 @@ func main() { kongplete.WithPredictor("dir", complete.PredictDirs("*")), ) - if slices.Contains([]string{"", "0", "false"}, os.Getenv("SKIP_VERSION_CHECK")) { - CheckVersion() - } - ctx, err := parser.Parse(os.Args[1:]) parser.FatalIfErrorf(err)