1
0
mirror of https://github.com/containous/traefik.git synced 2024-10-27 10:25:21 +03:00

fix: skip Provide when TLS is nil

This commit is contained in:
Ludovic Fernandez 2022-05-19 15:00:16 +02:00 committed by GitHub
parent 86cc6df374
commit ede2be1f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,10 +45,15 @@ func (p *Provider) Init() error {
// 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 {
if p.TLS == nil {
return nil
}
listener, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return fmt.Errorf("listener: %w", err)
}
port := listener.Addr().(*net.TCPAddr).Port
client, err := createAgentClient(p.TLS)