repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/types/http_code_range.go | pkg/types/http_code_range.go | package types
import (
"slices"
"strconv"
"strings"
)
// HTTPCodeRanges holds HTTP code ranges.
type HTTPCodeRanges [][2]int
// NewHTTPCodeRanges creates HTTPCodeRanges from a given []string.
// Break out the http status code ranges into a low int and high int
// for ease of use at runtime.
func NewHTTPCodeRanges... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/types/domain_test.go | pkg/types/domain_test.go | package types
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestDomain_ToStrArray(t *testing.T) {
testCases := []struct {
desc string
domain Domain
expected []string
}{
{
desc: "with Main and SANs",
domain: Domain{
Main: "foo.com",
SANs: []string{"bar.foo.com", "bir.f... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/types/file_or_content.go | pkg/types/file_or_content.go | package types
import "os"
// FileOrContent holds a file path or content.
type FileOrContent string
// String returns the FileOrContent in string format.
func (f FileOrContent) String() string {
return string(f)
}
// IsPath returns true if the FileOrContent is a file path, otherwise returns false.
func (f FileOrCon... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/types/tls.go | pkg/types/tls.go | package types
import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"os"
"github.com/rs/zerolog/log"
)
// +k8s:deepcopy-gen=true
// ClientTLS holds TLS specific configurations as client
// CA, Cert and Key can be either path or file contents.
type ClientTLS struct {
CA string `descrip... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/configuration.go | pkg/provider/configuration.go | package provider
import (
"bytes"
"context"
"maps"
"reflect"
"slices"
"strings"
"text/template"
"unicode"
"github.com/Masterminds/sprig/v3"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3/... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/provider.go | pkg/provider/provider.go | package provider
import (
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/safe"
)
// Provider defines methods of a provider.
type Provider interface {
// Provide allows the provider to provide configurations to traefik
// using the given configuration channel.
Provide(config... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/local_store_windows.go | pkg/provider/acme/local_store_windows.go | package acme
import "os"
// CheckFile checks file content size
// Do not check file permissions on Windows right now
func CheckFile(name string) (bool, error) {
f, err := os.Open(name)
if err != nil {
if os.IsNotExist(err) {
f, err = os.Create(name)
if err != nil {
return false, err
}
return false... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/challenge_tls.go | pkg/provider/acme/challenge_tls.go | package acme
import (
"fmt"
"slices"
"sync"
"time"
"github.com/go-acme/lego/v4/challenge/tlsalpn01"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3/pkg/safe"
traefiktls "github.com/traefik/tr... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/challenge_http.go | pkg/provider/acme/challenge_http.go | package acme
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"net/url"
"regexp"
"sync"
"time"
"github.com/go-acme/lego/v4/challenge/http01"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/observability/logs"
)
// ChallengeHTTP HTTP challenge provider implements challenge.Provider.
type ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/local_store_unix.go | pkg/provider/acme/local_store_unix.go | //go:build !windows
// +build !windows
package acme
import (
"fmt"
"os"
)
// CheckFile checks file permissions and content size.
func CheckFile(name string) (bool, error) {
f, err := os.Open(name)
if err != nil && os.IsNotExist(err) {
nf, err := os.Create(name)
if err != nil {
return false, err
}
defe... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/local_store.go | pkg/provider/acme/local_store.go | package acme
import (
"context"
"encoding/json"
"io"
"os"
"sync"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3/pkg/safe"
)
var _ Store = (*LocalStore)(nil)
// LocalStore Stores implementation for local file.
type LocalStore struct {
saveDa... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/store.go | pkg/provider/acme/store.go | package acme
// StoredData represents the data managed by Store.
type StoredData struct {
Account *Account
Certificates []*CertAndStore
}
// Store is a generic interface that represents a storage.
type Store interface {
GetAccount(resolverName string) (*Account, error)
SaveAccount(resolverName string, accoun... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/local_store_test.go | pkg/provider/acme/local_store_test.go | package acme
import (
"fmt"
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/traefik/v3/pkg/safe"
)
func TestLocalStore_GetAccount(t *testing.T) {
acmeFile := filepath.Join(t.TempDir(), "acme.json")
email := "some42@email.... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/provider.go | pkg/provider/acme/provider.go | package acme
import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"net"
"net/http"
"net/url"
"os"
"reflect"
"slices"
"sort"
"strconv"
"strings"
"sync"
"time"
"github.com/go-acme/lego/v4/certificate"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/account.go | pkg/provider/acme/account.go | package acme
import (
"context"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/registration"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/observability/logs"
)
// Account is used to store lets encrypt registration info.... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/acme/provider_test.go | pkg/provider/acme/provider_test.go | package acme
import (
"crypto/tls"
"testing"
"time"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/stretchr/testify/assert"
"github.com/traefik/traefik/v3/pkg/safe"
"github.com/traefik/traefik/v3/pkg/types"
)
func TestGetUncheckedCertificates(t *testing.T) {
t.Skip("Needs TLS Manager")
wildcardMap := m... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/file/file.go | pkg/provider/file/file.go | package file
import (
"bytes"
"context"
"errors"
"fmt"
"os"
"os/signal"
"path"
"path/filepath"
"strings"
"syscall"
"text/template"
"github.com/Masterminds/sprig/v3"
"github.com/fsnotify/fsnotify"
"github.com/rs/zerolog/log"
"github.com/traefik/paerser/file"
"github.com/traefik/traefik/v3/pkg/config/dy... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/file/file_test.go | pkg/provider/file/file_test.go | package file
import (
"io"
"os"
"path/filepath"
"strconv"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/safe"
)
type ProvideTestCase struct {
desc string
di... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/traefik/internal_test.go | pkg/provider/traefik/internal_test.go | package traefik
import (
"encoding/json"
"flag"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/traefik/v3/pkg/config/static"
otypes "github.com/traefik/traefik/v3/pkg/observability/types"
"github.com/traefik/traefik/v3/pkg/ping"
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/traefik/internal.go | pkg/provider/traefik/internal.go | package traefik
import (
"context"
"fmt"
"math"
"net"
"regexp"
"time"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/config/static"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3/pkg/provider"
"github... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/shared_test.go | pkg/provider/docker/shared_test.go | package docker
import (
"strconv"
"testing"
containertypes "github.com/docker/docker/api/types/container"
networktypes "github.com/docker/docker/api/types/network"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/go-connections/nat"
"github.com/stretchr/testify/assert"
"github.com/stre... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/data.go | pkg/provider/docker/data.go | package docker
import (
containertypes "github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
)
// dockerData holds the need data to the provider.
type dockerData struct {
ID string
ServiceName string
Name string
Status string
Labels ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/pswarm.go | pkg/provider/docker/pswarm.go | package docker
import (
"context"
"fmt"
"net"
"strconv"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/docker/docker/api/types/filters"
networktypes "github.com/docker/docker/api/types/network"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/api/types/versions"
"github.... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/pswarm_mock_test.go | pkg/provider/docker/pswarm_mock_test.go | package docker
import (
"context"
dockertypes "github.com/docker/docker/api/types"
containertypes "github.com/docker/docker/api/types/container"
networktypes "github.com/docker/docker/api/types/network"
swarmtypes "github.com/docker/docker/api/types/swarm"
dockerclient "github.com/docker/docker/client"
)
type ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/config.go | pkg/provider/docker/config.go | package docker
import (
"context"
"errors"
"fmt"
"net"
"strings"
containertypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/shared_labels.go | pkg/provider/docker/shared_labels.go | package docker
import (
"errors"
"fmt"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/label"
)
const (
labelDockerComposeProject = "com.docker.compose.project"
labelDockerComposeService = "com.docker.compose.service"
)
// configuration contains information from the labels that are globa... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/shared.go | pkg/provider/docker/shared.go | package docker
import (
"context"
"encoding/base64"
"fmt"
"net/http"
"text/template"
"time"
"github.com/docker/cli/cli/connhelper"
containertypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/docker/go-connections/sockets... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/config_test.go | pkg/provider/docker/config_test.go | package docker
import (
"strconv"
"testing"
"time"
containertypes "github.com/docker/docker/api/types/container"
networktypes "github.com/docker/docker/api/types/network"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/go-connections/nat"
"github.com/stretchr/testify/assert"
"github.... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/pdocker.go | pkg/provider/docker/pdocker.go | package docker
import (
"context"
"errors"
"fmt"
"io"
"strings"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/docker/docker/api/types/container"
eventtypes "github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"github.com/rs/zerolo... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/pswarm_test.go | pkg/provider/docker/pswarm_test.go | package docker
import (
"strconv"
"testing"
"time"
networktypes "github.com/docker/docker/api/types/network"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestListTasks(t *testing.T) {
testCases := []struct {
service ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/docker/builder_test.go | pkg/provider/docker/builder_test.go | package docker
import (
containertypes "github.com/docker/docker/api/types/container"
networktypes "github.com/docker/docker/api/types/network"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/go-connections/nat"
)
func containerJSON(ops ...func(*containertypes.InspectResponse)) containert... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/nomad/tag_test.go | pkg/provider/nomad/tag_test.go | package nomad
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_tagsToLabels(t *testing.T) {
testCases := []struct {
desc string
tags []string
prefix string
expected map[string]string
}{
{
desc: "no tags",
tags: []string{},
prefix: "traefik",
expected: ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/nomad/config.go | pkg/provider/nomad/config.go | package nomad
import (
"context"
"errors"
"fmt"
"hash/fnv"
"net"
"sort"
"strconv"
"strings"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/config/label"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/nomad/nomad.go | pkg/provider/nomad/nomad.go | package nomad
import (
"context"
"errors"
"fmt"
"strings"
"text/template"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/hashicorp/nomad/api"
"github.com/mitchellh/hashstructure"
"github.com/rs/zerolog/log"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/nomad/config_test.go | pkg/provider/nomad/config_test.go | package nomad
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/tls"
"github.com/traefik/traefik/v3/pkg/types"
)
func Test_default... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/nomad/nomad_test.go | pkg/provider/nomad/nomad_test.go | package nomad
import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/traefik/v3/pkg/types"
)
var responses = map[string][]byte{}
func TestMain(m *testing.M) {
err := setup()
if ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/nomad/tag.go | pkg/provider/nomad/tag.go | package nomad
import (
"strings"
)
func tagsToLabels(tags []string, prefix string) map[string]string {
labels := make(map[string]string, len(tags))
for _, tag := range tags {
if strings.HasPrefix(tag, prefix) {
if parts := strings.SplitN(tag, "=", 2); len(parts) == 2 {
left, right := strings.TrimSpace(par... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/constraints/constraints_tags.go | pkg/provider/constraints/constraints_tags.go | package constraints
import (
"errors"
"regexp"
"slices"
"github.com/vulcand/predicate"
)
type constraintTagFunc func([]string) bool
// MatchTags reports whether the expression matches with the given tags.
// The expression must match any logical boolean combination of:
// - `Tag(tagValue)`
// - `TagRegex(regexV... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/constraints/constraints_tags_test.go | pkg/provider/constraints/constraints_tags_test.go | package constraints
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestMatchTags(t *testing.T) {
testCases := []struct {
expr string
tags []string
expected bool
expectedErr bool
}{
{
expr: `Tag("world")`,
tags: []stri... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/constraints/constraints_labels.go | pkg/provider/constraints/constraints_labels.go | package constraints
import (
"errors"
"regexp"
"github.com/vulcand/predicate"
)
type constraintLabelFunc func(map[string]string) bool
// MatchLabels reports whether the expression matches with the given labels.
// The expression must match any logical boolean combination of:
// - `Label(labelName, labelValue)`
/... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/constraints/constraints_labels_test.go | pkg/provider/constraints/constraints_labels_test.go | package constraints
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestMatchLabels(t *testing.T) {
testCases := []struct {
expr string
labels map[string]string
expected bool
expectedErr bool
}{
{
expr: `Label("hello", "world")`,
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/kv.go | pkg/provider/kv/kv.go | package kv
import (
"context"
"errors"
"fmt"
"path"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/kvtools/valkeyrie"
"github.com/kvtools/valkeyrie/store"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/config/kv"
"github.com/traefik/t... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/kv_mock_test.go | pkg/provider/kv/kv_mock_test.go | package kv
import (
"context"
"errors"
"strings"
"github.com/kvtools/valkeyrie/store"
)
func newProviderMock(kvPairs []*store.KVPair) *Provider {
return &Provider{
RootKey: "traefik",
kvClient: newKvClientMock(kvPairs, nil),
}
}
// Override Get/List to return a error.
type KvError struct {
Get error
L... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/storewrapper.go | pkg/provider/kv/storewrapper.go | package kv
import (
"context"
"github.com/kvtools/valkeyrie/store"
"github.com/rs/zerolog/log"
)
type storeWrapper struct {
store.Store
}
func (s *storeWrapper) Put(ctx context.Context, key string, value []byte, options *store.WriteOptions) error {
log.Debug().Msgf("Put: %s %s", key, string(value))
if s.Stor... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/kv_test.go | pkg/provider/kv/kv_test.go | package kv
import (
"errors"
"testing"
"time"
"github.com/kvtools/valkeyrie/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/tls"
"github.com/traef... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/consul/consul.go | pkg/provider/kv/consul/consul.go | package consul
import (
"context"
"errors"
"fmt"
"time"
"github.com/kvtools/consul"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/provider/kv"
"github.com/traefik/traefik/v3/pkg/types"
)
// providerName is the Consul provider name.
const providerName = "consul"
var _ provid... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/consul/consul_test.go | pkg/provider/kv/consul/consul_test.go | package consul
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNamespaces(t *testing.T) {
testCases := []struct {
desc string
namespaces []string
expectedNamespaces []string
}{
{
desc: "no defined namespaces",
expectedNamespaces: []string{""},
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/zk/zk.go | pkg/provider/kv/zk/zk.go | package zk
import (
"time"
"github.com/kvtools/zookeeper"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/provider/kv"
)
var _ provider.Provider = (*Provider)(nil)
// Provider holds configurations of the provider.
type Provider struct {
kv.Provider `yaml:",inline" export:"true"`... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/redis/redis.go | pkg/provider/kv/redis/redis.go | package redis
import (
"context"
"errors"
"fmt"
"github.com/kvtools/redis"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/provider/kv"
"github.com/traefik/traefik/v3/pkg/types"
)
var _ provider.Provider = (*Provider)(nil)
// Provider holds configurations of the provider.
type... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kv/etcd/etcd.go | pkg/provider/kv/etcd/etcd.go | package etcd
import (
"context"
"fmt"
"time"
"github.com/kvtools/etcdv3"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/provider/kv"
"github.com/traefik/traefik/v3/pkg/types"
)
var _ provider.Provider = (*Provider)(nil)
// Provider holds configurations of the provider.
type P... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/tailscale/provider.go | pkg/provider/tailscale/provider.go | package tailscale
import (
"context"
"crypto/tls"
"crypto/x509"
"sort"
"strings"
"sync"
"time"
"github.com/rs/zerolog/log"
"github.com/tailscale/tscert"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/muxer/http"
"github.com/traefik/traefik/v3/pkg/muxer/tcp"
"github.... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/tailscale/provider_test.go | pkg/provider/tailscale/provider_test.go | package tailscale
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
traefiktls "github.com/traefik/traefik/v3/pkg/tls"
"github.com/traefik/traefik/v3/pkg/types"
)
func TestProvider_findDomains(t *testing.T) {
testCases := []struct {
desc string
con... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/rest/rest.go | pkg/provider/rest/rest.go | package rest
import (
"encoding/json"
"fmt"
"net/http"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/safe"
"github.com/unrolled/render"
)
var _ provider.Provider = (*Prov... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/aggregator/ring_channel.go | pkg/provider/aggregator/ring_channel.go | package aggregator
import (
"github.com/traefik/traefik/v3/pkg/config/dynamic"
)
// RingChannel implements a channel in a way that never blocks the writer.
// Specifically, if a value is written to a RingChannel when its buffer is full then the oldest
// value in the buffer is discarded to make room (just like a sta... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/aggregator/aggregator_test.go | pkg/provider/aggregator/aggregator_test.go | package aggregator
import (
"bytes"
"testing"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/p... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/aggregator/aggregator.go | pkg/provider/aggregator/aggregator.go | package aggregator
import (
"context"
"fmt"
"time"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/config/static"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/provider/file"
"github.com/traefik/traefik/v3/pkg... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/knative/client.go | pkg/provider/kubernetes/knative/client.go | package knative
import (
"context"
"errors"
"fmt"
"os"
"time"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
kinformers "k8s.io/client-go/informers"
kclientse... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/knative/kubernetes_test.go | pkg/provider/kubernetes/knative/kubernetes_test.go | package knative
import (
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
"k8s.io/apimachinery/pkg... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/knative/kubernetes.go | pkg/provider/kubernetes/knative/kubernetes.go | package knative
import (
"context"
"errors"
"fmt"
"maps"
"net"
"os"
"slices"
"strconv"
"strings"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/mitchellh/hashstructure"
"github.com/rs/zerolog/log"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/k8s/parser.go | pkg/provider/kubernetes/k8s/parser.go | package k8s
import (
"fmt"
"regexp"
"strings"
"github.com/rs/zerolog/log"
"k8s.io/apimachinery/pkg/runtime"
kscheme "k8s.io/client-go/kubernetes/scheme"
)
// MustParseYaml parses a YAML to objects.
func MustParseYaml(content []byte) []runtime.Object {
acceptedK8sTypes := regexp.MustCompile(`^(Namespace|Deploy... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/k8s/router_transform.go | pkg/provider/kubernetes/k8s/router_transform.go | package k8s
import (
"context"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"k8s.io/apimachinery/pkg/runtime"
)
type RouterTransform interface {
Apply(ctx context.Context, rt *dynamic.Router, object runtime.Object) error
}
| go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/k8s/event_handler_test.go | pkg/provider/kubernetes/k8s/event_handler_test.go | package k8s
import (
"testing"
"github.com/stretchr/testify/assert"
discoveryv1 "k8s.io/api/discovery/v1"
netv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func Test_detectChanges(t *testing.T) {
portA := int32(80)
portB := int32(8080)
tests := []struct {
name string
oldO... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/k8s/endpoint_test.go | pkg/provider/kubernetes/k8s/endpoint_test.go | package k8s
import (
"testing"
"github.com/stretchr/testify/assert"
v1 "k8s.io/api/discovery/v1"
)
func TestEndpointServing(t *testing.T) {
tests := []struct {
name string
endpoint v1.Endpoint
want bool
}{
{
name: "no status",
endpoint: v1.Endpoint{
Conditions: v1.EndpointConditions{
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/k8s/event_handler.go | pkg/provider/kubernetes/k8s/event_handler.go | package k8s
import (
discoveryv1 "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ResourceEventHandler handles Add, Update or Delete Events for resources.
type ResourceEventHandler struct {
Ev chan<- interface{}
}
// OnAdd is called on Add Events.
func (reh *ResourceEventHandler) OnAdd... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/k8s/endpoint.go | pkg/provider/kubernetes/k8s/endpoint.go | package k8s
import (
v1 "k8s.io/api/discovery/v1"
"k8s.io/utils/ptr"
)
// EndpointServing returns true if the endpoint is still serving the service.
func EndpointServing(endpoint v1.Endpoint) bool {
return ptr.Deref(endpoint.Conditions.Ready, false) || ptr.Deref(endpoint.Conditions.Serving, false)
}
| go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/builder_ingress_test.go | pkg/provider/kubernetes/ingress/builder_ingress_test.go | package ingress
import netv1 "k8s.io/api/networking/v1"
func buildIngress(opts ...func(*netv1.Ingress)) *netv1.Ingress {
i := &netv1.Ingress{}
i.Kind = "Ingress"
for _, opt := range opts {
opt(i)
}
return i
}
func iNamespace(value string) func(*netv1.Ingress) {
return func(i *netv1.Ingress) {
i.Namespace =... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/convert_test.go | pkg/provider/kubernetes/ingress/convert_test.go | package ingress
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
netv1 "k8s.io/api/networking/v1"
)
func Test_convertSlice_corev1_to_networkingv1(t *testing.T) {
g := []corev1.LoadBalancerIngress{
{
IP: "132456",
Hostname: "... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/client.go | pkg/provider/kubernetes/ingress/client.go | package ingress
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"runtime"
"slices"
"time"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
"github.com/traefik/traefik/v3/pkg/types"
traefikversion "github.com/traefik/traefik/v3/pkg/version"
corev1 "k8s.io/api/... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/annotations.go | pkg/provider/kubernetes/ingress/annotations.go | package ingress
import (
"regexp"
"strings"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/config/label"
)
const (
// https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
annotationsPrefix = "traefik.ingress.kubernetes.io... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/convert.go | pkg/provider/kubernetes/ingress/convert.go | package ingress
import (
"errors"
corev1 "k8s.io/api/core/v1"
netv1 "k8s.io/api/networking/v1"
)
type marshaler interface {
Marshal() ([]byte, error)
}
type unmarshaler interface {
Unmarshal(data []byte) error
}
type LoadBalancerIngress interface {
corev1.LoadBalancerIngress | netv1.IngressLoadBalancerIngres... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/client_test.go | pkg/provider/kubernetes/ingress/client_test.go | package ingress
import (
"errors"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
netv1 "k8s.io/api/networking/v1"
kerror "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/me... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/kubernetes_test.go | pkg/provider/kubernetes/ingress/kubernetes_test.go | package ingress
import (
"errors"
"fmt"
"math"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
traefikht... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/kubernetes.go | pkg/provider/kubernetes/ingress/kubernetes.go | package ingress
import (
"context"
"crypto/sha256"
"errors"
"fmt"
"math"
"net"
"os"
"regexp"
"slices"
"sort"
"strconv"
"strings"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/mitchellh/hashstructure"
"github.com/rs/zerolog/log"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/trae... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/annotations_test.go | pkg/provider/kubernetes/ingress/annotations_test.go | package ingress
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
otypes "github.com/traefik/traefik/v3/pkg/observability/types"
"github.com/traefik/traefik/v3/pkg/types"
)
func Test_parseRouterConfig(t *testing.T) {... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/ingress/client_mock_test.go | pkg/provider/kubernetes/ingress/client_mock_test.go | package ingress
import (
"fmt"
"os"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
corev1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
netv1 "k8s.io/api/networking/v1"
)
var _ Client = (*clientMock)(nil)
type clientMock struct {
ingresses []*netv1.Ingress
services []*co... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/tlsroute_test.go | pkg/provider/kubernetes/gateway/tlsroute_test.go | package gateway
import (
"testing"
"github.com/stretchr/testify/assert"
gatev1 "sigs.k8s.io/gateway-api/apis/v1"
)
func Test_hostSNIRule(t *testing.T) {
testCases := []struct {
desc string
hostnames []gatev1.Hostname
expectedRule string
expectedPriority int
expectError bool
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/client.go | pkg/provider/kubernetes/gateway/client.go | package gateway
import (
"context"
"errors"
"fmt"
"os"
"reflect"
"slices"
"time"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s"
"github.com/traefik/traefik/v3/pkg/types"
corev1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/features.go | pkg/provider/kubernetes/gateway/features.go | package gateway
import (
"sync"
"k8s.io/apimachinery/pkg/util/sets"
"sigs.k8s.io/gateway-api/pkg/features"
)
var SupportedFeatures = sync.OnceValue(func() []features.FeatureName {
featureSet := sets.New[features.Feature]().
Insert(features.GatewayCoreFeatures.UnsortedList()...).
Insert(features.GatewayExtend... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/tlsroute.go | pkg/provider/kubernetes/gateway/tlsroute.go | package gateway
import (
"context"
"fmt"
"net"
"regexp"
"strconv"
"strings"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ktypes "k8s.io/apimachinery/pkg/... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/grpcroute.go | pkg/provider/kubernetes/gateway/grpcroute.go | package gateway
import (
"context"
"errors"
"fmt"
"net"
"strconv"
"strings"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
"google.golang.org/grpc/codes"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/annotations.go | pkg/provider/kubernetes/gateway/annotations.go | package gateway
import (
"fmt"
"strings"
"github.com/traefik/traefik/v3/pkg/config/label"
)
const annotationsPrefix = "traefik.io/"
// ServiceConfig is the service's root configuration from annotations.
type ServiceConfig struct {
Service Service `json:"service"`
}
// Service is the service's configuration fro... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/tcproute.go | pkg/provider/kubernetes/gateway/tcproute.go | package gateway
import (
"context"
"fmt"
"net"
"strconv"
"strings"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ktypes "k8s.io/apimachinery/pkg/types"
"k... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/client_test.go | pkg/provider/kubernetes/gateway/client_test.go | package gateway
import (
"testing"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gatev1 "sigs.k8s.io/gateway-api/apis/v1"
)
func Test_gatewayStatusEquals(t *testing.T) {
testCases := []struct {
desc string
statusA gatev1.GatewayStatus
statusB gatev1.GatewayStatus... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/httproute_test.go | pkg/provider/kubernetes/gateway/httproute_test.go | package gateway
import (
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/utils/ptr"
gatev1 "sigs.k8s.io/gateway-api/apis/v1"
)
func Test_buildHostRule(t *testing.T) {
testCases := []struct {
desc string
hostnames []gatev1.Hostname
expectedRule string
expectedPriority int
... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/httproute.go | pkg/provider/kubernetes/gateway/httproute.go | package gateway
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"regexp"
"slices"
"strconv"
"strings"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
"github.com/traefik/traefik/v3/pkg/types"
corev1 "k8s.io/api/core/v1"
meta... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/kubernetes_test.go | pkg/provider/kubernetes/gateway/kubernetes_test.go | package gateway
import (
"errors"
"net/http"
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/provider"
traefikv1a... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/kubernetes.go | pkg/provider/kubernetes/gateway/kubernetes.go | package gateway
import (
"context"
"crypto/sha256"
"errors"
"fmt"
"os"
"slices"
"sort"
"strconv"
"strings"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/hashicorp/go-multierror"
"github.com/mitchellh/hashstructure"
"github.com/rs/zerolog/log"
ptypes "github.com/traefik/paerser/types"
"github.com... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/annotations_test.go | pkg/provider/kubernetes/gateway/annotations_test.go | package gateway
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/utils/ptr"
)
func Test_parseServiceConfig(t *testing.T) {
testCases := []struct {
desc string
annotations map[string]string
expected ServiceConfig
}{
{
desc: "service annot... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/gateway/grpcroute_test.go | pkg/provider/kubernetes/gateway/grpcroute_test.go | package gateway
import (
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/utils/ptr"
gatev1 "sigs.k8s.io/gateway-api/apis/v1"
)
func Test_buildGRPCMatchRule(t *testing.T) {
testCases := []struct {
desc string
match gatev1.GRPCRouteMatch
hostnames []gatev1.Hostname
exp... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/client.go | pkg/provider/kubernetes/crd/client.go | package crd
import (
"errors"
"fmt"
"os"
"path/filepath"
"runtime"
"slices"
"time"
"github.com/rs/zerolog/log"
traefikclientset "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned"
traefikinformers "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/info... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/kubernetes_udp.go | pkg/provider/kubernetes/crd/kubernetes_udp.go | package crd
import (
"context"
"errors"
"fmt"
"net"
"strconv"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
traefikv1alpha1 "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
corev1 "k8s.io/api/core/v1"
)
func (p *Provider) loadIngressRouteUDPConf... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/client_test.go | pkg/provider/kubernetes/crd/client_test.go | package crd
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
traefikcrdfake "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned/fake"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubefake "k8s... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/kubernetes_http.go | pkg/provider/kubernetes/crd/kubernetes_http.go | package crd
import (
"context"
"errors"
"fmt"
"net"
"strconv"
"strings"
"github.com/rs/zerolog/log"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3/pkg/provider"
traefikv1alph... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/kubernetes_tcp.go | pkg/provider/kubernetes/crd/kubernetes_tcp.go | package crd
import (
"context"
"errors"
"fmt"
"net"
"strconv"
"strings"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pkg/observability/logs"
"github.com/traefik/traefik/v3/pkg/provider"
traefikv1alpha1 "github.com/traefik/traefik/v3/pkg/provi... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/kubernetes_test.go | pkg/provider/kubernetes/crd/kubernetes_test.go | package crd
import (
"os"
"path/filepath"
"strings"
"testing"
"time"
auth "github.com/abbot/go-http-auth"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
"github.com/traefik/traefik/v3/pk... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/kubernetes.go | pkg/provider/kubernetes/crd/kubernetes.go | package crd
import (
"bufio"
"bytes"
"context"
"crypto/sha1"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"net"
"os"
"slices"
"sort"
"strconv"
"strings"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/mitchellh/hashstructure"
"github.com/rs/zerolog/log"
ptypes "github.com/t... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middleware.go | pkg/provider/kubernetes/crd/traefikio/v1alpha1/middleware.go | package v1alpha1
import (
"github.com/traefik/traefik/v3/pkg/config/dynamic"
apiextensionv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/traefikio/v1alpha1/zz_generated.deepcopy.go | pkg/provider/kubernetes/crd/traefikio/v1alpha1/zz_generated.deepcopy.go | //go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
The MIT License (MIT)
Copyright (c) 2016-2020 Containous SAS; 2020-2026 Traefik Labs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the So... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | true |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/traefikio/v1alpha1/tlsstore.go | pkg/provider/kubernetes/crd/traefikio/v1alpha1/tlsstore.go | package v1alpha1
import (
"github.com/traefik/traefik/v3/pkg/tls"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
// TLSStore is the CRD implementation of a Traefik TLS Store.
// For the time being, ... | go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
traefik/traefik | https://github.com/traefik/traefik/blob/f7280439e6378221a541910f43a01323d52db048/pkg/provider/kubernetes/crd/traefikio/v1alpha1/types.go | pkg/provider/kubernetes/crd/traefikio/v1alpha1/types.go | package v1alpha1
/*
This file is needed for kubernetes/code-generator/kube_codegen.sh script used in script/code-gen.sh.
*/
// +genclient
| go | MIT | f7280439e6378221a541910f43a01323d52db048 | 2026-01-07T08:35:43.502324Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.