Merge current v2.11 into v3.2
This commit is contained in:
commit
f62fc67418
6 changed files with 15 additions and 10 deletions
2
.github/workflows/validate.yaml
vendored
2
.github/workflows/validate.yaml
vendored
|
@ -7,7 +7,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: '1.23'
|
GO_VERSION: '1.23'
|
||||||
GOLANGCI_LINT_VERSION: v1.62.0
|
GOLANGCI_LINT_VERSION: v1.63.3
|
||||||
MISSPELL_VERSION: v0.6.0
|
MISSPELL_VERSION: v0.6.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -139,6 +139,9 @@ linters-settings:
|
||||||
- name: unreachable-code
|
- name: unreachable-code
|
||||||
- name: redefines-builtin-id
|
- name: redefines-builtin-id
|
||||||
gomoddirectives:
|
gomoddirectives:
|
||||||
|
tool-forbidden: true
|
||||||
|
toolchain-pattern: 'go1\.\d+\.\d+$'
|
||||||
|
go-version-pattern: '^1\.\d+(\.0)?$'
|
||||||
replace-allow-list:
|
replace-allow-list:
|
||||||
- github.com/abbot/go-http-auth
|
- github.com/abbot/go-http-auth
|
||||||
- github.com/gorilla/mux
|
- github.com/gorilla/mux
|
||||||
|
|
|
@ -7,9 +7,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
stdlog "log"
|
stdlog "log"
|
||||||
|
"maps"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
@ -48,7 +50,6 @@ import (
|
||||||
"github.com/traefik/traefik/v3/pkg/tracing"
|
"github.com/traefik/traefik/v3/pkg/tracing"
|
||||||
"github.com/traefik/traefik/v3/pkg/types"
|
"github.com/traefik/traefik/v3/pkg/types"
|
||||||
"github.com/traefik/traefik/v3/pkg/version"
|
"github.com/traefik/traefik/v3/pkg/version"
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -230,8 +231,8 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
||||||
pluginLogger := log.Ctx(ctx).With().Logger()
|
pluginLogger := log.Ctx(ctx).With().Logger()
|
||||||
hasPlugins := staticConfiguration.Experimental != nil && (staticConfiguration.Experimental.Plugins != nil || staticConfiguration.Experimental.LocalPlugins != nil)
|
hasPlugins := staticConfiguration.Experimental != nil && (staticConfiguration.Experimental.Plugins != nil || staticConfiguration.Experimental.LocalPlugins != nil)
|
||||||
if hasPlugins {
|
if hasPlugins {
|
||||||
pluginsList := maps.Keys(staticConfiguration.Experimental.Plugins)
|
pluginsList := slices.Collect(maps.Keys(staticConfiguration.Experimental.Plugins))
|
||||||
pluginsList = append(pluginsList, maps.Keys(staticConfiguration.Experimental.LocalPlugins)...)
|
pluginsList = append(pluginsList, slices.Collect(maps.Keys(staticConfiguration.Experimental.LocalPlugins))...)
|
||||||
|
|
||||||
pluginLogger = pluginLogger.With().Strs("plugins", pluginsList).Logger()
|
pluginLogger = pluginLogger.With().Strs("plugins", pluginsList).Logger()
|
||||||
pluginLogger.Info().Msg("Loading plugins...")
|
pluginLogger.Info().Msg("Loading plugins...")
|
||||||
|
|
|
@ -820,7 +820,7 @@ func assertValidLogData(t *testing.T, expected string, logData []byte) {
|
||||||
func captureStdout(t *testing.T) (out *os.File, restoreStdout func()) {
|
func captureStdout(t *testing.T) (out *os.File, restoreStdout func()) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
file, err := os.CreateTemp("", "testlogger")
|
file, err := os.CreateTemp(t.TempDir(), "testlogger")
|
||||||
require.NoError(t, err, "failed to create temp file")
|
require.NoError(t, err, "failed to create temp file")
|
||||||
|
|
||||||
original := os.Stdout
|
original := os.Stdout
|
||||||
|
|
|
@ -4,13 +4,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/traefik/traefik/v3/pkg/ip"
|
"github.com/traefik/traefik/v3/pkg/ip"
|
||||||
"github.com/traefik/traefik/v3/pkg/middlewares/requestdecorator"
|
"github.com/traefik/traefik/v3/pkg/middlewares/requestdecorator"
|
||||||
"golang.org/x/exp/slices"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var httpFuncs = map[string]func(*matchersTree, ...string) error{
|
var httpFuncs = map[string]func(*matchersTree, ...string) error{
|
||||||
|
|
|
@ -3,7 +3,9 @@ package provider
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"maps"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
@ -14,7 +16,6 @@ import (
|
||||||
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
||||||
"github.com/traefik/traefik/v3/pkg/logs"
|
"github.com/traefik/traefik/v3/pkg/logs"
|
||||||
"github.com/traefik/traefik/v3/pkg/tls"
|
"github.com/traefik/traefik/v3/pkg/tls"
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Merge merges multiple configurations.
|
// Merge merges multiple configurations.
|
||||||
|
@ -423,7 +424,7 @@ func BuildTCPRouterConfiguration(ctx context.Context, configuration *dynamic.TCP
|
||||||
if len(configuration.Services) > 1 {
|
if len(configuration.Services) > 1 {
|
||||||
delete(configuration.Routers, routerName)
|
delete(configuration.Routers, routerName)
|
||||||
loggerRouter.Error().
|
loggerRouter.Error().
|
||||||
Msgf("Router %s cannot be linked automatically with multiple Services: %q", routerName, maps.Keys(configuration.Services))
|
Msgf("Router %s cannot be linked automatically with multiple Services: %q", routerName, slices.Collect(maps.Keys(configuration.Services)))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,7 +447,7 @@ func BuildUDPRouterConfiguration(ctx context.Context, configuration *dynamic.UDP
|
||||||
if len(configuration.Services) > 1 {
|
if len(configuration.Services) > 1 {
|
||||||
delete(configuration.Routers, routerName)
|
delete(configuration.Routers, routerName)
|
||||||
loggerRouter.Error().
|
loggerRouter.Error().
|
||||||
Msgf("Router %s cannot be linked automatically with multiple Services: %q", routerName, maps.Keys(configuration.Services))
|
Msgf("Router %s cannot be linked automatically with multiple Services: %q", routerName, slices.Collect(maps.Keys(configuration.Services)))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,7 +495,7 @@ func BuildRouterConfiguration(ctx context.Context, configuration *dynamic.HTTPCo
|
||||||
if len(configuration.Services) > 1 {
|
if len(configuration.Services) > 1 {
|
||||||
delete(configuration.Routers, routerName)
|
delete(configuration.Routers, routerName)
|
||||||
loggerRouter.Error().
|
loggerRouter.Error().
|
||||||
Msgf("Router %s cannot be linked automatically with multiple Services: %q", routerName, maps.Keys(configuration.Services))
|
Msgf("Router %s cannot be linked automatically with multiple Services: %q", routerName, slices.Collect(maps.Keys(configuration.Services)))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue