diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 16aa12d6a..15db3ed12 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -7,7 +7,7 @@ on: env: GO_VERSION: 1.17 - GOLANGCI_LINT_VERSION: v1.44.0 + GOLANGCI_LINT_VERSION: v1.45.0 MISSSPELL_VERSION: v0.3.4 IN_DOCKER: "" diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 981c0a90d..65e89b9b2 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -25,7 +25,7 @@ global_job_config: - export "PATH=${GOPATH}/bin:${PATH}" - mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin" - export GOPROXY=https://proxy.golang.org,direct - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.44.0 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.45.0 - curl -sSfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | bash -s -- -b "${GOPATH}/bin" - checkout - cache restore traefik-$(checksum go.sum) diff --git a/README.md b/README.md index c51d744ee..be68ddf0b 100644 --- a/README.md +++ b/README.md @@ -88,8 +88,6 @@ You can access the simple HTML frontend of Traefik. You can find the complete documentation of Traefik v2 at [https://doc.traefik.io/traefik/](https://doc.traefik.io/traefik/). -If you are using Traefik v1, you can find the complete documentation at [https://doc.traefik.io/traefik/v1.7/](https://doc.traefik.io/traefik/v1.7/). - A collection of contributions around Traefik can be found at [https://awesome.traefik.io](https://awesome.traefik.io). ## Support diff --git a/build.Dockerfile b/build.Dockerfile index e86cd0c2a..ecd4430b8 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -13,7 +13,7 @@ RUN mkdir -p /usr/local/bin \ | tar -xzC /usr/local/bin --transform 's#^.+/##x' # Download golangci-lint binary to bin folder in $GOPATH -RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.44.0 +RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.45.0 # Download misspell binary to bin folder in $GOPATH RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4 diff --git a/docs/content/deprecation/releases.md b/docs/content/deprecation/releases.md new file mode 100644 index 000000000..1ff1f5ece --- /dev/null +++ b/docs/content/deprecation/releases.md @@ -0,0 +1,37 @@ +# Releases + +## Versions + +Below is a non-exhaustive list of versions and their maintenance status: + +| Version | Release Date | Active Support | Security Support | +|---------|--------------|--------------------|------------------| +| 2.6 | Jan 24, 2022 | Yes | Yes | +| 2.5 | Aug 17, 2021 | Ended Jan 24, 2022 | No | +| 2.4 | Jan 19, 2021 | Ended Aug 17, 2021 | No | +| 2.3 | Sep 23, 2020 | Ended Jan 19, 2021 | No | +| 2.2 | Mar 25, 2020 | Ended Sep 23, 2020 | No | +| 2.1 | Dec 11, 2019 | Ended Mar 25, 2020 | No | +| 2.0 | Sep 16, 2019 | Ended Dec 11, 2019 | No | +| 1.7 | Sep 24, 2018 | Ended Dec 31, 2021 | Contact Support | + +??? example "Active Support / Security Support" + + **Active support**: receives any bug fixes. + **Security support**: receives only critical bug and security fixes. + +This page is maintained and updated periodically to reflect our roadmap and any decisions affecting the end of support for Traefik Proxy. + +Please refer to our migration guides for specific instructions on upgrading between versions, an example is the [v1 to v2 migration guide](../migration/v1-to-v2.md). + +!!! important "All target dates for end of support or feature removal announcements may be subject to change." + +## Versioning Scheme + +The Traefik Proxy project follows the [semantic versioning](https://semver.org/) scheme and maintains a separate branch for each minor version. The main branch always represents the next upcoming minor or major version. + +And these are our guiding rules for version support: + +- **Only the latest `minor`** will be on active support at any given time +- **The last `minor` after releasing a new `major`** will be supported for 1 year following the `major` release +- **Previous rules are subject to change** and in such cases an announcement will be made publicly, [here](https://traefik.io/blog/traefik-2-1-in-the-wild/) is an example extending v1.x branch support. diff --git a/docs/content/getting-started/concepts.md b/docs/content/getting-started/concepts.md index 6d1f64cf7..94baed8e5 100644 --- a/docs/content/getting-started/concepts.md +++ b/docs/content/getting-started/concepts.md @@ -19,7 +19,7 @@ Deploying your services, you attach information that tells Traefik the character ![Decentralized Configuration](../assets/img/traefik-concepts-2.png) It means that when a service is deployed, Traefik detects it immediately and updates the routing rules in real time. -The opposite is true: when you remove a service from your infrastructure, the route will disappear accordingly. +Similarly, when a service is removed from the infrastructure, the corresponding route is deleted accordingly. You no longer need to create and synchronize configuration files cluttered with IP addresses or other rules. diff --git a/docs/content/https/tls.md b/docs/content/https/tls.md index 612bd78bd..43ecbeb06 100644 --- a/docs/content/https/tls.md +++ b/docs/content/https/tls.md @@ -128,6 +128,30 @@ tls: keyFile = "path/to/cert.key" ``` +```yaml tab="Kubernetes" +apiVersion: traefik.containo.us/v1alpha1 +kind: TLSStore +metadata: + name: default + namespace: default + +spec: + defaultCertificate: + secretName: default-certificate + +--- +apiVersion: v1 +kind: Secret +metadata: + name: default-certificate + namespace: default + +type: Opaque +data: + tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0= + tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0= +``` + If no default certificate is provided, Traefik generates and uses a self-signed certificate. ## TLS Options diff --git a/docs/content/middlewares/http/buffering.md b/docs/content/middlewares/http/buffering.md index ebf25b4be..d2e67e24a 100644 --- a/docs/content/middlewares/http/buffering.md +++ b/docs/content/middlewares/http/buffering.md @@ -167,7 +167,7 @@ http: The `maxResponseBodyBytes` option configures the maximum allowed response size from the service (in bytes). -If the response exceeds the allowed size, it is not forwarded to the client. The client gets a `413 (Request Entity Too Large) response` instead. +If the response exceeds the allowed size, it is not forwarded to the client. The client gets a `413` (Request Entity Too Large) response instead. ```yaml tab="Docker" labels: diff --git a/docs/content/providers/consul.md b/docs/content/providers/consul.md index 872394473..20dccd0a4 100644 --- a/docs/content/providers/consul.md +++ b/docs/content/providers/consul.md @@ -15,7 +15,7 @@ See the dedicated section in [routing](../routing/providers/kv.md). _Required, Default="127.0.0.1:8500"_ -Defines how to access to Consul. +Defines how to access Consul. ```yaml tab="File (YAML)" providers: diff --git a/docs/content/providers/redis.md b/docs/content/providers/redis.md index 629c10db0..46481957b 100644 --- a/docs/content/providers/redis.md +++ b/docs/content/providers/redis.md @@ -15,7 +15,7 @@ See the dedicated section in [routing](../routing/providers/kv.md). _Required, Default="127.0.0.1:6379"_ -Defines how to access to Redis. +Defines how to access Redis. ```yaml tab="File (YAML)" providers: diff --git a/docs/content/providers/zookeeper.md b/docs/content/providers/zookeeper.md index 3f84975f9..cd47977de 100644 --- a/docs/content/providers/zookeeper.md +++ b/docs/content/providers/zookeeper.md @@ -15,7 +15,7 @@ See the dedicated section in [routing](../routing/providers/kv.md). _Required, Default="127.0.0.1:2181"_ -Defines how to access to ZooKeeper. +Defines how to access ZooKeeper. ```yaml tab="File (YAML)" providers: diff --git a/docs/content/routing/overview.md b/docs/content/routing/overview.md index 3a99fe9e2..59b3e4a8c 100644 --- a/docs/content/routing/overview.md +++ b/docs/content/routing/overview.md @@ -21,7 +21,7 @@ If they do, the router might transform the request using pieces of [middleware]( ## Example with a File Provider -Below is an example of a full configuration file for the [file provider](../providers/file.md) that forwards `http://domain/whoami/` requests to a service reachable on `http://private/whoami-service/`. +Below is an example of a full configuration file for the [file provider](../providers/file.md) that forwards `http://example.com/whoami/` requests to a service reachable on `http://private/whoami-service/`. In the process, Traefik will make sure that the user is authenticated (using the [BasicAuth middleware](../middlewares/http/basicauth.md)). Static configuration: @@ -122,7 +122,7 @@ http: In this example, we've defined routing rules for http requests only. Traefik also supports TCP requests. To add [TCP routers](./routers/index.md) and [TCP services](./services/index.md), declare them in a TCP section like in the following. - ??? example "Adding a TCP route for TLS requests on whoami.example.com" + ??? example "Adding a TCP route for TLS requests on whoami-tcp.example.com" **Static Configuration** diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index cee6e7980..cc021cbe2 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -197,3 +197,5 @@ nav: - 'KV': 'reference/dynamic-configuration/kv.md' - 'Marathon': 'reference/dynamic-configuration/marathon.md' - 'Rancher': 'reference/dynamic-configuration/rancher.md' + - 'Deprecation Notices': + - 'Releases': 'deprecation/releases.md' diff --git a/go.mod b/go.mod index 8ea8ea9ad..b55373535 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 // github.com/docker/docker v17.12.0-ce-rc1.0.20200204220554-5f6d6f3f2203+incompatible => v19.03.6 require ( - github.com/BurntSushi/toml v0.3.1 + github.com/BurntSushi/toml v1.0.0 github.com/ExpediaDotCom/haystack-client-go v0.0.0-20190315171017-e7edbdf53a61 github.com/Masterminds/sprig/v3 v3.2.2 github.com/Shopify/sarama v1.23.1 // indirect @@ -60,7 +60,7 @@ require ( github.com/stretchr/testify v1.7.0 github.com/stvp/go-udp-testing v0.0.0-20191102171040-06b61409b154 github.com/tinylib/msgp v1.0.2 // indirect - github.com/traefik/paerser v0.1.4 + github.com/traefik/paerser v0.1.5 github.com/traefik/yaegi v0.11.2 github.com/uber/jaeger-client-go v2.29.1+incompatible github.com/uber/jaeger-lib v2.2.0+incompatible diff --git a/go.sum b/go.sum index 2b41482fb..46160fe25 100644 --- a/go.sum +++ b/go.sum @@ -112,8 +112,9 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= +github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= @@ -1655,8 +1656,8 @@ github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/ github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk= github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305 h1:y/1cL5AL2oRcfzz8CAHHhR6kDDfIOT0WEyH5k40sccM= github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305/go.mod h1:gXOLibKqQTRAVuVZ9gX7G9Ykky8ll8yb4slxsEMoY0c= -github.com/traefik/paerser v0.1.4 h1:/IXjV04Gf6di51H8Jl7jyS3OylsLjIasrwXIIwj1aT8= -github.com/traefik/paerser v0.1.4/go.mod h1:FIdQ4Y92ulQUGSeZgxchtBKEcLw1o551PMNg9PoIq/4= +github.com/traefik/paerser v0.1.5 h1:crit7KzQ9PUWGCYu+H2acwyr7ZKb3RQDSn6iJCtxBhE= +github.com/traefik/paerser v0.1.5/go.mod h1:Fuwl9DWJfGpZPPwZY6djYIF0vhvzhLmCizn6P66UeLY= github.com/traefik/yaegi v0.11.2 h1:zosveTf5iIa60fAeQpaH4719b+bnlgsOvO7Nb/OTMTo= github.com/traefik/yaegi v0.11.2/go.mod h1:RuCwD8/wsX7b6KoQHOaIFUfuH3gQIK4KWnFFmJMw5VA= github.com/transip/gotransip/v6 v6.6.1 h1:nsCU1ErZS5G0FeOpgGXc4FsWvBff9GPswSMggsC4564= diff --git a/integration/simple_test.go b/integration/simple_test.go index f16efb677..b66371971 100644 --- a/integration/simple_test.go +++ b/integration/simple_test.go @@ -32,7 +32,7 @@ func (s *SimpleSuite) TestInvalidConfigShouldFail(c *check.C) { defer s.killCmd(cmd) err = try.Do(500*time.Millisecond, func() error { - expected := "Near line 0 (last key parsed ''): bare keys cannot contain '{'" + expected := "expected '.' or '=', but got '{' instead" actual := output.String() if !strings.Contains(actual, expected) { diff --git a/pkg/config/dynamic/http_config.go b/pkg/config/dynamic/http_config.go index 014cfe205..e8305e6c8 100644 --- a/pkg/config/dynamic/http_config.go +++ b/pkg/config/dynamic/http_config.go @@ -25,7 +25,7 @@ type HTTPConfiguration struct { // Model is a set of default router's values. type Model struct { Middlewares []string `json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` - TLS *RouterTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + TLS *RouterTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true @@ -47,7 +47,7 @@ type Router struct { Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` Rule string `json:"rule,omitempty" toml:"rule,omitempty" yaml:"rule,omitempty"` Priority int `json:"priority,omitempty" toml:"priority,omitempty,omitzero" yaml:"priority,omitempty" export:"true"` - TLS *RouterTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + TLS *RouterTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true @@ -66,7 +66,7 @@ type Mirroring struct { Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` MaxBodySize *int64 `json:"maxBodySize,omitempty" toml:"maxBodySize,omitempty" yaml:"maxBodySize,omitempty" export:"true"` Mirrors []MirrorService `json:"mirrors,omitempty" toml:"mirrors,omitempty" yaml:"mirrors,omitempty" export:"true"` - HealthCheck *HealthCheck `json:"healthCheck,omitempty" toml:"healthCheck,omitempty" yaml:"healthCheck,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + HealthCheck *HealthCheck `json:"healthCheck,omitempty" toml:"healthCheck,omitempty" yaml:"healthCheck,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // SetDefaults Default values for a WRRService. @@ -103,7 +103,7 @@ type WeightedRoundRobin struct { // and takes it into account (i.e. it ignores the down child) when running the // load-balancing algorithm. In addition, if the parent of this service also has // HealthCheck enabled, this service reports to its parent any status change. - HealthCheck *HealthCheck `json:"healthCheck,omitempty" toml:"healthCheck,omitempty" yaml:"healthCheck,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + HealthCheck *HealthCheck `json:"healthCheck,omitempty" toml:"healthCheck,omitempty" yaml:"healthCheck,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true @@ -124,7 +124,7 @@ func (w *WRRService) SetDefaults() { // Sticky holds the sticky configuration. type Sticky struct { - Cookie *Cookie `json:"cookie,omitempty" toml:"cookie,omitempty" yaml:"cookie,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + Cookie *Cookie `json:"cookie,omitempty" toml:"cookie,omitempty" yaml:"cookie,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true @@ -141,7 +141,7 @@ type Cookie struct { // ServersLoadBalancer holds the ServersLoadBalancer configuration. type ServersLoadBalancer struct { - Sticky *Sticky `json:"sticky,omitempty" toml:"sticky,omitempty" yaml:"sticky,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + Sticky *Sticky `json:"sticky,omitempty" toml:"sticky,omitempty" yaml:"sticky,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` Servers []Server `json:"servers,omitempty" toml:"servers,omitempty" yaml:"servers,omitempty" label-slice-as-struct:"server" export:"true"` // HealthCheck enables regular active checks of the responsiveness of the // children servers of this load-balancer. To propagate status changes (e.g. all diff --git a/pkg/config/dynamic/middlewares.go b/pkg/config/dynamic/middlewares.go index 66f58d39f..d4e7d11fd 100644 --- a/pkg/config/dynamic/middlewares.go +++ b/pkg/config/dynamic/middlewares.go @@ -30,7 +30,7 @@ type Middleware struct { InFlightReq *InFlightReq `json:"inFlightReq,omitempty" toml:"inFlightReq,omitempty" yaml:"inFlightReq,omitempty" export:"true"` Buffering *Buffering `json:"buffering,omitempty" toml:"buffering,omitempty" yaml:"buffering,omitempty" export:"true"` CircuitBreaker *CircuitBreaker `json:"circuitBreaker,omitempty" toml:"circuitBreaker,omitempty" yaml:"circuitBreaker,omitempty" export:"true"` - Compress *Compress `json:"compress,omitempty" toml:"compress,omitempty" yaml:"compress,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + Compress *Compress `json:"compress,omitempty" toml:"compress,omitempty" yaml:"compress,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` PassTLSClientCert *PassTLSClientCert `json:"passTLSClientCert,omitempty" toml:"passTLSClientCert,omitempty" yaml:"passTLSClientCert,omitempty" export:"true"` Retry *Retry `json:"retry,omitempty" toml:"retry,omitempty" yaml:"retry,omitempty" export:"true"` ContentType *ContentType `json:"contentType,omitempty" toml:"contentType,omitempty" yaml:"contentType,omitempty" export:"true"` @@ -275,7 +275,7 @@ func (s *IPStrategy) Get() (ip.Strategy, error) { // IPWhiteList holds the ip white list configuration. type IPWhiteList struct { SourceRange []string `json:"sourceRange,omitempty" toml:"sourceRange,omitempty" yaml:"sourceRange,omitempty"` - IPStrategy *IPStrategy `json:"ipStrategy,omitempty" toml:"ipStrategy,omitempty" yaml:"ipStrategy,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + IPStrategy *IPStrategy `json:"ipStrategy,omitempty" toml:"ipStrategy,omitempty" yaml:"ipStrategy,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true diff --git a/pkg/config/dynamic/tcp_config.go b/pkg/config/dynamic/tcp_config.go index 71042dc0b..e16564411 100644 --- a/pkg/config/dynamic/tcp_config.go +++ b/pkg/config/dynamic/tcp_config.go @@ -53,7 +53,7 @@ type TCPRouter struct { Service string `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty" export:"true"` Rule string `json:"rule,omitempty" toml:"rule,omitempty" yaml:"rule,omitempty"` Priority int `json:"priority,omitempty" toml:"priority,omitempty,omitzero" yaml:"priority,omitempty" export:"true"` - TLS *RouterTCPTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + TLS *RouterTCPTLSConfig `json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true @@ -76,7 +76,7 @@ type TCPServersLoadBalancer struct { // connection. It is a duration in milliseconds, defaulting to 100. A negative value // means an infinite deadline (i.e. the reading capability is never closed). TerminationDelay *int `json:"terminationDelay,omitempty" toml:"terminationDelay,omitempty" yaml:"terminationDelay,omitempty" export:"true"` - ProxyProtocol *ProxyProtocol `json:"proxyProtocol,omitempty" toml:"proxyProtocol,omitempty" yaml:"proxyProtocol,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + ProxyProtocol *ProxyProtocol `json:"proxyProtocol,omitempty" toml:"proxyProtocol,omitempty" yaml:"proxyProtocol,omitempty" label:"allowEmpty" file:"allowEmpty" kv:"allowEmpty" export:"true"` Servers []TCPServer `json:"servers,omitempty" toml:"servers,omitempty" yaml:"servers,omitempty" label-slice-as-struct:"server" export:"true"` } diff --git a/pkg/config/kv/kv.go b/pkg/config/kv/kv.go index 7f6a943fa..8af4855e3 100644 --- a/pkg/config/kv/kv.go +++ b/pkg/config/kv/kv.go @@ -25,7 +25,7 @@ func Decode(pairs []*store.KVPair, element interface{}, rootName string) error { return err } - metaOpts := parser.MetadataOpts{TagName: parser.TagLabel, AllowSliceAsStruct: false} + metaOpts := parser.MetadataOpts{TagName: "kv", AllowSliceAsStruct: false} err = parser.AddMetadata(element, node, metaOpts) if err != nil { return err diff --git a/pkg/config/kv/kv_test.go b/pkg/config/kv/kv_test.go index f7c0d7ed9..9dafcaab4 100644 --- a/pkg/config/kv/kv_test.go +++ b/pkg/config/kv/kv_test.go @@ -108,7 +108,7 @@ type sample struct { FieldD []string FieldE *struct { Name string - } `label:"allowEmpty"` + } `kv:"allowEmpty"` FieldF map[string]string FieldG []sub FieldH string diff --git a/pkg/config/static/entrypoints.go b/pkg/config/static/entrypoints.go index 387714cac..224776e29 100644 --- a/pkg/config/static/entrypoints.go +++ b/pkg/config/static/entrypoints.go @@ -55,8 +55,8 @@ func (ep *EntryPoint) SetDefaults() { // HTTPConfig is the HTTP configuration of an entry point. type HTTPConfig struct { Redirections *Redirections `description:"Set of redirection" json:"redirections,omitempty" toml:"redirections,omitempty" yaml:"redirections,omitempty" export:"true"` - Middlewares []string `description:"Default middlewares for the routers linked to the entry point." json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` - TLS *TLSConfig `description:"Default TLS configuration for the routers linked to the entry point." json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + Middlewares []string `description:"Default middlewares for the routers linked to the entry point." json:"middlewares,omitempty" toml:"middlewares,omitempty" yaml:"middlewares,omitempty" export:"true"` + TLS *TLSConfig `description:"Default TLS configuration for the routers linked to the entry point." json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` } // HTTP3Config is the HTTP3 configuration of an entry point. diff --git a/pkg/provider/docker/docker.go b/pkg/provider/docker/docker.go index 6f87cfcd8..eda5318fc 100644 --- a/pkg/provider/docker/docker.go +++ b/pkg/provider/docker/docker.go @@ -528,7 +528,8 @@ func (p *Provider) parseService(ctx context.Context, service swarmtypes.Service, } func listTasks(ctx context.Context, dockerClient client.APIClient, serviceID string, - serviceDockerData dockerData, networkMap map[string]*dockertypes.NetworkResource, isGlobalSvc bool) ([]dockerData, error) { + serviceDockerData dockerData, networkMap map[string]*dockertypes.NetworkResource, isGlobalSvc bool, +) ([]dockerData, error) { serviceIDFilter := filters.NewArgs() serviceIDFilter.Add("service", serviceID) serviceIDFilter.Add("desired-state", "running") @@ -552,7 +553,8 @@ func listTasks(ctx context.Context, dockerClient client.APIClient, serviceID str } func parseTasks(ctx context.Context, task swarmtypes.Task, serviceDockerData dockerData, - networkMap map[string]*dockertypes.NetworkResource, isGlobalSvc bool) dockerData { + networkMap map[string]*dockertypes.NetworkResource, isGlobalSvc bool, +) dockerData { dData := dockerData{ ID: task.ID, ServiceName: serviceDockerData.Name, diff --git a/pkg/server/routerfactory.go b/pkg/server/routerfactory.go index 2226b3db3..fff7e3eea 100644 --- a/pkg/server/routerfactory.go +++ b/pkg/server/routerfactory.go @@ -35,7 +35,8 @@ type RouterFactory struct { // NewRouterFactory creates a new RouterFactory. func NewRouterFactory(staticConfiguration static.Configuration, managerFactory *service.ManagerFactory, tlsManager *tls.Manager, - chainBuilder *middleware.ChainBuilder, pluginBuilder middleware.PluginsBuilder, metricsRegistry metrics.Registry) *RouterFactory { + chainBuilder *middleware.ChainBuilder, pluginBuilder middleware.PluginsBuilder, metricsRegistry metrics.Registry, +) *RouterFactory { var entryPointsTCP, entryPointsUDP []string for name, cfg := range staticConfiguration.EntryPoints { protocol, err := cfg.GetProtocol() diff --git a/pkg/server/server.go b/pkg/server/server.go index 1a3f136e8..722258db6 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -31,7 +31,8 @@ type Server struct { // NewServer returns an initialized Server. func NewServer(routinesPool *safe.Pool, entryPoints TCPEntryPoints, entryPointsUDP UDPEntryPoints, watcher *ConfigurationWatcher, - chainBuilder *middleware.ChainBuilder, accessLoggerMiddleware *accesslog.Handler) *Server { + chainBuilder *middleware.ChainBuilder, accessLoggerMiddleware *accesslog.Handler, +) *Server { srv := &Server{ watcher: watcher, tcpEntryPoints: entryPoints,