mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
registry: remove unused error return from HostCertsDir()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6e3e657ea6
commit
273dca4e3c
2 changed files with 6 additions and 16 deletions
|
@ -183,10 +183,8 @@ func (daemon *Daemon) RegistryHosts() docker.RegistryHosts {
|
|||
}
|
||||
|
||||
for k, v := range m {
|
||||
if d, err := registry.HostCertsDir(k); err == nil {
|
||||
v.TLSConfigDir = []string{d}
|
||||
m[k] = v
|
||||
}
|
||||
v.TLSConfigDir = []string{registry.HostCertsDir(k)}
|
||||
m[k] = v
|
||||
}
|
||||
|
||||
certsDir := registry.CertsDir()
|
||||
|
|
|
@ -16,13 +16,9 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// HostCertsDir returns the config directory for a specific host
|
||||
func HostCertsDir(hostname string) (string, error) {
|
||||
certsDir := CertsDir()
|
||||
|
||||
hostDir := filepath.Join(certsDir, cleanPath(hostname))
|
||||
|
||||
return hostDir, nil
|
||||
// HostCertsDir returns the config directory for a specific host.
|
||||
func HostCertsDir(hostname string) string {
|
||||
return filepath.Join(CertsDir(), cleanPath(hostname))
|
||||
}
|
||||
|
||||
func newTLSConfig(hostname string, isSecure bool) (*tls.Config, error) {
|
||||
|
@ -32,11 +28,7 @@ func newTLSConfig(hostname string, isSecure bool) (*tls.Config, error) {
|
|||
tlsConfig.InsecureSkipVerify = !isSecure
|
||||
|
||||
if isSecure && CertsDir() != "" {
|
||||
hostDir, err := HostCertsDir(hostname)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
hostDir := HostCertsDir(hostname)
|
||||
logrus.Debugf("hostDir: %s", hostDir)
|
||||
if err := ReadCertsDirectory(tlsConfig, hostDir); err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Reference in a new issue