From 50893d72d47f0c531aff2629ed8b5be9b3ed5c1c Mon Sep 17 00:00:00 2001 From: Nick Santos Date: Thu, 14 Jul 2022 14:21:20 -0400 Subject: [PATCH] also treat DOCKER_CONTEXT='' as unset Signed-off-by: Nick Santos --- cli/command/cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/command/cli.go b/cli/command/cli.go index 497e0f9e51..afa7cd3387 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -459,7 +459,7 @@ func resolveContextName(opts *cliflags.CommonOptions, config *configfile.ConfigF if os.Getenv(client.EnvOverrideHost) != "" { return DefaultContextName, nil } - if ctxName, ok := os.LookupEnv("DOCKER_CONTEXT"); ok { + if ctxName := os.Getenv("DOCKER_CONTEXT"); ctxName != "" { return ctxName, nil } if config != nil && config.CurrentContext != "" {