Use const for default context name

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
This commit is contained in:
Christopher Crone 2020-05-18 11:38:14 +02:00
parent cd6d192d07
commit 292b6cbd84
1 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,8 @@ import (
"path/filepath"
"github.com/pkg/errors"
"github.com/docker/api/context/store"
)
// LoadFile loads the docker configuration
@ -56,7 +58,7 @@ func WriteCurrentContext(dir string, name string) error {
return err
}
// Match existing CLI behavior
if name == "default" {
if name == store.DefaultContextName {
delete(m, currentContextKey)
} else {
m[currentContextKey] = name