also treat DOCKER_CONTEXT='' as unset

Signed-off-by: Nick Santos <nick.santos@docker.com>
This commit is contained in:
Nick Santos 2022-07-14 14:21:20 -04:00 committed by Sebastiaan van Stijn
parent aa7b1b24a5
commit 50893d72d4
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 1 deletions

View File

@ -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 != "" {