mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
cliconfig: use a const for ".docker" string
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
863b571617
commit
565712014f
2 changed files with 3 additions and 2 deletions
|
@ -17,6 +17,7 @@ import (
|
||||||
const (
|
const (
|
||||||
// ConfigFileName is the name of config file
|
// ConfigFileName is the name of config file
|
||||||
ConfigFileName = "config.json"
|
ConfigFileName = "config.json"
|
||||||
|
configFileDir = ".docker"
|
||||||
oldConfigfile = ".dockercfg"
|
oldConfigfile = ".dockercfg"
|
||||||
|
|
||||||
// This constant is only used for really old config files when the
|
// This constant is only used for really old config files when the
|
||||||
|
@ -31,7 +32,7 @@ var (
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if configDir == "" {
|
if configDir == "" {
|
||||||
configDir = filepath.Join(homedir.Get(), ".docker")
|
configDir = filepath.Join(homedir.Get(), configFileDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ func rawJSON(value interface{}) *json.RawMessage {
|
||||||
// ValidateID checks whether an ID string is a valid image ID.
|
// ValidateID checks whether an ID string is a valid image ID.
|
||||||
func ValidateID(id string) error {
|
func ValidateID(id string) error {
|
||||||
if ok := validHex.MatchString(id); !ok {
|
if ok := validHex.MatchString(id); !ok {
|
||||||
return fmt.Errorf("image ID '%s' is invalid ", id)
|
return fmt.Errorf("image ID %q is invalid", id)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue