Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
bugfix: paas registry mirror tls config into dfget config.
Browse files Browse the repository at this point in the history
Signed-off-by: zhouchencheng <[email protected]>
  • Loading branch information
zcc35357949 committed Sep 18, 2019
1 parent 9114104 commit b13eb92
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dfdaemon/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/dragonflyoss/Dragonfly/pkg/rate"

"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
)

Expand Down Expand Up @@ -151,6 +152,17 @@ func (p *Properties) DFGetConfig() DFGetConfig {
if p.HijackHTTPS != nil {
dfgetConfig.HostsConfig = p.HijackHTTPS.Hosts
}
if p.RegistryMirror != nil {
exp, err := NewRegexp(p.RegistryMirror.Remote.Host)
if err != nil {
logrus.Errorf("invalid regexp: %v", err)
}
dfgetConfig.HostsConfig = append(dfgetConfig.HostsConfig, &HijackHost{
Regx: exp,
Insecure: p.RegistryMirror.Insecure,
Certs: p.RegistryMirror.Certs,
})
}
return dfgetConfig
}

Expand Down

0 comments on commit b13eb92

Please sign in to comment.