Repository: traefik/traefik
File: pkg/config/static/static_config.go (Go)

Code before:

	if c.Providers.Swarm != nil {
		if c.Providers.Swarm.RefreshSeconds <= 0 {
			c.Providers.Swarm.RefreshSeconds = ptypes.Duration(15 * time.Second)
		}

		if c.Providers.Swarm.HTTPClientTimeout < 0 {
			c.Providers.Swarm.HTTPClientTimeout = 0
		}
	}

	// Configure Gateway API provider
	if c.Providers.KubernetesGateway != nil {
		entryPoints := make(map[string]gateway.Entrypoint)
		for epName, entryPoint := range c.EntryPoints {
			entryPoints[epName] = gateway.Entrypoint{Address: entryPoint.GetAddress(), HasHTTPTLSConf: entryPoint.HTTP.TLS != nil}
		}

		if c.Providers.KubernetesCRD != nil {
			c.Providers.KubernetesCRD.FillExtensionBuilderRegistry(c.Providers.KubernetesGateway)
		}

		c.Providers.KubernetesGateway.EntryPoints = entryPoints
	}

	// Configure Ingress NGINX provider
	if c.Providers.KubernetesIngressNGINX != nil {
		var nonTLSEntryPoints []string
		for epName, entryPoint := range c.EntryPoints {
			if entryPoint.HTTP.TLS == nil {
				nonTLSEntryPoints = append(nonTLSEntryPoints, epName)
			}
		}

		c.Providers.KubernetesIngressNGINX.NonTLSEntryPoints = nonTLSEntryPoints
	}

	// Defines the default rule syntax for the Kubernetes Ingress Provider.
	// This allows the provider to adapt the matcher syntax to the desired rule syntax version.
	if c.Core != nil && c.Providers.KubernetesIngress != nil {
		c.Providers.KubernetesIngress.DefaultRuleSyntax = c.Core.DefaultRuleSyntax
	}

	for _, resolver := range c.CertificatesResolvers {
		if resolver.ACME == nil {
			continue
		}

		if resolver.ACME.DNSChallenge == nil {
			continue
		}

Review comment (suggestion):
```suggestion
	// Configure Ingress NGINX provider.
```

Code after:

	if c.Providers.Swarm != nil {
		if c.Providers.Swarm.RefreshSeconds <= 0 {
			c.Providers.Swarm.RefreshSeconds = ptypes.Duration(15 * time.Second)
		}

		if c.Providers.Swarm.HTTPClientTimeout < 0 {
			c.Providers.Swarm.HTTPClientTimeout = 0
		}
	}

	// Configure Gateway API provider
	if c.Providers.KubernetesGateway != nil {
		entryPoints := make(map[string]gateway.Entrypoint)
		for epName, entryPoint := range c.EntryPoints {
			entryPoints[epName] = gateway.Entrypoint{Address: entryPoint.GetAddress(), HasHTTPTLSConf: entryPoint.HTTP.TLS != nil}
		}

		if c.Providers.KubernetesCRD != nil {
			c.Providers.KubernetesCRD.FillExtensionBuilderRegistry(c.Providers.KubernetesGateway)
		}

		c.Providers.KubernetesGateway.EntryPoints = entryPoints
	}

	// Configure Ingress NGINX provider.
	if c.Providers.KubernetesIngressNGINX != nil {
		var nonTLSEntryPoints []string
		for epName, entryPoint := range c.EntryPoints {
			if entryPoint.HTTP.TLS == nil {
				nonTLSEntryPoints = append(nonTLSEntryPoints, epName)
			}
		}

		c.Providers.KubernetesIngressNGINX.NonTLSEntryPoints = nonTLSEntryPoints
	}

	// Defines the default rule syntax for the Kubernetes Ingress Provider.
	// This allows the provider to adapt the matcher syntax to the desired rule syntax version.
	if c.Core != nil && c.Providers.KubernetesIngress != nil {
		c.Providers.KubernetesIngress.DefaultRuleSyntax = c.Core.DefaultRuleSyntax
	}

	for _, resolver := range c.CertificatesResolvers {
		if resolver.ACME == nil {
			continue
		}

		if resolver.ACME.DNSChallenge == nil {
			continue
		}