Fix ObservabilityConfig SetDefaults
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Build and Publish Documentation / Doc Process (push) Waiting to run
Build experimental image on branch / build-webui (push) Waiting to run
Build experimental image on branch / Build experimental image on branch (push) Waiting to run

This commit is contained in:
Michael 2026-02-09 10:48:05 +01:00 committed by GitHub
parent ef546944b1
commit d337748873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View file

@ -9,6 +9,7 @@ import (
traefiktls "github.com/traefik/traefik/v3/pkg/tls"
"github.com/traefik/traefik/v3/pkg/types"
"google.golang.org/grpc/codes"
"k8s.io/utils/ptr"
)
const (
@ -357,8 +358,7 @@ func (l *ServersLoadBalancer) Mergeable(loadBalancer *ServersLoadBalancer) bool
// SetDefaults Default values for a ServersLoadBalancer.
func (l *ServersLoadBalancer) SetDefaults() {
defaultPassHostHeader := DefaultPassHostHeader
l.PassHostHeader = &defaultPassHostHeader
l.PassHostHeader = ptr.To(DefaultPassHostHeader)
l.Strategy = BalancerStrategyWRR
l.ResponseForwarding = &ResponseForwarding{}
@ -415,8 +415,7 @@ type ServerHealthCheck struct {
// SetDefaults Default values for a HealthCheck.
func (h *ServerHealthCheck) SetDefaults() {
fr := true
h.FollowRedirects = &fr
h.FollowRedirects = ptr.To(true)
h.Mode = "http"
h.Interval = DefaultHealthCheckInterval
h.Timeout = DefaultHealthCheckTimeout

View file

@ -9,6 +9,7 @@ import (
ptypes "github.com/traefik/paerser/types"
otypes "github.com/traefik/traefik/v3/pkg/observability/types"
"github.com/traefik/traefik/v3/pkg/types"
"k8s.io/utils/ptr"
)
// EntryPoint holds the entry point configuration.
@ -76,8 +77,7 @@ type HTTPConfig struct {
// SetDefaults sets the default values.
func (c *HTTPConfig) SetDefaults() {
sanitizePath := true
c.SanitizePath = &sanitizePath
c.SanitizePath = ptr.To(true)
c.MaxHeaderBytes = http.DefaultMaxHeaderBytes
}
@ -200,9 +200,8 @@ type ObservabilityConfig struct {
// SetDefaults sets the default values.
func (o *ObservabilityConfig) SetDefaults() {
defaultValue := true
o.AccessLogs = &defaultValue
o.Metrics = &defaultValue
o.Tracing = &defaultValue
o.AccessLogs = ptr.To(true)
o.Metrics = ptr.To(true)
o.Tracing = ptr.To(true)
o.TraceVerbosity = otypes.MinimalVerbosity
}