1
0
mirror of https://github.com/containous/traefik.git synced 2025-01-07 17:17:53 +03:00

Merge current v2.11 into v3.2

This commit is contained in:
romain 2025-01-03 14:36:40 +01:00
commit f62fc67418
6 changed files with 15 additions and 10 deletions

View File

@ -7,7 +7,7 @@ on:
env:
GO_VERSION: '1.23'
GOLANGCI_LINT_VERSION: v1.62.0
GOLANGCI_LINT_VERSION: v1.63.3
MISSPELL_VERSION: v0.6.0
jobs:

View File

@ -139,6 +139,9 @@ linters-settings:
- name: unreachable-code
- name: redefines-builtin-id
gomoddirectives:
tool-forbidden: true
toolchain-pattern: 'go1\.\d+\.\d+$'
go-version-pattern: '^1\.\d+(\.0)?$'
replace-allow-list:
- github.com/abbot/go-http-auth
- github.com/gorilla/mux

View File

@ -7,9 +7,11 @@ import (
"fmt"
"io"
stdlog "log"
"maps"
"net/http"
"os"
"os/signal"
"slices"
"sort"
"strings"
"syscall"
@ -48,7 +50,6 @@ import (
"github.com/traefik/traefik/v3/pkg/tracing"
"github.com/traefik/traefik/v3/pkg/types"
"github.com/traefik/traefik/v3/pkg/version"
"golang.org/x/exp/maps"
)
func main() {
@ -230,8 +231,8 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
pluginLogger := log.Ctx(ctx).With().Logger()
hasPlugins := staticConfiguration.Experimental != nil && (staticConfiguration.Experimental.Plugins != nil || staticConfiguration.Experimental.LocalPlugins != nil)
if hasPlugins {
pluginsList := maps.Keys(staticConfiguration.Experimental.Plugins)
pluginsList = append(pluginsList, maps.Keys(staticConfiguration.Experimental.LocalPlugins)...)
pluginsList := slices.Collect(maps.Keys(staticConfiguration.Experimental.Plugins))
pluginsList = append(pluginsList, slices.Collect(maps.Keys(staticConfiguration.Experimental.LocalPlugins))...)
pluginLogger = pluginLogger.With().Strs("plugins", pluginsList).Logger()
pluginLogger.Info().Msg("Loading plugins...")

View File

@ -820,7 +820,7 @@ func assertValidLogData(t *testing.T, expected string, logData []byte) {
func captureStdout(t *testing.T) (out *os.File, restoreStdout func()) {
t.Helper()
file, err := os.CreateTemp("", "testlogger")
file, err := os.CreateTemp(t.TempDir(), "testlogger")
require.NoError(t, err, "failed to create temp file")
original := os.Stdout

View File

@ -4,13 +4,13 @@ import (
"fmt"
"net/http"
"regexp"
"slices"
"strings"
"unicode/utf8"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/ip"
"github.com/traefik/traefik/v3/pkg/middlewares/requestdecorator"
"golang.org/x/exp/slices"
)
var httpFuncs = map[string]func(*matchersTree, ...string) error{

View File

@ -3,7 +3,9 @@ package provider
import (
"bytes"
"context"
"maps"
"reflect"
"slices"
"sort"
"strings"
"text/template"
@ -14,7 +16,6 @@ import (
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/logs"
"github.com/traefik/traefik/v3/pkg/tls"
"golang.org/x/exp/maps"
)
// Merge merges multiple configurations.
@ -423,7 +424,7 @@ func BuildTCPRouterConfiguration(ctx context.Context, configuration *dynamic.TCP
if len(configuration.Services) > 1 {
delete(configuration.Routers, routerName)
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
}
@ -446,7 +447,7 @@ func BuildUDPRouterConfiguration(ctx context.Context, configuration *dynamic.UDP
if len(configuration.Services) > 1 {
delete(configuration.Routers, routerName)
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
}
@ -494,7 +495,7 @@ func BuildRouterConfiguration(ctx context.Context, configuration *dynamic.HTTPCo
if len(configuration.Services) > 1 {
delete(configuration.Routers, routerName)
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
}