fix: skip Provide when TLS is nil
This commit is contained in:
parent
86cc6df374
commit
ede2be1f66
1 changed files with 5 additions and 0 deletions
|
@ -45,10 +45,15 @@ func (p *Provider) Init() error {
|
||||||
|
|
||||||
// Provide allows the hub provider to provide configurations to traefik using the given configuration channel.
|
// Provide allows the hub provider to provide configurations to traefik using the given configuration channel.
|
||||||
func (p *Provider) Provide(configurationChan chan<- dynamic.Message, _ *safe.Pool) error {
|
func (p *Provider) Provide(configurationChan chan<- dynamic.Message, _ *safe.Pool) error {
|
||||||
|
if p.TLS == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
listener, err := net.Listen("tcp", "127.0.0.1:0")
|
listener, err := net.Listen("tcp", "127.0.0.1:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("listener: %w", err)
|
return fmt.Errorf("listener: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
port := listener.Addr().(*net.TCPAddr).Port
|
port := listener.Addr().(*net.TCPAddr).Port
|
||||||
|
|
||||||
client, err := createAgentClient(p.TLS)
|
client, err := createAgentClient(p.TLS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue