mirror of https://github.com/docker/docs.git
Merge pull request #482 from nathanleclaire/empty_url
Make config and env return empty URL instead of error
This commit is contained in:
commit
4a81c4b17f
|
@ -279,7 +279,7 @@ func cmdConfig(c *cli.Context) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
fmt.Printf("--tls --tlscacert=%s --tlscert=%s --tlskey=%s -H %s",
|
fmt.Printf("--tls --tlscacert=%s --tlscert=%s --tlskey=%s -H=%q",
|
||||||
cfg.caCertPath, cfg.clientCertPath, cfg.clientKeyPath, cfg.machineUrl)
|
cfg.caCertPath, cfg.clientCertPath, cfg.clientKeyPath, cfg.machineUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,7 +554,11 @@ func getMachineConfig(c *cli.Context) (*machineConfig, error) {
|
||||||
clientKey := filepath.Join(utils.GetMachineClientCertDir(), "key.pem")
|
clientKey := filepath.Join(utils.GetMachineClientCertDir(), "key.pem")
|
||||||
machineUrl, err := machine.GetURL()
|
machineUrl, err := machine.GetURL()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error getting machine url: %s", err)
|
if err == drivers.ErrHostIsNotRunning {
|
||||||
|
machineUrl = ""
|
||||||
|
} else {
|
||||||
|
return nil, fmt.Errorf("Unexpected error getting machine url: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return &machineConfig{
|
return &machineConfig{
|
||||||
caCertPath: caCert,
|
caCertPath: caCert,
|
||||||
|
|
Loading…
Reference in New Issue