Find docker index URL in ENV before using default value. Unit tests for docker pull
Upstream-commit: fc1d1d871b2f952ce83a6b7cedcdf4a86f0c953b Component: engine
This commit is contained in:
committed by
Guillaume J. Charmes
parent
28103013e9
commit
7c7dc4a8d7
@ -33,6 +33,13 @@ func NewAuthConfig(username, password, email, rootPath string) *AuthConfig {
|
||||
}
|
||||
}
|
||||
|
||||
func IndexServerAddress() string {
|
||||
if os.Getenv("DOCKER_INDEX_URL") != "" {
|
||||
return os.Getenv("DOCKER_INDEX_URL")
|
||||
}
|
||||
return INDEX_SERVER
|
||||
}
|
||||
|
||||
// create a base64 encoded auth string to store in config
|
||||
func EncodeAuth(authConfig *AuthConfig) string {
|
||||
authStr := authConfig.Username + ":" + authConfig.Password
|
||||
|
||||
Reference in New Issue
Block a user