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
|
@ -183,11 +183,9 @@ func (daemon *Daemon) RegistryHosts() docker.RegistryHosts {
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range m {
|
for k, v := range m {
|
||||||
if d, err := registry.HostCertsDir(k); err == nil {
|
v.TLSConfigDir = []string{registry.HostCertsDir(k)}
|
||||||
v.TLSConfigDir = []string{d}
|
|
||||||
m[k] = v
|
m[k] = v
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
certsDir := registry.CertsDir()
|
certsDir := registry.CertsDir()
|
||||||
if fis, err := os.ReadDir(certsDir); err == nil {
|
if fis, err := os.ReadDir(certsDir); err == nil {
|
||||||
|
|
|
@ -16,13 +16,9 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HostCertsDir returns the config directory for a specific host
|
// HostCertsDir returns the config directory for a specific host.
|
||||||
func HostCertsDir(hostname string) (string, error) {
|
func HostCertsDir(hostname string) string {
|
||||||
certsDir := CertsDir()
|
return filepath.Join(CertsDir(), cleanPath(hostname))
|
||||||
|
|
||||||
hostDir := filepath.Join(certsDir, cleanPath(hostname))
|
|
||||||
|
|
||||||
return hostDir, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTLSConfig(hostname string, isSecure bool) (*tls.Config, error) {
|
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
|
tlsConfig.InsecureSkipVerify = !isSecure
|
||||||
|
|
||||||
if isSecure && CertsDir() != "" {
|
if isSecure && CertsDir() != "" {
|
||||||
hostDir, err := HostCertsDir(hostname)
|
hostDir := HostCertsDir(hostname)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
logrus.Debugf("hostDir: %s", hostDir)
|
logrus.Debugf("hostDir: %s", hostDir)
|
||||||
if err := ReadCertsDirectory(tlsConfig, hostDir); err != nil {
|
if err := ReadCertsDirectory(tlsConfig, hostDir); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue