diff --git a/.golangci.yml b/.golangci.yml index c08ec0fc4..7128a4177 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -144,11 +144,11 @@ linters-settings: gomoddirectives: replace-allow-list: - github.com/abbot/go-http-auth - - github.com/go-check/check - github.com/gorilla/mux - github.com/mailgun/minheap - github.com/mailgun/multibuf - github.com/jaguilar/vt100 + - github.com/cucumber/godog testifylint: enable: - bool-compare @@ -159,7 +159,6 @@ linters-settings: - expected-actual - float-compare - len - - suite-dont-use-pkg - suite-extra-assert-call - suite-thelper @@ -253,6 +252,12 @@ issues: text: 'SA1019: config.ClientCAs.Subjects has been deprecated since Go 1.18' - path: pkg/types/tls_test.go text: 'SA1019: tlsConfig.RootCAs.Subjects has been deprecated since Go 1.18' + - path: pkg/provider/kubernetes/crd/kubernetes.go + text: 'SA1019: middleware.Spec.IPWhiteList is deprecated: please use IPAllowList instead.' + - path: pkg/server/middleware/tcp/middlewares.go + text: 'SA1019: config.IPWhiteList is deprecated: please use IPAllowList instead.' + - path: pkg/server/middleware/middlewares.go + text: 'SA1019: config.IPWhiteList is deprecated: please use IPAllowList instead.' - path: pkg/provider/kubernetes/(crd|gateway)/client.go linters: - interfacebloat diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 041802175..a8fc18b6f 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -31,24 +31,6 @@ global_job_config: - cache restore traefik-$(checksum go.sum) blocks: - - name: Test Integration - dependencies: [] - run: - when: "branch =~ '.*' OR pull_request =~'.*'" - task: - jobs: - - name: Test Integration - commands: - - make pull-images - - touch webui/static/index.html # Avoid generating webui - - IN_DOCKER="" make binary - - make test-integration - - df -h - epilogue: - always: - commands: - - cache store traefik-$(checksum go.sum) $HOME/go/pkg/mod - - name: Release dependencies: [] run: @@ -65,8 +47,6 @@ blocks: value: 2.32.1 - name: CODENAME value: "beaufort" - - name: IN_DOCKER - value: "" prologue: commands: - export VERSION=${SEMAPHORE_GIT_TAG_NAME} diff --git a/Makefile b/Makefile index f5c5f9ddc..668c5404e 100644 --- a/Makefile +++ b/Makefile @@ -6,34 +6,6 @@ VERSION_GIT := $(if $(TAG_NAME),$(TAG_NAME),$(SHA)) VERSION := $(if $(VERSION),$(VERSION),$(VERSION_GIT)) GIT_BRANCH := $(subst heads/,,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)) -TRAEFIK_DEV_IMAGE := traefik-dev$(if $(GIT_BRANCH),:$(subst /,-,$(GIT_BRANCH))) - -REPONAME := $(shell echo $(REPO) | tr '[:upper:]' '[:lower:]') -TRAEFIK_IMAGE := $(if $(REPONAME),$(REPONAME),"traefik/traefik") - -INTEGRATION_OPTS := $(if $(MAKE_DOCKER_HOST),-e "DOCKER_HOST=$(MAKE_DOCKER_HOST)",-v "/var/run/docker.sock:/var/run/docker.sock") -DOCKER_BUILD_ARGS := $(if $(DOCKER_VERSION), "--build-arg=DOCKER_VERSION=$(DOCKER_VERSION)",) - -# only used when running in docker -TRAEFIK_ENVS := \ - -e OS_ARCH_ARG \ - -e OS_PLATFORM_ARG \ - -e TESTFLAGS \ - -e VERBOSE \ - -e VERSION \ - -e CODENAME \ - -e TESTDIRS \ - -e CI \ - -e IN_DOCKER=true # Indicator for integration tests that we are running inside a container. - -TRAEFIK_MOUNT := -v "$(CURDIR)/dist:/go/src/github.com/traefik/traefik/dist" -DOCKER_RUN_OPTS := $(TRAEFIK_ENVS) $(TRAEFIK_MOUNT) "$(TRAEFIK_DEV_IMAGE)" -DOCKER_NON_INTERACTIVE ?= false -DOCKER_RUN_TRAEFIK := docker run $(INTEGRATION_OPTS) $(if $(DOCKER_NON_INTERACTIVE), , -it) $(DOCKER_RUN_OPTS) -DOCKER_RUN_TRAEFIK_TEST := docker run --add-host=host.docker.internal:127.0.0.1 --rm --name=traefik --network traefik-test-network -v $(PWD):$(PWD) -w $(PWD) $(INTEGRATION_OPTS) $(if $(DOCKER_NON_INTERACTIVE), , -it) $(DOCKER_RUN_OPTS) -DOCKER_RUN_TRAEFIK_NOTTY := docker run $(INTEGRATION_OPTS) $(if $(DOCKER_NON_INTERACTIVE), , -i) $(DOCKER_RUN_OPTS) - -IN_DOCKER ?= true .PHONY: default default: binary @@ -42,20 +14,6 @@ default: binary dist: mkdir -p dist -## Build Dev Docker image -.PHONY: build-dev-image -build-dev-image: dist -ifneq ("$(IN_DOCKER)", "") - docker build $(DOCKER_BUILD_ARGS) -t "$(TRAEFIK_DEV_IMAGE)" --build-arg HOST_PWD="$(PWD)" -f build.Dockerfile . -endif - -## Build Dev Docker image without cache -.PHONY: build-dev-image-no-cache -build-dev-image-no-cache: dist -ifneq ("$(IN_DOCKER)", "") - docker build $(DOCKER_BUILD_ARGS) --no-cache -t "$(TRAEFIK_DEV_IMAGE)" --build-arg HOST_PWD="$(PWD)" -f build.Dockerfile . -endif - ## Build WebUI Docker image .PHONY: build-webui-image build-webui-image: @@ -79,8 +37,8 @@ generate-webui: webui/static/index.html ## Build the binary .PHONY: binary -binary: generate-webui build-dev-image - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK)) ./script/make.sh generate binary +binary: generate-webui + ./script/make.sh generate binary ## Build the linux binary locally .PHONY: binary-debug @@ -89,35 +47,29 @@ binary-debug: generate-webui ## Build the binary for the standard platforms (linux, darwin, windows) .PHONY: crossbinary-default -crossbinary-default: generate-webui build-dev-image - $(DOCKER_RUN_TRAEFIK_NOTTY) ./script/make.sh generate crossbinary-default +crossbinary-default: generate-webui + ./script/make.sh generate crossbinary-default ## Build the binary for the standard platforms (linux, darwin, windows) in parallel .PHONY: crossbinary-default-parallel crossbinary-default-parallel: $(MAKE) generate-webui - $(MAKE) build-dev-image crossbinary-default + $(MAKE) crossbinary-default ## Run the unit and integration tests .PHONY: test -test: build-dev-image - -docker network create traefik-test-network --driver bridge --subnet 172.31.42.0/24 - trap 'docker network rm traefik-test-network' EXIT; \ - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_TEST)) ./script/make.sh generate test-unit binary test-integration +test: + ./script/make.sh generate test-unit binary test-integration ## Run the unit tests .PHONY: test-unit -test-unit: build-dev-image - -docker network create traefik-test-network --driver bridge --subnet 172.31.42.0/24 - trap 'docker network rm traefik-test-network' EXIT; \ - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_TEST)) ./script/make.sh generate test-unit +test-unit: + ./script/make.sh generate test-unit ## Run the integration tests .PHONY: test-integration -test-integration: build-dev-image - -docker network create traefik-test-network --driver bridge --subnet 172.31.42.0/24 - trap 'docker network rm traefik-test-network' EXIT; \ - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_TEST)) ./script/make.sh generate binary test-integration +test-integration: + ./script/make.sh generate binary test-integration ## Pull all images for integration tests .PHONY: pull-images @@ -128,16 +80,22 @@ pull-images: | uniq \ | xargs -P 6 -n 1 docker pull +EXECUTABLES = misspell shellcheck + ## Validate code and docs .PHONY: validate-files -validate-files: build-dev-image - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK)) ./script/make.sh generate validate-lint validate-misspell +validate-files: + $(foreach exec,$(EXECUTABLES),\ + $(if $(shell which $(exec)),,$(error "No $(exec) in PATH"))) + ./script/make.sh generate validate-lint validate-misspell bash $(CURDIR)/script/validate-shell-script.sh ## Validate code, docs, and vendor .PHONY: validate -validate: build-dev-image - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK)) ./script/make.sh generate validate-lint validate-misspell validate-vendor +validate: + $(foreach exec,$(EXECUTABLES),\ + $(if $(shell which $(exec)),,$(error "No $(exec) in PATH"))) + ./script/make.sh generate validate-lint validate-misspell validate-vendor bash $(CURDIR)/script/validate-shell-script.sh ## Clean up static directory and build a Docker Traefik image @@ -155,11 +113,6 @@ build-image-dirty: binary build-image-debug: binary-debug docker build -t $(TRAEFIK_IMAGE) -f debug.Dockerfile . -## Start a shell inside the build env -.PHONY: shell -shell: build-dev-image - $(DOCKER_RUN_TRAEFIK) /bin/bash - ## Build documentation site .PHONY: docs docs: @@ -187,23 +140,23 @@ generate-genconf: ## Create packages for the release .PHONY: release-packages -release-packages: generate-webui build-dev-image +release-packages: generate-webui rm -rf dist @- $(foreach os, linux darwin windows freebsd openbsd, \ - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) goreleaser release --skip-publish -p 2 --timeout="90m" --config $(shell go run ./internal/release $(os)); \ - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) go clean -cache; \ + goreleaser release --skip-publish -p 2 --timeout="90m" --config $(shell go run ./internal/release $(os)); \ + go clean -cache; \ ) - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) cat dist/**/*_checksums.txt >> dist/traefik_${VERSION}_checksums.txt - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) rm dist/**/*_checksums.txt - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) tar cfz dist/traefik-${VERSION}.src.tar.gz \ + cat dist/**/*_checksums.txt >> dist/traefik_${VERSION}_checksums.txt + rm dist/**/*_checksums.txt + tar cfz dist/traefik-${VERSION}.src.tar.gz \ --exclude-vcs \ --exclude .idea \ --exclude .travis \ --exclude .semaphoreci \ --exclude .github \ --exclude dist . - $(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) chown -R $(shell id -u):$(shell id -g) dist/ + chown -R $(shell id -u):$(shell id -g) dist/ ## Format the Code .PHONY: fmt diff --git a/cmd/internal/gen/main.go b/cmd/internal/gen/main.go index f5fd5bb35..a85544688 100644 --- a/cmd/internal/gen/main.go +++ b/cmd/internal/gen/main.go @@ -87,11 +87,11 @@ func run(dest string) error { } func cleanType(typ types.Type, base string) string { - if typ.String() == "github.com/traefik/traefik/v3/pkg/tls.FileOrContent" { + if typ.String() == "github.com/traefik/traefik/v3/pkg/types.FileOrContent" { return "string" } - if typ.String() == "[]github.com/traefik/traefik/v3/pkg/tls.FileOrContent" { + if typ.String() == "[]github.com/traefik/traefik/v3/pkg/types.FileOrContent" { return "[]string" } diff --git a/docs/content/contributing/building-testing.md b/docs/content/contributing/building-testing.md index 493a89747..838688869 100644 --- a/docs/content/contributing/building-testing.md +++ b/docs/content/contributing/building-testing.md @@ -13,67 +13,13 @@ Let's see how. ## Building -You need either [Docker](https://github.com/docker/docker "Link to website of Docker") and `make` (Method 1), or [Go](https://go.dev/ "Link to website of Go") (Method 2) in order to build Traefik. -For changes to its dependencies, the `dep` dependency management tool is required. - -### Method 1: Using `Docker` and `Makefile` - -Run make with the `binary` target. - -```bash -make binary -``` - -This will create binaries for the Linux platform in the `dist` folder. - -In case when you run build on CI, you may probably want to run docker in non-interactive mode. To achieve that define `DOCKER_NON_INTERACTIVE=true` environment variable. - -```bash -$ make binary -docker build -t traefik-webui -f webui/Dockerfile webui -Sending build context to Docker daemon 2.686MB -Step 1/11 : FROM node:8.15.0 - ---> 1f6c34f7921c -[...] -Successfully built ce4ff439c06a -Successfully tagged traefik-webui:latest -[...] -docker build -t "traefik-dev:4475--feature-documentation" -f build.Dockerfile . -Sending build context to Docker daemon 279MB -Step 1/10 : FROM golang:1.16-alpine - ---> f4bfb3d22bda -[...] -Successfully built 5c3c1a911277 -Successfully tagged traefik-dev:4475--feature-documentation -docker run -e "TEST_CONTAINER=1" -v "/var/run/docker.sock:/var/run/docker.sock" -it -e OS_ARCH_ARG -e OS_PLATFORM_ARG -e TESTFLAGS -e VERBOSE -e VERSION -e CODENAME -e TESTDIRS -e CI -e CONTAINER=DOCKER -v "/home/ldez/sources/go/src/github.com/traefik/traefik/"dist":/go/src/github.com/traefik/traefik/"dist"" "traefik-dev:4475--feature-documentation" ./script/make.sh generate binary ----> Making bundle: generate (in .) -removed 'autogen/genstatic/gen.go' - ----> Making bundle: binary (in .) - -$ ls dist/ -traefik* -``` - -The following targets can be executed outside Docker by setting the variable `IN_DOCKER` to an empty string (although be aware that some of the tests might fail in that context): - -- `test-unit` -- `test-integration` -- `validate` -- `binary` (the webUI is still generated by using Docker) - -ex: - -```bash -IN_DOCKER= make test-unit -``` - -### Method 2: Using `go` - -Requirements: - -- `go` v1.16+ -- environment variable `GO111MODULE=on` +You need: + - [Docker](https://github.com/docker/docker "Link to website of Docker") + - `make` + - [Go](https://go.dev/ "Link to website of Go") + - [misspell](https://github.com/golangci/misspell) + - [shellcheck](https://github.com/koalaman/shellcheck) + - [Tailscale](https://tailscale.com/) if you are using Docker Desktop !!! tip "Source Directory" @@ -106,41 +52,33 @@ Requirements: ## ... and the list goes on ``` -#### Build Traefik +### Build Traefik Once you've set up your go environment and cloned the source repository, you can build Traefik. ```bash -# Generate UI static files -make clean-webui generate-webui +$ make binary +./script/make.sh generate binary +---> Making bundle: generate (in .) -# required to merge non-code components into the final binary, -# such as the web dashboard/UI -go generate +---> Making bundle: binary (in .) + +$ ls dist/ +traefik* ``` -```bash -# Standard go build -go build ./cmd/traefik -``` - -You will find the Traefik executable (`traefik`) in the `~/go/src/github.com/traefik/traefik` directory. +You will find the Traefik executable (`traefik`) in the `./dist` directory. ## Testing -### Method 1: `Docker` and `make` - Run unit tests using the `test-unit` target. Run integration tests using the `test-integration` target. Run all tests (unit and integration) using the `test` target. ```bash $ make test-unit -docker build -t "traefik-dev:your-feature-branch" -f build.Dockerfile . -# […] -docker run --rm -it -e OS_ARCH_ARG -e OS_PLATFORM_ARG -e TESTFLAGS -v "/home/user/go/src/github/traefik/traefik/dist:/go/src/github.com/traefik/traefik/dist" "traefik-dev:your-feature-branch" ./script/make.sh generate test-unit +./script/make.sh generate test-unit ---> Making bundle: generate (in .) -removed 'gen.go' ---> Making bundle: test-unit (in .) + go test -cover -coverprofile=cover.out . @@ -151,28 +89,30 @@ Test success For development purposes, you can specify which tests to run by using (only works the `test-integration` target): +??? note "Configuring Tailscale for Docker Desktop user" + + Create `tailscale.secret` file in `integration` directory. + + This file need to contains a [Tailscale auth key](https://tailscale.com/kb/1085/auth-keys) + (an ephemeral, but reusable, one is recommended). + + Add this section to your tailscale ACLs to auto-approve the routes for the + containers in the docker subnet: + + ```json + "autoApprovers": { + // Allow myself to automatically + // advertize routes for docker networks + "routes": { + "172.31.42.0/24": ["your_tailscale_identity"], + }, + }, + ``` + ```bash # Run every tests in the MyTest suite -TESTFLAGS="-check.f MyTestSuite" make test-integration +TESTFLAGS="-test.run TestAccessLogSuite" make test-integration # Run the test "MyTest" in the MyTest suite -TESTFLAGS="-check.f MyTestSuite.MyTest" make test-integration - -# Run every tests starting with "My", in the MyTest suite -TESTFLAGS="-check.f MyTestSuite.My" make test-integration - -# Run every tests ending with "Test", in the MyTest suite -TESTFLAGS="-check.f MyTestSuite.*Test" make test-integration +TESTFLAGS="-test.run TestAccessLogSuite -testify.m ^TestAccessLog$" make test-integration ``` - -Check [gocheck](https://labix.org/gocheck "Link to website of gocheck") for more information. - -### Method 2: `go` - -Unit tests can be run from the cloned directory using `$ go test ./...` which should return `ok`, similar to: - -```test -ok _/home/user/go/src/github/traefik/traefik 0.004s -``` - -Integration tests must be run from the `integration/` directory and require the `-integration` switch: `$ cd integration && go test -integration ./...`. diff --git a/docs/content/middlewares/http/ipallowlist.md b/docs/content/middlewares/http/ipallowlist.md index 19e1c86bc..d62e253bb 100644 --- a/docs/content/middlewares/http/ipallowlist.md +++ b/docs/content/middlewares/http/ipallowlist.md @@ -8,21 +8,7 @@ description: "Learn how to use IPAllowList in HTTP middleware for limiting clien Limiting Clients to Specific IPs {: .subtitle } -<<<<<<<< HEAD:docs/content/middlewares/http/ipallowlist.md IPAllowList accepts / refuses requests based on the client IP. -|||||||| dae0491b6:docs/content/middlewares/http/ipwhitelist.md -![IpWhiteList](../../assets/img/middleware/ipwhitelist.png) - -IPWhitelist accepts / refuses requests based on the client IP. -======== -![IPWhiteList](../../assets/img/middleware/ipwhitelist.png) - -IPWhiteList accepts / refuses requests based on the client IP. - -!!! warning - - This middleware is deprecated, please use the [IPAllowList](./ipallowlist.md) middleware instead. ->>>>>>>> upstream/v2.11:docs/content/middlewares/http/ipwhitelist.md ## Configuration Examples @@ -207,45 +193,3 @@ http: [http.middlewares.test-ipallowlist.ipAllowList.ipStrategy] excludedIPs = ["127.0.0.1/32", "192.168.1.7"] ``` - -### `rejectStatusCode` - -The `rejectStatusCode` option sets HTTP status code for refused requests. If not set, the default is 403 (Forbidden). - -```yaml tab="Docker & Swarm" -# Reject requests with a 404 rather than a 403 -labels: - - "traefik.http.middlewares.test-ipallowlist.ipallowlist.rejectstatuscode=404" -``` - -```yaml tab="Kubernetes" -# Reject requests with a 404 rather than a 403 -apiVersion: traefik.io/v1alpha1 -kind: Middleware -metadata: - name: test-ipallowlist -spec: - ipAllowList: - rejectStatusCode: 404 -``` - -```yaml tab="Consul Catalog" -# Reject requests with a 404 rather than a 403 -- "traefik.http.middlewares.test-ipallowlist.ipallowlist.rejectstatuscode=404" -``` - -```yaml tab="File (YAML)" -# Reject requests with a 404 rather than a 403 -http: - middlewares: - test-ipallowlist: - ipAllowList: - rejectStatusCode: 404 -``` - -```toml tab="File (TOML)" -# Reject requests with a 404 rather than a 403 -[http.middlewares] - [http.middlewares.test-ipallowlist.ipAllowList] - rejectStatusCode = 404 -``` diff --git a/docs/content/middlewares/http/ipwhitelist.md b/docs/content/middlewares/http/ipwhitelist.md new file mode 100644 index 000000000..e093ad0a9 --- /dev/null +++ b/docs/content/middlewares/http/ipwhitelist.md @@ -0,0 +1,201 @@ +--- +title: "Traefik HTTP Middlewares IPWhiteList" +description: "Learn how to use IPWhiteList in HTTP middleware for limiting clients to specific IPs in Traefik Proxy. Read the technical documentation." +--- + +# IPWhiteList + +Limiting Clients to Specific IPs +{: .subtitle } + +![IPWhiteList](../../assets/img/middleware/ipwhitelist.png) + +IPWhiteList accepts / refuses requests based on the client IP. + +!!! warning + + This middleware is deprecated, please use the [IPAllowList](./ipallowlist.md) middleware instead. + +## Configuration Examples + +```yaml tab="Docker" +# Accepts request from defined IP +labels: + - "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7" +``` + +```yaml tab="Kubernetes" +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: test-ipwhitelist +spec: + ipWhiteList: + sourceRange: + - 127.0.0.1/32 + - 192.168.1.7 +``` + +```yaml tab="Consul Catalog" +# Accepts request from defined IP +- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7" +``` + +```yaml tab="File (YAML)" +# Accepts request from defined IP +http: + middlewares: + test-ipwhitelist: + ipWhiteList: + sourceRange: + - "127.0.0.1/32" + - "192.168.1.7" +``` + +```toml tab="File (TOML)" +# Accepts request from defined IP +[http.middlewares] + [http.middlewares.test-ipwhitelist.ipWhiteList] + sourceRange = ["127.0.0.1/32", "192.168.1.7"] +``` + +## Configuration Options + +### `sourceRange` + +The `sourceRange` option sets the allowed IPs (or ranges of allowed IPs by using CIDR notation). + +### `ipStrategy` + +The `ipStrategy` option defines two parameters that set how Traefik determines the client IP: `depth`, and `excludedIPs`. +If no strategy is set, the default behavior is to match `sourceRange` against the Remote address found in the request. + +!!! important "As a middleware, whitelisting happens before the actual proxying to the backend takes place. In addition, the previous network hop only gets appended to `X-Forwarded-For` during the last stages of proxying, i.e. after it has already passed through whitelisting. Therefore, during whitelisting, as the previous network hop is not yet present in `X-Forwarded-For`, it cannot be matched against `sourceRange`." + +#### `ipStrategy.depth` + +The `depth` option tells Traefik to use the `X-Forwarded-For` header and take the IP located at the `depth` position (starting from the right). + +- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP will be empty. +- `depth` is ignored if its value is less than or equal to 0. + +!!! example "Examples of Depth & X-Forwarded-For" + + If `depth` is set to 2, and the request `X-Forwarded-For` header is `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` then the "real" client IP is `"10.0.0.1"` (at depth 4) but the IP used for the whitelisting is `"12.0.0.1"` (`depth=2`). + + | `X-Forwarded-For` | `depth` | clientIP | + |-----------------------------------------|---------|--------------| + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `1` | `"13.0.0.1"` | + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` | + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` | + +```yaml tab="Docker" +# Whitelisting Based on `X-Forwarded-For` with `depth=2` +labels: + - "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7" + - "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth=2" +``` + +```yaml tab="Kubernetes" +# Whitelisting Based on `X-Forwarded-For` with `depth=2` +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: test-ipwhitelist +spec: + ipWhiteList: + sourceRange: + - 127.0.0.1/32 + - 192.168.1.7 + ipStrategy: + depth: 2 +``` + +```yaml tab="Consul Catalog" +# Whitelisting Based on `X-Forwarded-For` with `depth=2` +- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7" +- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth=2" +``` + +```yaml tab="File (YAML)" +# Whitelisting Based on `X-Forwarded-For` with `depth=2` +http: + middlewares: + test-ipwhitelist: + ipWhiteList: + sourceRange: + - "127.0.0.1/32" + - "192.168.1.7" + ipStrategy: + depth: 2 +``` + +```toml tab="File (TOML)" +# Whitelisting Based on `X-Forwarded-For` with `depth=2` +[http.middlewares] + [http.middlewares.test-ipwhitelist.ipWhiteList] + sourceRange = ["127.0.0.1/32", "192.168.1.7"] + [http.middlewares.test-ipwhitelist.ipWhiteList.ipStrategy] + depth = 2 +``` + +#### `ipStrategy.excludedIPs` + +`excludedIPs` configures Traefik to scan the `X-Forwarded-For` header and select the first IP not in the list. + +!!! important "If `depth` is specified, `excludedIPs` is ignored." + +!!! example "Example of ExcludedIPs & X-Forwarded-For" + + | `X-Forwarded-For` | `excludedIPs` | clientIP | + |-----------------------------------------|-----------------------|--------------| + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"12.0.0.1,13.0.0.1"` | `"11.0.0.1"` | + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"15.0.0.1,13.0.0.1"` | `"12.0.0.1"` | + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"10.0.0.1,13.0.0.1"` | `"12.0.0.1"` | + | `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` | + | `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` | + +```yaml tab="Docker" +# Exclude from `X-Forwarded-For` +labels: + - "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7" +``` + +```yaml tab="Kubernetes" +# Exclude from `X-Forwarded-For` +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: test-ipwhitelist +spec: + ipWhiteList: + ipStrategy: + excludedIPs: + - 127.0.0.1/32 + - 192.168.1.7 +``` + +```yaml tab="Consul Catalog" +# Exclude from `X-Forwarded-For` +- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7" +``` + +```yaml tab="File (YAML)" +# Exclude from `X-Forwarded-For` +http: + middlewares: + test-ipwhitelist: + ipWhiteList: + ipStrategy: + excludedIPs: + - "127.0.0.1/32" + - "192.168.1.7" +``` + +```toml tab="File (TOML)" +# Exclude from `X-Forwarded-For` +[http.middlewares] + [http.middlewares.test-ipwhitelist.ipWhiteList] + [http.middlewares.test-ipwhitelist.ipWhiteList.ipStrategy] + excludedIPs = ["127.0.0.1/32", "192.168.1.7"] +``` diff --git a/docs/content/middlewares/tcp/ipallowlist.md b/docs/content/middlewares/tcp/ipallowlist.md index 7f1859dd0..e8466b94e 100644 --- a/docs/content/middlewares/tcp/ipallowlist.md +++ b/docs/content/middlewares/tcp/ipallowlist.md @@ -8,7 +8,7 @@ description: "Learn how to use IPAllowList in TCP middleware for limiting client Limiting Clients to Specific IPs {: .subtitle } -IPWhitelist accepts / refuses connections based on the client IP. +IPAllowList accepts / refuses connections based on the client IP. ## Configuration Examples diff --git a/docs/content/middlewares/tcp/ipwhitelist.md b/docs/content/middlewares/tcp/ipwhitelist.md new file mode 100644 index 000000000..c3d1ccb43 --- /dev/null +++ b/docs/content/middlewares/tcp/ipwhitelist.md @@ -0,0 +1,64 @@ +--- +title: "Traefik TCP Middlewares IPWhiteList" +description: "Learn how to use IPWhiteList in TCP middleware for limiting clients to specific IPs in Traefik Proxy. Read the technical documentation." +--- + +# IPWhiteList + +Limiting Clients to Specific IPs +{: .subtitle } + +IPWhiteList accepts / refuses connections based on the client IP. + +!!! warning + + This middleware is deprecated, please use the [IPAllowList](./ipallowlist.md) middleware instead. + +## Configuration Examples + +```yaml tab="Docker" +# Accepts connections from defined IP +labels: + - "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7" +``` + +```yaml tab="Kubernetes" +apiVersion: traefik.io/v1alpha1 +kind: MiddlewareTCP +metadata: + name: test-ipwhitelist +spec: + ipWhiteList: + sourceRange: + - 127.0.0.1/32 + - 192.168.1.7 +``` + +```yaml tab="Consul Catalog" +# Accepts request from defined IP +- "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7" +``` + +```toml tab="File (TOML)" +# Accepts request from defined IP +[tcp.middlewares] + [tcp.middlewares.test-ipwhitelist.ipWhiteList] + sourceRange = ["127.0.0.1/32", "192.168.1.7"] +``` + +```yaml tab="File (YAML)" +# Accepts request from defined IP +tcp: + middlewares: + test-ipwhitelist: + ipWhiteList: + sourceRange: + - "127.0.0.1/32" + - "192.168.1.7" +``` + +## Configuration Options + +### `sourceRange` + +The `sourceRange` option sets the allowed IPs (or ranges of allowed IPs by using CIDR notation). diff --git a/docs/content/reference/dynamic-configuration/docker-labels.yml b/docs/content/reference/dynamic-configuration/docker-labels.yml index 4f7ef62c7..214af5fa1 100644 --- a/docs/content/reference/dynamic-configuration/docker-labels.yml +++ b/docs/content/reference/dynamic-configuration/docker-labels.yml @@ -65,57 +65,60 @@ - "traefik.http.middlewares.middleware10.headers.stsincludesubdomains=true" - "traefik.http.middlewares.middleware10.headers.stspreload=true" - "traefik.http.middlewares.middleware10.headers.stsseconds=42" -- "traefik.http.middlewares.middleware11.ipallowlist.ipstrategy.depth=42" -- "traefik.http.middlewares.middleware11.ipallowlist.ipstrategy.excludedips=foobar, foobar" -- "traefik.http.middlewares.middleware11.ipallowlist.sourcerange=foobar, foobar" -- "traefik.http.middlewares.middleware11.ipallowlist.rejectstatuscode=404" -- "traefik.http.middlewares.middleware12.inflightreq.amount=42" -- "traefik.http.middlewares.middleware12.inflightreq.sourcecriterion.ipstrategy.depth=42" -- "traefik.http.middlewares.middleware12.inflightreq.sourcecriterion.ipstrategy.excludedips=foobar, foobar" -- "traefik.http.middlewares.middleware12.inflightreq.sourcecriterion.requestheadername=foobar" -- "traefik.http.middlewares.middleware12.inflightreq.sourcecriterion.requesthost=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.commonname=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.country=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.domaincomponent=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.locality=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.organization=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.province=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.issuer.serialnumber=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.notafter=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.notbefore=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.sans=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.serialnumber=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.commonname=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.country=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.domaincomponent=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.locality=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.organization=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.organizationalunit=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.province=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.info.subject.serialnumber=true" -- "traefik.http.middlewares.middleware13.passtlsclientcert.pem=true" -- "traefik.http.middlewares.middleware14.plugin.foobar.foo=bar" -- "traefik.http.middlewares.middleware15.ratelimit.average=42" -- "traefik.http.middlewares.middleware15.ratelimit.burst=42" -- "traefik.http.middlewares.middleware15.ratelimit.period=42" -- "traefik.http.middlewares.middleware15.ratelimit.sourcecriterion.ipstrategy.depth=42" -- "traefik.http.middlewares.middleware15.ratelimit.sourcecriterion.ipstrategy.excludedips=foobar, foobar" -- "traefik.http.middlewares.middleware15.ratelimit.sourcecriterion.requestheadername=foobar" -- "traefik.http.middlewares.middleware15.ratelimit.sourcecriterion.requesthost=true" -- "traefik.http.middlewares.middleware16.redirectregex.permanent=true" -- "traefik.http.middlewares.middleware16.redirectregex.regex=foobar" -- "traefik.http.middlewares.middleware16.redirectregex.replacement=foobar" -- "traefik.http.middlewares.middleware17.redirectscheme.permanent=true" -- "traefik.http.middlewares.middleware17.redirectscheme.port=foobar" -- "traefik.http.middlewares.middleware17.redirectscheme.scheme=foobar" -- "traefik.http.middlewares.middleware18.replacepath.path=foobar" -- "traefik.http.middlewares.middleware19.replacepathregex.regex=foobar" -- "traefik.http.middlewares.middleware19.replacepathregex.replacement=foobar" -- "traefik.http.middlewares.middleware20.retry.attempts=42" -- "traefik.http.middlewares.middleware20.retry.initialinterval=42" -- "traefik.http.middlewares.middleware21.stripprefix.prefixes=foobar, foobar" -- "traefik.http.middlewares.middleware22.stripprefixregex.regex=foobar, foobar" -- "traefik.http.middlewares.middleware23.grpcweb.alloworigins=foobar, foobar" +- "traefik.http.middlewares.middleware11.ipwhitelist.ipstrategy.depth=42" +- "traefik.http.middlewares.middleware11.ipwhitelist.ipstrategy.excludedips=foobar, foobar" +- "traefik.http.middlewares.middleware12.ipwhitelist.sourcerange=foobar, foobar" +- "traefik.http.middlewares.middleware12.ipallowlist.ipstrategy.depth=42" +- "traefik.http.middlewares.middleware12.ipallowlist.ipstrategy.excludedips=foobar, foobar" +- "traefik.http.middlewares.middleware12.ipallowlist.sourcerange=foobar, foobar" +- "traefik.http.middlewares.middleware12.ipallowlist.rejectstatuscode=404" +- "traefik.http.middlewares.middleware13.inflightreq.amount=42" +- "traefik.http.middlewares.middleware13.inflightreq.sourcecriterion.ipstrategy.depth=42" +- "traefik.http.middlewares.middleware13.inflightreq.sourcecriterion.ipstrategy.excludedips=foobar, foobar" +- "traefik.http.middlewares.middleware13.inflightreq.sourcecriterion.requestheadername=foobar" +- "traefik.http.middlewares.middleware13.inflightreq.sourcecriterion.requesthost=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.commonname=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.country=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.domaincomponent=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.locality=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.organization=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.province=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.issuer.serialnumber=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.notafter=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.notbefore=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.sans=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.serialnumber=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.commonname=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.country=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.domaincomponent=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.locality=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.organization=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.organizationalunit=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.province=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.info.subject.serialnumber=true" +- "traefik.http.middlewares.middleware14.passtlsclientcert.pem=true" +- "traefik.http.middlewares.middleware15.plugin.foobar.foo=bar" +- "traefik.http.middlewares.middleware16.ratelimit.average=42" +- "traefik.http.middlewares.middleware16.ratelimit.burst=42" +- "traefik.http.middlewares.middleware16.ratelimit.period=42" +- "traefik.http.middlewares.middleware16.ratelimit.sourcecriterion.ipstrategy.depth=42" +- "traefik.http.middlewares.middleware16.ratelimit.sourcecriterion.ipstrategy.excludedips=foobar, foobar" +- "traefik.http.middlewares.middleware16.ratelimit.sourcecriterion.requestheadername=foobar" +- "traefik.http.middlewares.middleware16.ratelimit.sourcecriterion.requesthost=true" +- "traefik.http.middlewares.middleware17.redirectregex.permanent=true" +- "traefik.http.middlewares.middleware17.redirectregex.regex=foobar" +- "traefik.http.middlewares.middleware17.redirectregex.replacement=foobar" +- "traefik.http.middlewares.middleware18.redirectscheme.permanent=true" +- "traefik.http.middlewares.middleware18.redirectscheme.port=foobar" +- "traefik.http.middlewares.middleware18.redirectscheme.scheme=foobar" +- "traefik.http.middlewares.middleware19.replacepath.path=foobar" +- "traefik.http.middlewares.middleware20.replacepathregex.regex=foobar" +- "traefik.http.middlewares.middleware20.replacepathregex.replacement=foobar" +- "traefik.http.middlewares.middleware21.retry.attempts=42" +- "traefik.http.middlewares.middleware21.retry.initialinterval=42" +- "traefik.http.middlewares.middleware22.stripprefix.prefixes=foobar, foobar" +- "traefik.http.middlewares.middleware23.stripprefixregex.regex=foobar, foobar" +- "traefik.http.middlewares.middleware24.grpcweb.alloworigins=foobar, foobar" - "traefik.http.routers.router0.entrypoints=foobar, foobar" - "traefik.http.routers.router0.middlewares=foobar, foobar" - "traefik.http.routers.router0.priority=42" @@ -162,8 +165,8 @@ - "traefik.http.services.service01.loadbalancer.sticky.cookie.secure=true" - "traefik.http.services.service01.loadbalancer.server.port=foobar" - "traefik.http.services.service01.loadbalancer.server.scheme=foobar" -- "traefik.tcp.middlewares.tcpmiddleware00.ipallowlist.sourcerange=foobar, foobar" -- "traefik.tcp.middlewares.tcpmiddleware01.inflightconn.amount=42" +- "traefik.tcp.middlewares.tcpmiddleware00.inflightconn.amount=42" +- "traefik.tcp.middlewares.tcpmiddleware01.ipwhitelist.sourcerange=foobar, foobar" - "traefik.tcp.middlewares.tcpmiddleware02.ipallowlist.sourcerange=foobar, foobar" - "traefik.tcp.routers.tcprouter0.entrypoints=foobar, foobar" - "traefik.tcp.routers.tcprouter0.middlewares=foobar, foobar" diff --git a/docs/content/reference/dynamic-configuration/file.toml b/docs/content/reference/dynamic-configuration/file.toml index 4c1e5c593..49cf27e95 100644 --- a/docs/content/reference/dynamic-configuration/file.toml +++ b/docs/content/reference/dynamic-configuration/file.toml @@ -197,30 +197,36 @@ name0 = "foobar" name1 = "foobar" [http.middlewares.Middleware11] - [http.middlewares.Middleware11.ipAllowList] + [http.middlewares.Middleware11.ipWhiteList] sourceRange = ["foobar", "foobar"] - rejectStatusCode = 404 - [http.middlewares.Middleware11.ipAllowList.ipStrategy] + [http.middlewares.Middleware11.ipWhiteList.ipStrategy] depth = 42 excludedIPs = ["foobar", "foobar"] [http.middlewares.Middleware12] - [http.middlewares.Middleware12.inFlightReq] + [http.middlewares.Middleware12.ipAllowList] + sourceRange = ["foobar", "foobar"] + rejectStatusCode = 404 + [http.middlewares.Middleware12.ipAllowList.ipStrategy] + depth = 42 + excludedIPs = ["foobar", "foobar"] + [http.middlewares.Middleware13] + [http.middlewares.Middleware13.inFlightReq] amount = 42 - [http.middlewares.Middleware12.inFlightReq.sourceCriterion] + [http.middlewares.Middleware13.inFlightReq.sourceCriterion] requestHeaderName = "foobar" requestHost = true - [http.middlewares.Middleware12.inFlightReq.sourceCriterion.ipStrategy] + [http.middlewares.Middleware13.inFlightReq.sourceCriterion.ipStrategy] depth = 42 excludedIPs = ["foobar", "foobar"] - [http.middlewares.Middleware13] - [http.middlewares.Middleware13.passTLSClientCert] + [http.middlewares.Middleware14] + [http.middlewares.Middleware14.passTLSClientCert] pem = true - [http.middlewares.Middleware13.passTLSClientCert.info] + [http.middlewares.Middleware14.passTLSClientCert.info] notAfter = true notBefore = true sans = true serialNumber = true - [http.middlewares.Middleware13.passTLSClientCert.info.subject] + [http.middlewares.Middleware14.passTLSClientCert.info.subject] country = true province = true locality = true @@ -229,7 +235,7 @@ commonName = true serialNumber = true domainComponent = true - [http.middlewares.Middleware13.passTLSClientCert.info.issuer] + [http.middlewares.Middleware14.passTLSClientCert.info.issuer] country = true province = true locality = true @@ -237,50 +243,50 @@ commonName = true serialNumber = true domainComponent = true - [http.middlewares.Middleware14] - [http.middlewares.Middleware14.plugin] - [http.middlewares.Middleware14.plugin.PluginConf] - foo = "bar" [http.middlewares.Middleware15] - [http.middlewares.Middleware15.rateLimit] + [http.middlewares.Middleware15.plugin] + [http.middlewares.Middleware15.plugin.PluginConf] + foo = "bar" + [http.middlewares.Middleware16] + [http.middlewares.Middleware16.rateLimit] average = 42 period = "42s" burst = 42 - [http.middlewares.Middleware15.rateLimit.sourceCriterion] + [http.middlewares.Middleware16.rateLimit.sourceCriterion] requestHeaderName = "foobar" requestHost = true - [http.middlewares.Middleware15.rateLimit.sourceCriterion.ipStrategy] + [http.middlewares.Middleware16.rateLimit.sourceCriterion.ipStrategy] depth = 42 excludedIPs = ["foobar", "foobar"] - [http.middlewares.Middleware16] - [http.middlewares.Middleware16.redirectRegex] + [http.middlewares.Middleware17] + [http.middlewares.Middleware17.redirectRegex] regex = "foobar" replacement = "foobar" permanent = true - [http.middlewares.Middleware17] - [http.middlewares.Middleware17.redirectScheme] + [http.middlewares.Middleware18] + [http.middlewares.Middleware18.redirectScheme] scheme = "foobar" port = "foobar" permanent = true - [http.middlewares.Middleware18] - [http.middlewares.Middleware18.replacePath] - path = "foobar" [http.middlewares.Middleware19] - [http.middlewares.Middleware19.replacePathRegex] + [http.middlewares.Middleware19.replacePath] + path = "foobar" + [http.middlewares.Middleware20] + [http.middlewares.Middleware20.replacePathRegex] regex = "foobar" replacement = "foobar" - [http.middlewares.Middleware20] - [http.middlewares.Middleware20.retry] + [http.middlewares.Middleware21] + [http.middlewares.Middleware21.retry] attempts = 42 initialInterval = "42s" - [http.middlewares.Middleware21] - [http.middlewares.Middleware21.stripPrefix] - prefixes = ["foobar", "foobar"] [http.middlewares.Middleware22] - [http.middlewares.Middleware22.stripPrefixRegex] - regex = ["foobar", "foobar"] + [http.middlewares.Middleware22.stripPrefix] + prefixes = ["foobar", "foobar"] [http.middlewares.Middleware23] - [http.middlewares.Middleware23.grpcWeb] + [http.middlewares.Middleware23.stripPrefixRegex] + regex = ["foobar", "foobar"] + [http.middlewares.Middleware24] + [http.middlewares.Middleware24.grpcWeb] allowOrigins = ["foobar", "foobar"] [http.serversTransports] [http.serversTransports.ServersTransport0] diff --git a/docs/content/reference/dynamic-configuration/file.yaml b/docs/content/reference/dynamic-configuration/file.yaml index 368ea3d5b..a1bd21658 100644 --- a/docs/content/reference/dynamic-configuration/file.yaml +++ b/docs/content/reference/dynamic-configuration/file.yaml @@ -224,6 +224,16 @@ http: permissionsPolicy: foobar isDevelopment: true Middleware11: + ipWhiteList: + sourceRange: + - foobar + - foobar + ipStrategy: + depth: 42 + excludedIPs: + - foobar + - foobar + Middleware12: ipAllowList: rejectStatusCode: 404 sourceRange: @@ -234,7 +244,7 @@ http: excludedIPs: - foobar - foobar - Middleware12: + Middleware13: inFlightReq: amount: 42 sourceCriterion: @@ -245,7 +255,7 @@ http: - foobar requestHeaderName: foobar requestHost: true - Middleware13: + Middleware14: passTLSClientCert: pem: true info: @@ -270,11 +280,11 @@ http: serialNumber: true domainComponent: true serialNumber: true - Middleware14: + Middleware15: plugin: PluginConf: foo: bar - Middleware15: + Middleware16: rateLimit: average: 42 period: 42s @@ -287,38 +297,38 @@ http: - foobar requestHeaderName: foobar requestHost: true - Middleware16: + Middleware17: redirectRegex: regex: foobar replacement: foobar permanent: true - Middleware17: + Middleware18: redirectScheme: scheme: foobar port: foobar permanent: true - Middleware18: + Middleware19: replacePath: path: foobar - Middleware19: + Middleware20: replacePathRegex: regex: foobar replacement: foobar - Middleware20: + Middleware21: retry: attempts: 42 initialInterval: 42s - Middleware21: + Middleware22: stripPrefix: prefixes: - foobar - foobar - Middleware22: + Middleware23: stripPrefixRegex: regex: - foobar - foobar - Middleware23: + Middleware24: grpcWeb: allowOrigins: - foobar diff --git a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml index 504c5cd9c..e388639a9 100644 --- a/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml +++ b/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml @@ -1192,6 +1192,32 @@ spec: type: string type: array type: object + ipWhiteList: + description: 'Deprecated: please use IPAllowList instead.' + properties: + ipStrategy: + description: 'IPStrategy holds the IP strategy configuration used + by Traefik to determine the client IP. More info: https://doc.traefik.io/traefik/v3.0/middlewares/http/ipallowlist/#ipstrategy' + properties: + depth: + description: Depth tells Traefik to use the X-Forwarded-For + header and take the IP located at the depth position (starting + from the right). + type: integer + excludedIPs: + description: ExcludedIPs configures Traefik to scan the X-Forwarded-For + header and select the first IP not in the list. + items: + type: string + type: array + type: object + sourceRange: + description: SourceRange defines the set of allowed IPs (or ranges + of allowed IPs by using CIDR notation). + items: + type: string + type: array + type: object passTLSClientCert: description: 'PassTLSClientCert holds the pass TLS client cert middleware configuration. This middleware adds the selected data from the passed @@ -1528,6 +1554,17 @@ spec: type: string type: array type: object + ipWhiteList: + description: 'IPWhiteList defines the IPWhiteList middleware configuration. + Deprecated: please use IPAllowList instead.' + properties: + sourceRange: + description: SourceRange defines the allowed IPs (or ranges of + allowed IPs by using CIDR notation). + items: + type: string + type: array + type: object type: object required: - metadata diff --git a/docs/content/reference/dynamic-configuration/kv-ref.md b/docs/content/reference/dynamic-configuration/kv-ref.md index ef5a7154f..13ed064b2 100644 --- a/docs/content/reference/dynamic-configuration/kv-ref.md +++ b/docs/content/reference/dynamic-configuration/kv-ref.md @@ -78,64 +78,69 @@ | `traefik/http/middlewares/Middleware10/headers/stsIncludeSubdomains` | `true` | | `traefik/http/middlewares/Middleware10/headers/stsPreload` | `true` | | `traefik/http/middlewares/Middleware10/headers/stsSeconds` | `42` | -| `traefik/http/middlewares/Middleware11/ipAllowList/ipStrategy/depth` | `42` | -| `traefik/http/middlewares/Middleware11/ipAllowList/ipStrategy/excludedIPs/0` | `foobar` | -| `traefik/http/middlewares/Middleware11/ipAllowList/ipStrategy/excludedIPs/1` | `foobar` | -| `traefik/http/middlewares/Middleware11/ipAllowList/rejectStatusCode` | `404` | -| `traefik/http/middlewares/Middleware11/ipAllowList/sourceRange/0` | `foobar` | -| `traefik/http/middlewares/Middleware11/ipAllowList/sourceRange/1` | `foobar` | -| `traefik/http/middlewares/Middleware12/inFlightReq/amount` | `42` | -| `traefik/http/middlewares/Middleware12/inFlightReq/sourceCriterion/ipStrategy/depth` | `42` | -| `traefik/http/middlewares/Middleware12/inFlightReq/sourceCriterion/ipStrategy/excludedIPs/0` | `foobar` | -| `traefik/http/middlewares/Middleware12/inFlightReq/sourceCriterion/ipStrategy/excludedIPs/1` | `foobar` | -| `traefik/http/middlewares/Middleware12/inFlightReq/sourceCriterion/requestHeaderName` | `foobar` | -| `traefik/http/middlewares/Middleware12/inFlightReq/sourceCriterion/requestHost` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/commonName` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/country` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/domainComponent` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/locality` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/organization` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/province` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/issuer/serialNumber` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/notAfter` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/notBefore` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/sans` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/serialNumber` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/commonName` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/country` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/domainComponent` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/locality` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/organization` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/organizationalUnit` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/province` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/info/subject/serialNumber` | `true` | -| `traefik/http/middlewares/Middleware13/passTLSClientCert/pem` | `true` | -| `traefik/http/middlewares/Middleware14/plugin/PluginConf/foo` | `bar` | -| `traefik/http/middlewares/Middleware15/rateLimit/average` | `42` | -| `traefik/http/middlewares/Middleware15/rateLimit/burst` | `42` | -| `traefik/http/middlewares/Middleware15/rateLimit/period` | `42s` | -| `traefik/http/middlewares/Middleware15/rateLimit/sourceCriterion/ipStrategy/depth` | `42` | -| `traefik/http/middlewares/Middleware15/rateLimit/sourceCriterion/ipStrategy/excludedIPs/0` | `foobar` | -| `traefik/http/middlewares/Middleware15/rateLimit/sourceCriterion/ipStrategy/excludedIPs/1` | `foobar` | -| `traefik/http/middlewares/Middleware15/rateLimit/sourceCriterion/requestHeaderName` | `foobar` | -| `traefik/http/middlewares/Middleware15/rateLimit/sourceCriterion/requestHost` | `true` | -| `traefik/http/middlewares/Middleware16/redirectRegex/permanent` | `true` | -| `traefik/http/middlewares/Middleware16/redirectRegex/regex` | `foobar` | -| `traefik/http/middlewares/Middleware16/redirectRegex/replacement` | `foobar` | -| `traefik/http/middlewares/Middleware17/redirectScheme/permanent` | `true` | -| `traefik/http/middlewares/Middleware17/redirectScheme/port` | `foobar` | -| `traefik/http/middlewares/Middleware17/redirectScheme/scheme` | `foobar` | -| `traefik/http/middlewares/Middleware18/replacePath/path` | `foobar` | -| `traefik/http/middlewares/Middleware19/replacePathRegex/regex` | `foobar` | -| `traefik/http/middlewares/Middleware19/replacePathRegex/replacement` | `foobar` | -| `traefik/http/middlewares/Middleware20/retry/attempts` | `42` | -| `traefik/http/middlewares/Middleware20/retry/initialInterval` | `42s` | -| `traefik/http/middlewares/Middleware21/stripPrefix/prefixes/0` | `foobar` | -| `traefik/http/middlewares/Middleware21/stripPrefix/prefixes/1` | `foobar` | -| `traefik/http/middlewares/Middleware22/stripPrefixRegex/regex/0` | `foobar` | -| `traefik/http/middlewares/Middleware22/stripPrefixRegex/regex/1` | `foobar` | -| `traefik/http/middlewares/Middleware23/grpcWeb/allowOrigins/0` | `foobar` | -| `traefik/http/middlewares/Middleware23/grpcWeb/allowOrigins/1` | `foobar` | +| `traefik/http/middlewares/Middleware11/ipWhiteList/ipStrategy/depth` | `42` | +| `traefik/http/middlewares/Middleware11/ipWhiteList/ipStrategy/excludedIPs/0` | `foobar` | +| `traefik/http/middlewares/Middleware11/ipWhiteList/ipStrategy/excludedIPs/1` | `foobar` | +| `traefik/http/middlewares/Middleware11/ipWhiteList/sourceRange/0` | `foobar` | +| `traefik/http/middlewares/Middleware11/ipWhiteList/sourceRange/1` | `foobar` | +| `traefik/http/middlewares/Middleware12/ipAllowList/ipStrategy/depth` | `42` | +| `traefik/http/middlewares/Middleware12/ipAllowList/ipStrategy/excludedIPs/0` | `foobar` | +| `traefik/http/middlewares/Middleware12/ipAllowList/ipStrategy/excludedIPs/1` | `foobar` | +| `traefik/http/middlewares/Middleware12/ipAllowList/rejectStatusCode` | `404` | +| `traefik/http/middlewares/Middleware12/ipAllowList/sourceRange/0` | `foobar` | +| `traefik/http/middlewares/Middleware12/ipAllowList/sourceRange/1` | `foobar` | +| `traefik/http/middlewares/Middleware13/inFlightReq/amount` | `42` | +| `traefik/http/middlewares/Middleware13/inFlightReq/sourceCriterion/ipStrategy/depth` | `42` | +| `traefik/http/middlewares/Middleware13/inFlightReq/sourceCriterion/ipStrategy/excludedIPs/0` | `foobar` | +| `traefik/http/middlewares/Middleware13/inFlightReq/sourceCriterion/ipStrategy/excludedIPs/1` | `foobar` | +| `traefik/http/middlewares/Middleware13/inFlightReq/sourceCriterion/requestHeaderName` | `foobar` | +| `traefik/http/middlewares/Middleware13/inFlightReq/sourceCriterion/requestHost` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/commonName` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/country` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/domainComponent` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/locality` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/organization` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/province` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/issuer/serialNumber` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/notAfter` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/notBefore` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/sans` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/serialNumber` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/commonName` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/country` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/domainComponent` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/locality` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/organization` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/organizationalUnit` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/province` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/info/subject/serialNumber` | `true` | +| `traefik/http/middlewares/Middleware14/passTLSClientCert/pem` | `true` | +| `traefik/http/middlewares/Middleware15/plugin/PluginConf/foo` | `bar` | +| `traefik/http/middlewares/Middleware16/rateLimit/average` | `42` | +| `traefik/http/middlewares/Middleware16/rateLimit/burst` | `42` | +| `traefik/http/middlewares/Middleware16/rateLimit/period` | `42s` | +| `traefik/http/middlewares/Middleware16/rateLimit/sourceCriterion/ipStrategy/depth` | `42` | +| `traefik/http/middlewares/Middleware16/rateLimit/sourceCriterion/ipStrategy/excludedIPs/0` | `foobar` | +| `traefik/http/middlewares/Middleware16/rateLimit/sourceCriterion/ipStrategy/excludedIPs/1` | `foobar` | +| `traefik/http/middlewares/Middleware16/rateLimit/sourceCriterion/requestHeaderName` | `foobar` | +| `traefik/http/middlewares/Middleware16/rateLimit/sourceCriterion/requestHost` | `true` | +| `traefik/http/middlewares/Middleware17/redirectRegex/permanent` | `true` | +| `traefik/http/middlewares/Middleware17/redirectRegex/regex` | `foobar` | +| `traefik/http/middlewares/Middleware17/redirectRegex/replacement` | `foobar` | +| `traefik/http/middlewares/Middleware18/redirectScheme/permanent` | `true` | +| `traefik/http/middlewares/Middleware18/redirectScheme/port` | `foobar` | +| `traefik/http/middlewares/Middleware18/redirectScheme/scheme` | `foobar` | +| `traefik/http/middlewares/Middleware19/replacePath/path` | `foobar` | +| `traefik/http/middlewares/Middleware20/replacePathRegex/regex` | `foobar` | +| `traefik/http/middlewares/Middleware20/replacePathRegex/replacement` | `foobar` | +| `traefik/http/middlewares/Middleware21/retry/attempts` | `42` | +| `traefik/http/middlewares/Middleware21/retry/initialInterval` | `42s` | +| `traefik/http/middlewares/Middleware22/stripPrefix/prefixes/0` | `foobar` | +| `traefik/http/middlewares/Middleware22/stripPrefix/prefixes/1` | `foobar` | +| `traefik/http/middlewares/Middleware23/stripPrefixRegex/regex/0` | `foobar` | +| `traefik/http/middlewares/Middleware23/stripPrefixRegex/regex/1` | `foobar` | +| `traefik/http/middlewares/Middleware24/grpcWeb/allowOrigins/0` | `foobar` | +| `traefik/http/middlewares/Middleware24/grpcWeb/allowOrigins/1` | `foobar` | | `traefik/http/routers/Router0/entryPoints/0` | `foobar` | | `traefik/http/routers/Router0/entryPoints/1` | `foobar` | | `traefik/http/routers/Router0/middlewares/0` | `foobar` | diff --git a/docs/content/reference/dynamic-configuration/marathon-labels.json b/docs/content/reference/dynamic-configuration/marathon-labels.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml b/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml index 1290a6163..6eb4089c4 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_middlewares.yaml @@ -617,6 +617,32 @@ spec: type: string type: array type: object + ipWhiteList: + description: 'Deprecated: please use IPAllowList instead.' + properties: + ipStrategy: + description: 'IPStrategy holds the IP strategy configuration used + by Traefik to determine the client IP. More info: https://doc.traefik.io/traefik/v3.0/middlewares/http/ipallowlist/#ipstrategy' + properties: + depth: + description: Depth tells Traefik to use the X-Forwarded-For + header and take the IP located at the depth position (starting + from the right). + type: integer + excludedIPs: + description: ExcludedIPs configures Traefik to scan the X-Forwarded-For + header and select the first IP not in the list. + items: + type: string + type: array + type: object + sourceRange: + description: SourceRange defines the set of allowed IPs (or ranges + of allowed IPs by using CIDR notation). + items: + type: string + type: array + type: object passTLSClientCert: description: 'PassTLSClientCert holds the pass TLS client cert middleware configuration. This middleware adds the selected data from the passed diff --git a/docs/content/reference/dynamic-configuration/traefik.io_middlewaretcps.yaml b/docs/content/reference/dynamic-configuration/traefik.io_middlewaretcps.yaml index 462b9ed44..616e48b9c 100644 --- a/docs/content/reference/dynamic-configuration/traefik.io_middlewaretcps.yaml +++ b/docs/content/reference/dynamic-configuration/traefik.io_middlewaretcps.yaml @@ -55,6 +55,17 @@ spec: type: string type: array type: object + ipWhiteList: + description: 'IPWhiteList defines the IPWhiteList middleware configuration. + Deprecated: please use IPAllowList instead.' + properties: + sourceRange: + description: SourceRange defines the allowed IPs (or ranges of + allowed IPs by using CIDR notation). + items: + type: string + type: array + type: object type: object required: - metadata diff --git a/docs/content/reference/static-configuration/cli-ref.md b/docs/content/reference/static-configuration/cli-ref.md index efb874437..aabed9139 100644 --- a/docs/content/reference/static-configuration/cli-ref.md +++ b/docs/content/reference/static-configuration/cli-ref.md @@ -691,7 +691,7 @@ Kubernetes namespaces. Ingress refresh throttle duration (Default: ```0```) `--providers.kubernetescrd.token`: -Kubernetes bearer token (not needed for in-cluster client). +Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token. `--providers.kubernetesgateway`: Enable Kubernetes gateway api provider with default settings. (Default: ```false```) @@ -712,7 +712,7 @@ Kubernetes namespaces. Kubernetes refresh throttle duration (Default: ```0```) `--providers.kubernetesgateway.token`: -Kubernetes bearer token (not needed for in-cluster client). +Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token. `--providers.kubernetesingress`: Enable Kubernetes backend with default settings. (Default: ```false```) @@ -754,7 +754,7 @@ Kubernetes namespaces. Ingress refresh throttle duration (Default: ```0```) `--providers.kubernetesingress.token`: -Kubernetes bearer token (not needed for in-cluster client). +Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token. `--providers.nomad`: Enable Nomad backend with default settings. (Default: ```false```) diff --git a/docs/content/reference/static-configuration/env-ref.md b/docs/content/reference/static-configuration/env-ref.md index 10659e2e1..892fb2369 100644 --- a/docs/content/reference/static-configuration/env-ref.md +++ b/docs/content/reference/static-configuration/env-ref.md @@ -691,7 +691,7 @@ Kubernetes namespaces. Ingress refresh throttle duration (Default: ```0```) `TRAEFIK_PROVIDERS_KUBERNETESCRD_TOKEN`: -Kubernetes bearer token (not needed for in-cluster client). +Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token. `TRAEFIK_PROVIDERS_KUBERNETESGATEWAY`: Enable Kubernetes gateway api provider with default settings. (Default: ```false```) @@ -712,7 +712,7 @@ Kubernetes namespaces. Kubernetes refresh throttle duration (Default: ```0```) `TRAEFIK_PROVIDERS_KUBERNETESGATEWAY_TOKEN`: -Kubernetes bearer token (not needed for in-cluster client). +Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token. `TRAEFIK_PROVIDERS_KUBERNETESINGRESS`: Enable Kubernetes backend with default settings. (Default: ```false```) @@ -754,7 +754,7 @@ Kubernetes namespaces. Ingress refresh throttle duration (Default: ```0```) `TRAEFIK_PROVIDERS_KUBERNETESINGRESS_TOKEN`: -Kubernetes bearer token (not needed for in-cluster client). +Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token. `TRAEFIK_PROVIDERS_NOMAD`: Enable Nomad backend with default settings. (Default: ```false```) diff --git a/go.mod b/go.mod index 51609de00..f5a30e517 100644 --- a/go.mod +++ b/go.mod @@ -9,18 +9,15 @@ require ( github.com/andybalholm/brotli v1.0.6 github.com/aws/aws-sdk-go v1.44.327 github.com/cenkalti/backoff/v4 v4.2.1 - github.com/compose-spec/compose-go v1.0.3 github.com/containous/alice v0.0.0-20181107144136-d83ebdd94cbd github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc - github.com/docker/cli v20.10.11+incompatible - github.com/docker/compose/v2 v2.0.1 - github.com/docker/docker v20.10.21+incompatible + github.com/docker/cli v24.0.7+incompatible + github.com/docker/docker v24.0.7+incompatible github.com/docker/go-connections v0.4.0 github.com/fatih/structs v1.1.0 github.com/fsnotify/fsnotify v1.7.0 github.com/go-acme/lego/v4 v4.14.0 - github.com/go-check/check v0.0.0-00010101000000-000000000000 github.com/go-kit/kit v0.10.1-0.20200915143503-439c4d2ed3ea github.com/golang/protobuf v1.5.3 github.com/google/go-github/v28 v28.1.1 @@ -35,7 +32,7 @@ require ( github.com/http-wasm/http-wasm-host-go v0.5.2 github.com/influxdata/influxdb-client-go/v2 v2.7.0 github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d - github.com/klauspost/compress v1.17.1 + github.com/klauspost/compress v1.17.2 github.com/kvtools/consul v1.0.2 github.com/kvtools/etcdv3 v1.0.2 github.com/kvtools/redis v1.1.0 @@ -59,6 +56,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/stvp/go-udp-testing v0.0.0-20191102171040-06b61409b154 github.com/tailscale/tscert v0.0.0-20220316030059-54bbcb9f74e2 + github.com/testcontainers/testcontainers-go v0.27.0 github.com/tetratelabs/wazero v1.5.0 github.com/tidwall/gjson v1.17.0 github.com/traefik/grpc-web v0.16.0 @@ -66,7 +64,6 @@ require ( github.com/traefik/yaegi v0.15.1 github.com/unrolled/render v1.0.2 github.com/unrolled/secure v1.0.9 - github.com/vdemeester/shakers v0.1.0 github.com/vulcand/oxy/v2 v2.0.0-20230427132221-be5cf38f3c1c github.com/vulcand/predicate v1.2.0 go.opentelemetry.io/collector/pdata v0.66.0 @@ -100,8 +97,8 @@ require ( require ( cloud.google.com/go/compute v1.23.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect + dario.cat/mergo v1.0.0 // indirect github.com/AdamSLevy/jsonrpc2/v14 v14.1.0 // indirect - github.com/AlecAivazis/survey/v2 v2.2.3 // indirect github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 // indirect @@ -121,12 +118,11 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.8.25 // indirect + github.com/Microsoft/hcsshim v0.11.4 // indirect github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect github.com/VividCortex/gohistogram v1.0.0 // indirect - github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 // indirect github.com/aliyun/alibaba-cloud-sdk-go v1.61.1755 // indirect github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect @@ -147,72 +143,59 @@ require ( github.com/aws/smithy-go v1.14.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect - github.com/buger/goterm v1.0.0 // indirect + github.com/bytedance/sonic v1.10.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/civo/civogo v0.3.11 // indirect github.com/cloudflare/cloudflare-go v0.70.0 // indirect - github.com/compose-spec/godotenv v1.0.0 // indirect - github.com/containerd/cgroups v1.0.3 // indirect - github.com/containerd/console v1.0.3 // indirect - github.com/containerd/containerd v1.5.17 // indirect - github.com/containerd/continuity v0.3.0 // indirect - github.com/containerd/typeurl v1.0.2 // indirect + github.com/containerd/containerd v1.7.11 // indirect + github.com/containerd/log v0.1.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cpu/goacmedns v0.1.1 // indirect + github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/deepmap/oapi-codegen v1.9.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dimchansky/utfbom v1.1.1 // indirect - github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e // indirect github.com/dnsimple/dnsimple-go v1.2.0 // indirect - github.com/docker/buildx v0.5.2-0.20210422185057-908a856079fc // indirect github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.6.4-0.20210125172408-38bea2ce277a // indirect - github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect - github.com/docker/go-metrics v0.0.1 // indirect - github.com/docker/go-units v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/exoscale/egoscale v0.100.1 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/fvbommel/sortorder v1.0.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/gin-gonic/gin v1.7.7 // indirect + github.com/gin-gonic/gin v1.9.1 // indirect github.com/go-errors/errors v1.0.1 // indirect github.com/go-jose/go-jose/v3 v3.0.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-playground/validator/v10 v10.15.1 // indirect github.com/go-resty/resty/v2 v2.7.0 // indirect - github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/go-zookeeper/zk v1.0.3 // indirect - github.com/gofrs/flock v0.8.0 // indirect - github.com/gogo/googleapis v1.4.0 // indirect + github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/mock v1.6.0 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect github.com/google/s2a-go v0.1.5 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect github.com/googleapis/gax-go/v2 v2.11.0 // indirect github.com/gophercloud/gophercloud v1.0.0 // indirect github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae // indirect github.com/gravitational/trace v1.1.16-0.20220114165159-14a9a7dd6aaf // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect - github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect github.com/hashicorp/cronexpr v1.1.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -223,16 +206,14 @@ require ( github.com/huandu/xstrings v1.4.0 // indirect github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect github.com/imdario/mergo v0.3.16 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect github.com/infobloxopen/infoblox-go-client v1.1.1 // indirect - github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/jonboulle/clockwork v0.2.2 // indirect + github.com/jonboulle/clockwork v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/labbsr0x/bindman-dns-webhook v1.0.2 // indirect @@ -241,26 +222,22 @@ require ( github.com/liquidweb/go-lwApi v0.0.5 // indirect github.com/liquidweb/liquidweb-cli v0.6.9 // indirect github.com/liquidweb/liquidweb-go v1.6.3 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mailgun/minheap v0.0.0-20170619185613-3dbe6c6bf55f // indirect github.com/mailgun/multibuf v0.1.2 // indirect github.com/mailgun/timetools v0.0.0-20141028012446-7e6055773c51 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-shellwords v1.0.12 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect - github.com/miekg/pkcs11 v1.0.3 // indirect github.com/mimuret/golang-iij-dpf v0.9.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/moby/buildkit v0.8.2-0.20210401015549-df49b648c8bf // indirect - github.com/moby/locker v1.0.1 // indirect - github.com/moby/sys/mount v0.2.0 // indirect - github.com/moby/sys/mountinfo v0.5.0 // indirect - github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect + github.com/moby/patternmatcher v0.6.0 // indirect + github.com/moby/sys/sequential v0.5.0 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect @@ -279,13 +256,14 @@ require ( github.com/onsi/ginkgo/v2 v2.11.0 // indirect github.com/onsi/gomega v1.27.10 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.5 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/oracle/oci-go-sdk v24.3.0+incompatible // indirect github.com/ovh/go-ovh v1.4.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.9 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pquerna/otp v1.4.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect @@ -297,33 +275,30 @@ require ( github.com/sacloud/go-http v0.1.6 // indirect github.com/sacloud/iaas-api-go v1.11.1 // indirect github.com/sacloud/packages-go v0.0.9 // indirect - github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 // indirect + github.com/shirou/gopsutil/v3 v3.23.11 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/simplesurance/bunny-go v0.0.0-20221115111006-e11d9dc91f04 // indirect github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 // indirect github.com/softlayer/softlayer-go v1.1.2 // indirect github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.1 // indirect github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.490 // indirect github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.490 // indirect - github.com/theupdateframework/notary v0.6.1 // indirect github.com/tidwall/match v1.1.1 // indirect - github.com/tidwall/pretty v1.2.0 // indirect - github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85 // indirect - github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/transip/gotransip/v6 v6.20.0 // indirect github.com/ultradns/ultradns-go-sdk v1.5.0-20230427130837-23c9b0c // indirect github.com/vinyldns/go-vinyldns v0.9.16 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect - github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/yandex-cloud/go-genproto v0.0.0-20220805142335-27b56ddae16f // indirect github.com/yandex-cloud/go-sdk v0.0.0-20220805164847-cf028e604997 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect github.com/zeebo/errs v1.2.2 // indirect go.etcd.io/etcd/api/v3 v3.5.9 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect @@ -335,10 +310,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect go.uber.org/zap v1.26.0 // indirect + golang.org/x/arch v0.4.0 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sync v0.4.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.13.0 // indirect google.golang.org/api v0.128.0 // indirect google.golang.org/appengine v1.6.8 // indirect @@ -363,7 +338,7 @@ require ( // Containous forks replace ( github.com/abbot/go-http-auth => github.com/containous/go-http-auth v0.4.1-0.20200324110947-a37a7636d23e - github.com/go-check/check => github.com/containous/check v0.0.0-20170915194414-ca0bf163426a + github.com/gorilla/mux => github.com/containous/mux v0.0.0-20220627093034-b2dd784e613f github.com/mailgun/minheap => github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595 ) @@ -373,3 +348,6 @@ replace github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402 // ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http in multiple modules // tencentcloud uses monorepo with multimodule but the go.mod files are incomplete. exclude github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible + +// https://github.com/docker/compose/blob/v2.19.0/go.mod#L12 +replace github.com/cucumber/godog => github.com/cucumber/godog v0.13.0 diff --git a/go.sum b/go.sum index 1bf9ae159..a44d026a4 100644 --- a/go.sum +++ b/go.sum @@ -1,57 +1,26 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bitbucket.org/liamstask/goose v0.0.0-20150115234039-8488cc47d90c/go.mod h1:hSVuE3qU7grINVSwrmzHfpg9k87ALBk+XaualNyUzI4= -cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamSLevy/jsonrpc2/v14 v14.1.0 h1:Dy3M9aegiI7d7PF1LUdjbVigJReo+QOceYsMyFh9qoE= github.com/AdamSLevy/jsonrpc2/v14 v14.1.0/go.mod h1:ZakZtbCXxCz82NJvq7MoREtiQesnDfrtF6RFUGzQfLo= -github.com/AlecAivazis/survey/v2 v2.2.3 h1:utJR2X4Ibp2fBxdjalQUiMFf3zfQNjA15YE8+ftlKEs= -github.com/AlecAivazis/survey/v2 v2.2.3/go.mod h1:9FJRdMdDm8rnT+zHVbvQT2RTSTLq0Ttd6q3Vl2fahjk= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= @@ -68,23 +37,13 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.1.0/go.mod h1:y2zXtLSMM/X5Mfawq0lOftpWn3f4V6OCsRdINsvWBPI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v12.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= github.com/Azure/go-autorest/autorest v0.11.27 h1:F3R3q42aWytozkV8ihzcgMO4OA4cuqr3bNlsEuF6//A= github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/adal v0.9.20 h1:gJ3E98kMpFB1MFqQCvA1yFab8vthOeD4VlFRQULxahg= github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= @@ -92,22 +51,15 @@ github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 h1:wkAZRgT/pn8HhFyzfe9U github.com/Azure/go-autorest/autorest/azure/auth v0.5.12/go.mod h1:84w/uV8E37feW2NCJ08uT9VBfjfUHpgLVnG2InYD6cg= github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 h1:0W/yGmFdTIT77fvdlGZ0LMISoLHFJ7Tx4U0yeB+uFs4= github.com/Azure/go-autorest/autorest/azure/cli v0.4.5/go.mod h1:ADQAXrkgm7acgWVUNamOgh8YNrv4p27l3Wc55oVfpzg= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -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/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= @@ -117,71 +69,36 @@ github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8 github.com/BurntSushi/toml v1.3.2/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 v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.18/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.25 h1:fRMwXiwk3qDwc0P05eHnh+y2v07JdtsfQ1fuAc69m9g= -github.com/Microsoft/hcsshim v0.8.25/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw= -github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= +github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 h1:xPMsUicZ3iosVPSIP7bW5EcGUzjiiMl1OYTe14y/R24= github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 h1:F1j7z+/DKEsYqZNoxC6wvfmaiDneLsQOFQmuq9NADSY= github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2/go.mod h1:QlXr/TrICfQ/ANa76sLeQyhAJyNR9sEcfNuZBkY9jgY= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1755 h1:J45/QHgrzUdqe/Vco/Vxk0wRvdS2nKUxmf/zLgvfass= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1755/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= @@ -191,24 +108,15 @@ github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.44.327 h1:ZS8oO4+7MOBLhkdwIhgtVeDzCeWOlTfKJS7EgggbIEY= github.com/aws/aws-sdk-go v1.44.327/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -245,67 +153,43 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.19.3/go.mod h1:yVGZA1CPkmUhBdA039jXN github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/buger/goterm v1.0.0 h1:ZB6uUlY8+sjJyFGzz2WpRqX2XYPeXVgtZAOJMwOsTWM= -github.com/buger/goterm v1.0.0/go.mod h1:16STi3LquiscTIHA8SXUNKEa/Cnu4ZHBH8NsCaWgso0= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/bugsnag-go v1.4.1/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/bugsnag-go v1.5.0 h1:tP8hiPv1pGGW3LA6LKy5lW6WG+y9J2xWUdPd3WC452k= -github.com/bugsnag/bugsnag-go v1.5.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/bugsnag/panicwrap v1.2.0 h1:OzrKrRvXis8qEvOkfcxNcYbOd2O7xXS2nnKMEMABFQA= -github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= +github.com/bytedance/sonic v1.10.0 h1:qtNZduETEIWJVIyDl01BeNxur2rW9OwTQ/yBqFRkKEk= +github.com/bytedance/sonic v1.10.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20180118203423-deb3ae2ef261/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= +github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= +github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -313,18 +197,9 @@ github.com/civo/civogo v0.3.11 h1:mON/fyrV946Sbk6paRtOSGsN+asCgCmHCgArf5xmGxM= github.com/civo/civogo v0.3.11/go.mod h1:7+GeeFwc4AYTULaEshpT2vIcl3Qq8HPoxA17viX3l6g= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/backoff v0.0.0-20161212185259-647f3cdfc87a/go.mod h1:rzgs2ZOiguV6/NpiDgADjRLPNyZlApIWxKpkT+X8SdY= -github.com/cloudflare/cfssl v0.0.0-20181213083726-b94e044bb51e/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= -github.com/cloudflare/cfssl v1.4.1 h1:vScfU2DrIUI9VPHBVeeAQ0q5A+9yshO1Gz+3QoUQiKw= -github.com/cloudflare/cfssl v1.4.1/go.mod h1:KManx/OJPb5QY+y0+o/898AMcM128sF0bURvoVUSjTo= github.com/cloudflare/cloudflare-go v0.70.0 h1:4opGbUygM8DjirUuaz23jn3akuAcnOCEx+0nQtQEcFo= github.com/cloudflare/cloudflare-go v0.70.0/go.mod h1:VW6GuazkaZ4xEDkFt24lkXQUsE8q7BiGqDniC2s8WEM= -github.com/cloudflare/go-metrics v0.0.0-20151117154305-6a9aea36fb41/go.mod h1:eaZPlJWD+G9wseg1BuRXlHnjntPMrywMsyxf+LTOdP4= -github.com/cloudflare/redoctober v0.0.0-20171127175943-746a508df14c/go.mod h1:6Se34jNoqrd8bTxrmJB2Bg2aoZ2CdSXonils9NsiNgo= -github.com/cnabio/cnab-go v0.10.0-beta1/go.mod h1:5c4uOP6ZppR4nUGtCMAElscRiYEUi44vNQwtSAvISXk= -github.com/cnabio/cnab-to-oci v0.3.1-beta1/go.mod h1:8BomA5Vye+3V/Kd2NSFblCBmp1rJV5NfXBYKbIGT5Rw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -333,142 +208,30 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/compose-spec/compose-go v1.0.2/go.mod h1:gCIA3No0j5nNszz2X0yd/mkigTIWcOgHiPa9guWvoec= -github.com/compose-spec/compose-go v1.0.3 h1:yvut1x9H4TUMptNA4mZ63VGVtDNX1OKy2TZCi6yFw8Q= -github.com/compose-spec/compose-go v1.0.3/go.mod h1:gCIA3No0j5nNszz2X0yd/mkigTIWcOgHiPa9guWvoec= -github.com/compose-spec/godotenv v1.0.0 h1:TV24JYhh5GCC1G14npQVhCtxeoiwd0NcT0VdwcCQyXU= -github.com/compose-spec/godotenv v1.0.0/go.mod h1:zF/3BOa18Z24tts5qnO/E9YURQanJTBUf7nlcCTNsyc= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3 h1:ADZftAkglvCiD44c77s5YmMqaP2pzVCFZvBmAlBdAP4= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.7/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.0.0.20210122062454-5a66c2ae5cec/go.mod h1:p9z+oqCID32tZ7LKgej316N9pJf1iIkQ/7nK1VvEFZE= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.5/go.mod h1:oSTh0QpT1w6jYcGmbiSbxv9OSQYaa88mPyWIuU79zyo= -github.com/containerd/containerd v1.5.17 h1:NLDEI//zhMZpR3DS/AP0qiN+dzYKNAwJaNXCnCmYcgY= -github.com/containerd/containerd v1.5.17/go.mod h1:7IN9MtIzTZH4WPEmD1gNH8bbTQXVX68yd3ZXxSHYCis= -github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fuse-overlayfs-snapshotter v1.0.2/go.mod h1:nRZceC8a7dRm3Ao6cJAwuJWPFiBPaibHiFntRUnzhwU= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter v0.4.1/go.mod h1:H59SY9Rw+vkIfWtuuyjeLeAc7uuALmuvUdAS6w+xmEw= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= +github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containous/alice v0.0.0-20181107144136-d83ebdd94cbd h1:0n+lFLh5zU0l6KSk3KpnDwfbPGAR44aRLgTbCnhRBHU= github.com/containous/alice v0.0.0-20181107144136-d83ebdd94cbd/go.mod h1:BbQgeDS5i0tNvypwEoF1oNjOJw8knRAE1DnVvjDstcQ= -github.com/containous/check v0.0.0-20170915194414-ca0bf163426a h1:8esAQaPKjfntQR1bag/mAOvWJd5HqSX5nsa+0KT63zo= -github.com/containous/check v0.0.0-20170915194414-ca0bf163426a/go.mod h1:eQOqZ7GoFsLxI7jFKLs7+Nv2Rm1x4FyK8d2NV+yGjwQ= github.com/containous/go-http-auth v0.4.1-0.20200324110947-a37a7636d23e h1:D+uTEzDZc1Fhmd0Pq06c+O9+KkAyExw0eVmu/NOqaHU= github.com/containous/go-http-auth v0.4.1-0.20200324110947-a37a7636d23e/go.mod h1:s8kLgBQolDbsJOPVIGCEEv9zGAKUUf/685Gi0Qqg8z8= github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595 h1:aPspFRO6b94To3gl4yTDOEtpjFwXI7V2W+z0JcNljQ4= github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595/go.mod h1:+lHFbEasIiQVGzhVDVw/cn0ZaOzde2OwNncp1NhXV4c= +github.com/containous/mux v0.0.0-20220627093034-b2dd784e613f h1:1uEtynq2C0ljy3630jt7EAxg8jZY2gy6YHdGwdqEpWw= +github.com/containous/mux v0.0.0-20220627093034-b2dd784e613f/go.mod h1:z8WW7n06n8/1xF9Jl9WmuDeZuHAhfL+bwarNjsciwwg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -477,24 +240,16 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpu/goacmedns v0.1.1 h1:DM3H2NiN2oam7QljgGY5ygy4yDXhK5Z4JUnqaugs2C4= github.com/cpu/goacmedns v0.1.1/go.mod h1:MuaouqEhPAHxsbqjgnck5zeghuwBP1dLnPoobeGqugQ= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= +github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= -github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= -github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -504,110 +259,47 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go. github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/deepmap/oapi-codegen v1.9.1 h1:yHmEnA7jSTUMQgV+uN02WpZtwHnz2CBW3mZRIxr1vtI= github.com/deepmap/oapi-codegen v1.9.1/go.mod h1:PLqNAhdedP8ttRpBBkzLKU3bp+Fpy+tTgeAMlztR2cw= -github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= -github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e h1:n81KvOMrLZa+VWHwST7dun9f0G98X3zREHS1ztYzZKU= -github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e/go.mod h1:xpWTC2KnJMiDLkoawhsPQcXjvwATEBcbq0xevG2YR9M= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/dnsimple/dnsimple-go v1.2.0 h1:ddTGyLVKly5HKb5L65AkLqFqwZlWo3WnR0BlFZlIddM= github.com/dnsimple/dnsimple-go v1.2.0/go.mod h1:z/cs26v/eiRvUyXsHQBLd8lWF8+cD6GbmkPH84plM4U= -github.com/docker/buildx v0.5.2-0.20210422185057-908a856079fc h1:oqPGOy23wxFCyOMSfdZTk02F7qvPi7kUEEeKrExKtfw= -github.com/docker/buildx v0.5.2-0.20210422185057-908a856079fc/go.mod h1:T5sa7xGu8G7dLXwaLLj6dRbJ5mxugPFDfELGnO2B5lQ= -github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.11+incompatible h1:tXU1ezXcruZQRrMP8RN2z9N91h+6egZTS1gsPsKantc= -github.com/docker/cli v20.10.11+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli-docs-tool v0.1.1/go.mod h1:oMzPNt1wC3TcxuY22GMnOODNOxkwGH51gV3AhqAjFQ4= -github.com/docker/compose-on-kubernetes v0.4.19-0.20190128150448-356b2919c496/go.mod h1:iT2pYfi580XlpaV4KmK0T6+4/9+XoKmk/fhoDod1emE= -github.com/docker/compose-switch v1.0.2/go.mod h1:uyPj8S3oH1O9rSZ5QVozw28OIjdNIflSSYElC2P0plQ= -github.com/docker/compose/v2 v2.0.1 h1:7LGiEWWFSTxTq2iN8hKHgFWi+iTBmHYNW/0Xo9JXffw= -github.com/docker/compose/v2 v2.0.1/go.mod h1:urQiI7sPYgS5RqIqZeDLAwumdEMjNFE2ziofshucFrM= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= +github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20181229214054-f76d6a078d88/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog= -github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/docker-credential-helpers v0.6.4-0.20210125172408-38bea2ce277a h1:1DndKi+f9qs3AexOfI6di7RkWcWlNHzdqHu1cX19/ac= -github.com/docker/docker-credential-helpers v0.6.4-0.20210125172408-38bea2ce277a/go.mod h1:ofX3UI0Gz1TteYBjtgs07O36Pyasyp66D2uKT7H8W1c= -github.com/docker/go v1.5.1-1/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q= -github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= -github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libnetwork v0.8.0-dev.2.0.20201215162534-fa125a3512ee h1:VQGPaek8TO9sRNRVNXmjzrya1SmleN0cMf/vvyjjJHo= -github.com/docker/libnetwork v0.8.0-dev.2.0.20201215162534-fa125a3512ee/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/libtrust v0.0.0-20150526203908-9cbd2a1374f4/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exoscale/egoscale v0.100.1 h1:iXsV1Ei7daqe/6FYSCSDyrFs1iUG1l1X9qNh2uMw6z0= @@ -619,38 +311,27 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.87.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.0.0-20180121060056-563b81fc02b7/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-acme/lego/v4 v4.14.0 h1:/skZoRHgVh0d2RK7l1g3Ch8HqeqP9LB8ZEjLdGEpcDE= github.com/go-acme/lego/v4 v4.14.0/go.mod h1:zjmvNCDLGz7GrC1OqdVpVmZFKSRabEDtWbdzmcpBsGo= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= @@ -658,9 +339,6 @@ github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -672,31 +350,20 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= @@ -713,22 +380,16 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.15.1 h1:BSe8uhN+xQ4r5guV/ywQI4gO59C2raYcGffYWZEjZzM= +github.com/go-playground/validator/v10 v10.15.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= -github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b h1:/vQ+oYKu+JoyaMPDsv5FzwuL2wwWBgBbtj/YLCi4LuA= @@ -743,30 +404,16 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/goccy/go-json v0.7.8/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.8.0 h1:MSdYClljsF3PbENUUEx85nkWfJSGfzYI9yEBZOJz6CY= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.3.0/go.mod h1:d+q1s/xVJxZGKWwC/6UfPIF33J+G1Tq4GYv9Y+Tg/EU= -github.com/gogo/googleapis v1.4.0 h1:zgVt4UpGxcqVOw97aRGxT4svlcmdK35fynLNctY32zI= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= @@ -783,27 +430,16 @@ github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -814,29 +450,22 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= -github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/certificate-transparency-go v1.0.21 h1:Yf1aXowfZ2nuboBsg7iYGLmwsOARdV86pfH3g95wXmE= -github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -847,59 +476,36 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.0.0-20191015185424-71da34e4d9b3/go.mod h1:ZXFeSndFcK4vB1NR4voH1Zm38K7ViUNiYtfIBDxrwf0= github.com/google/go-github/v28 v28.1.1 h1:kORf5ekX5qwXO2mGzXXOjMe/g6ap8ahVe0sBEulhSxo= github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM= github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b h1:h9U78+dx9a4BKdQkBBos92HalKpaGKHrp+3Uo6yTodo= github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.5 h1:8IYp3w9nysqv3JH+NJgXJzGbDHzLOTj43BmSkp+O7qg= github.com/google/s2a-go v0.1.5/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gophercloud/gophercloud v0.15.1-0.20210202035223-633d73521055/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/gophercloud v1.0.0 h1:9nTGx0jizmHxDobe4mck89FyQHVyA3CaXLIUSGJjP9k= github.com/gophercloud/gophercloud v1.0.0/go.mod h1:Q8fZtyi5zZxPS/j9aj3sSxtvj41AdQMDwyo1myduD5c= @@ -907,43 +513,23 @@ github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae h1:Hi3IgB9RQDE15 github.com/gophercloud/utils v0.0.0-20210216074907-f6de111f2eae/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gravitational/trace v1.1.16-0.20220114165159-14a9a7dd6aaf h1:C1GPyPJrOlJlIrcaBBiBpDsqZena2Ks8spa5xZqr1XQ= github.com/gravitational/trace v1.1.16-0.20220114165159-14a9a7dd6aaf/go.mod h1:zXqxTI6jXDdKnlf8s+nT+3c8LrwUEy3yNpO4XJL90lA= -github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= -github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= -github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= -github.com/hanwen/go-fuse/v2 v2.0.4-0.20201208195215-4a458845028b/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.26.1 h1:5oSXOO5fboPZeW5SN+TdGFP/BILDgBm19OrPZ/pICIM= @@ -954,7 +540,6 @@ github.com/hashicorp/consul/sdk v0.15.0 h1:2qK9nDrr4tiJKRoxPGhm6B7xJjLVIQqkjiab2 github.com/hashicorp/consul/sdk v0.15.0/go.mod h1:r/OmRRPbHOe0yxNahLw7G9x5WG17E1BIECMtCjcPSNo= github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -962,7 +547,6 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840/go.mod h1:Abjk0jbRkDaNCzsRhOv2iDCofYpX1eVsjozoiK63qLA= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= @@ -972,7 +556,6 @@ github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -992,20 +575,15 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= @@ -1017,9 +595,6 @@ github.com/hashicorp/nomad/api v0.0.0-20220506174431-b5665129cd1f/go.mod h1:b/Ao github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0= -github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ= -github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/http-wasm/http-wasm-host-go v0.5.2 h1:5d/QgaaJtTF+qd0goBaxJJ7tcHP9n+gQUldJ7TsTexA= github.com/http-wasm/http-wasm-host-go v0.5.2/go.mod h1:zQB3w+df4hryDEqBorGyA1DwPJ86LfKIASNLFuj6CuI= @@ -1027,20 +602,13 @@ github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df h1:MZf03xP9WdakyXhOWuAD5uPK3wHh96wCsqe3hCMKh8E= github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb-client-go/v2 v2.7.0 h1:QgP5mlBE9sGnzplpnf96pr+p7uqlIlL4W2GAP3n+XZg= github.com/influxdata/influxdb-client-go/v2 v2.7.0/go.mod h1:Y/0W1+TZir7ypoQZYd2IrnVOKB3Tq6oegAQeSVN/+EU= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA= @@ -1049,87 +617,54 @@ github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7 github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/infobloxopen/infoblox-go-client v1.1.1 h1:728A6LbLjptj/7kZjHyIxQnm768PWHfGFm0HH8FnbtU= github.com/infobloxopen/infoblox-go-client v1.1.1/go.mod h1:BXiw7S2b9qJoM8MS40vfgCNB2NLHGusk1DtO16BD9zI= -github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jarcoal/httpmock v1.0.8/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc= github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jinzhu/gorm v1.9.2/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= -github.com/jinzhu/gorm v1.9.11 h1:gaHGvE+UnWGlbWG4Y3FUwY1EcZ5n6S9WtqBA/uySMLE= -github.com/jinzhu/gorm v1.9.11/go.mod h1:bu/pK8szGZ2puuErfU0RwyeNdsf3e6nCX/noXaVxkfw= -github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.0/go.mod h1:oHTiXerJ20+SfYcrdlBO7rzZRJWGwSTQ0iUY2jI6Gfc= -github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmhodges/clock v0.0.0-20160418191101-880ee4c33548/go.mod h1:hGT6jSUVzF6no3QaDSMLGLEHtHSBSefs+MgcDWnmhmo= -github.com/jmoiron/sqlx v0.0.0-20180124204410-05cef0741ade/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= +github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 h1:qGQQKEcAR99REcMpsXCp3lJ03zYT1PkRd3kQGPn9GVg= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= -github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kisielk/sqlstruct v0.0.0-20150923205031-648daed35d49/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= -github.com/kisom/goutils v1.1.0/go.mod h1:+UBTfd78habUYWFbNWTJNG+jNG/i/lGURakr4A/yNRw= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= -github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -1143,8 +678,6 @@ github.com/kvtools/valkeyrie v1.0.0 h1:LAITop2wPoYCMitR24GZZsW0b57hmI+ePD18VRTtO github.com/kvtools/valkeyrie v1.0.0/go.mod h1:bDi/OdhJCSbGPMsCgUQl881yuEweKCSItAtTBI+ZjpU= github.com/kvtools/zookeeper v1.0.2 h1:uK0CzQa+mtKGxDDH+DeqXo2HC1Kx4hWXZ7pX/zS4aTo= github.com/kvtools/zookeeper v1.0.2/go.mod h1:6TfxUwJ7IuBk5srgnoe528W0ftanNECHgOiShx/t0Aw= -github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28/go.mod h1:T/T7jsxVqf9k/zYOqbgNAsANsjxTd1Yq3htjDhQ1H0c= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labbsr0x/bindman-dns-webhook v1.0.2 h1:I7ITbmQPAVwrDdhd6dHKi+MYJTJqPCK0jE6YNBAevnk= @@ -1166,10 +699,6 @@ github.com/lestrrat-go/httpcc v1.0.0/go.mod h1:tGS/u00Vh5N6FHNkExqGGNId8e0Big+++ github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= github.com/lestrrat-go/jwx v1.2.7/go.mod h1:bw24IXWbavc0R2RsOtpXL7RtMyP589yZ1+L7kd09ZGA= github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/lib/pq v0.0.0-20180201184707-88edab080323/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linode/linodego v1.17.2 h1:b32dj4662PGG5P9qVa6nBezccWdqgukndlMIuPGq1CQ= @@ -1181,26 +710,23 @@ github.com/liquidweb/liquidweb-cli v0.6.9 h1:acbIvdRauiwbxIsOCEMXGwF75aSJDbDiyAW github.com/liquidweb/liquidweb-cli v0.6.9/go.mod h1:cE1uvQ+x24NGUL75D0QagOFCG8Wdvmwu8aL9TLmA/eQ= github.com/liquidweb/liquidweb-go v1.6.3 h1:NVHvcnX3eb3BltiIoA+gLYn15nOpkYkdizOEYGSKrk4= github.com/liquidweb/liquidweb-go v1.6.3/go.mod h1:SuXXp+thr28LnjEw18AYtWwIbWMHSUiajPQs8T9c/Rc= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailgun/multibuf v0.1.2 h1:QE9kE27lK6LFZB4aYNVtUPlWVHVCT0zpgUr2uoq/+jk= github.com/mailgun/multibuf v0.1.2/go.mod h1:E+sUhIy69qgT6EM57kCPdUTlHnjTuxQBO/yf6af9Hes= github.com/mailgun/timetools v0.0.0-20141028012446-7e6055773c51 h1:Kg/NPZLLC3aAFr1YToMs98dbCdhootQ1hZIvZU28hAQ= github.com/mailgun/timetools v0.0.0-20141028012446-7e6055773c51/go.mod h1:RYmqHbhWwIz3z9eVmQ2rx82rulEMG0t+Q1bzfc9DYN4= github.com/mailgun/ttlmap v0.0.0-20170619185759-c1c17f74874f h1:ZZYhg16XocqSKPGNQAe0aeweNtFxuedbwwb4fSlg7h4= github.com/mailgun/ttlmap v0.0.0-20170619185759-c1c17f74874f/go.mod h1:8heskWJ5c0v5J9WH89ADhyal1DOZcayll8fSbhB+/9A= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -1227,31 +753,20 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.47/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= -github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mimuret/golang-iij-dpf v0.9.1 h1:Gj6EhHJkOhr+q2RnvRPJsPMcjuVnWPSccEHyoEehU34= github.com/mimuret/golang-iij-dpf v0.9.1/go.mod h1:sl9KyOkESib9+KRD3HaGpgi1xk7eoN2+d96LCLsME2M= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -1265,7 +780,6 @@ github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= @@ -1273,53 +787,33 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/buildkit v0.8.2-0.20210401015549-df49b648c8bf h1:dHwWBX8OhYb69qVcT27rFSwzKsn4CRbg0HInQyVh33c= -github.com/moby/buildkit v0.8.2-0.20210401015549-df49b648c8bf/go.mod h1:GJcrUlTGFAPlEmPQtbrTsJYn+cy+Jwl7vTZS7jYAoow= -github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74= -github.com/moby/sys/mount v0.2.0 h1:WhCW5B355jtxndN5ovugJlMFJawbUODuW8fSnEH6SSM= -github.com/moby/sys/mount v0.2.0/go.mod h1:aAivFE2LB3W4bACsUXChRHQ0qKWsetY4Y9V7sxOougM= -github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474/go.mod h1:OQA4XLvDbMgS8P0CevmM4m9Q3Jq4phKUzcocxuGJ5m8= -github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 h1:o6uBwrhM5C8Ll3MAAxrQxRHEu7FkapwTuI2WmL1rw4g= github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= github.com/natefinch/lumberjack v0.0.0-20201021141957-47ffae23317c h1:194MYKszq5DlJ73wpFuOTEsC/ryOOxt2F901D/07tec= @@ -1332,9 +826,7 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nrdcg/auroradns v1.1.0 h1:KekGh8kmf2MNwqZVVYo/fw/ZONt8QMEmbMFOeljteWo= github.com/nrdcg/auroradns v1.1.0/go.mod h1:O7tViUZbAcnykVnrGkXzIJTHoQCHcgalgAe6X1mzHfk= github.com/nrdcg/desec v0.7.0 h1:iuGhi4pstF3+vJWwt292Oqe2+AsSPKDynQna/eu1fDs= @@ -1360,15 +852,8 @@ github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtb github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -1377,62 +862,27 @@ github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3 github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= -github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.1/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= @@ -1450,37 +900,32 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pires/go-proxyproto v0.6.1 h1:EBupykFmo22SDjv4fQVQd2J9NOoLPmyZA/15ldOGkPw= github.com/pires/go-proxyproto v0.6.1/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= -github.com/pivotal/image-relocation v0.0.0-20191111101224-e94aff6df06c/go.mod h1:/JNbQwGylYm3AQh8q+MBF8e/h0W1Jy20JGTvozuXYTE= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg= github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= @@ -1488,10 +933,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1500,7 +943,6 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1508,26 +950,17 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/qri-io/jsonpointer v0.1.0/go.mod h1:DnJPaYgiKu56EuDp8TU5wFLdZIcAnb/uH9v37ZaMV64= -github.com/qri-io/jsonschema v0.1.1/go.mod h1:QpzJ6gBQ0GYgGmh7mDQ1YsvvhSgE4rYj0k8t5MBOmUY= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs= @@ -1539,7 +972,6 @@ github.com/redis/go-redis/v9 v9.2.1 h1:WlYJg71ODF0dVspZZCpYmoF1+U1Jjk9Rwd7pq6Qml github.com/redis/go-redis/v9 v9.2.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= @@ -1547,13 +979,10 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sacloud/api-client-go v0.2.8 h1:tIY6PZNBX900K66TqEPa4d6UIbedUczfCBnPJkzi8kw= github.com/sacloud/api-client-go v0.2.8/go.mod h1:0CV/kWNYlS1hCNdnk6Wx7Wdg8DPFCnv0zOIzdXjeAeY= @@ -1563,34 +992,27 @@ github.com/sacloud/iaas-api-go v1.11.1 h1:2MsFZ4H1uRdRVx2nVXuERWQ3swoFc3XreIV5hJ github.com/sacloud/iaas-api-go v1.11.1/go.mod h1:uBDSa06F/V0OnoR66jGdbH0PVnCJw+NeE9RVbVgMfss= github.com/sacloud/packages-go v0.0.9 h1:GbinkBLC/eirFhHpLjoDW6JV7+95Rnd2d8RWj7Afeks= github.com/sacloud/packages-go v0.0.9/go.mod h1:k+EEUMF2LlncjbNIJNOqLyZ9wjTESPIWIk1OA7x9j2Q= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b h1:jUK33OXuZP/l6babJtnLo1qsGvq6G9so9KMflGAm4YA= -github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b/go.mod h1:8458kAagoME2+LN5//WxE71ysZ3B7r22fdgb7qVmXSY= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 h1:1WuWJu7/e8SqK+uQl7lfk/N/oMZTL2NE/TJsNKRNMc4= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= +github.com/shirou/gopsutil/v3 v3.23.11 h1:i3jP9NjCPUz7FiZKxlMnODZkdSIp2gnzfrvsu9CuWEQ= +github.com/shirou/gopsutil/v3 v3.23.11/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/simplesurance/bunny-go v0.0.0-20221115111006-e11d9dc91f04 h1:ZTzdx88+AcnjqUfJwnz89UBrMSBQ1NEysg9u5d+dU9c= github.com/simplesurance/bunny-go v0.0.0-20221115111006-e11d9dc91f04/go.mod h1:5KS21fpch8TIMyAUv/qQqTa3GZfBDYgjaZbd2KXKYfg= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -1600,7 +1022,6 @@ github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHei github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 h1:hp2CYQUINdZMHdvTdXtPOY2ainKl4IoMcpAXEf2xj3Q= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/gunit v1.0.4 h1:tpTjnuH7MLlqhoD21vRoMZbMIi5GmBsAJDFyF67GhZA= github.com/smartystreets/gunit v1.0.4/go.mod h1:EH5qMBab2UclzXUcpR8b93eHsIlp9u+pDQIRp5DZNzQ= @@ -1612,56 +1033,31 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spiffe/go-spiffe/v2 v2.1.1 h1:RT9kM8MZLZIsPTH+HKQEP5yaAk3yd/VBzlINaRjXs8k= github.com/spiffe/go-spiffe/v2 v2.1.1/go.mod h1:5qg6rpqlwIub0JAiF1UK9IMD6BpPTmvG6yfSgDBs5lg= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1677,36 +1073,31 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stvp/go-udp-testing v0.0.0-20191102171040-06b61409b154 h1:XGopsea1Dw7ecQ8JscCNQXDGYAKDiWjDeXnpN/+BY9g= github.com/stvp/go-udp-testing v0.0.0-20191102171040-06b61409b154/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tailscale/tscert v0.0.0-20220316030059-54bbcb9f74e2 h1:xwMw7LFhV9dbvot9A7NLClP9udqbjrQlIwWMH8e7uiQ= github.com/tailscale/tscert v0.0.0-20220316030059-54bbcb9f74e2/go.mod h1:hL4gB6APAasMR2NNi/JHzqKkxW3EPQlFgLEq9PMi2t0= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.490 h1:mmz27tVi2r70JYnm5y0Zk8w0Qzsx+vfUw3oqSyrEfP8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.490/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.490 h1:g9SWTaTy/rEuhMErC2jWq9Qt5ci+jBYSvXnJsLq4adg= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.490/go.mod h1:l9q4vc1QiawUB1m3RU+87yLvrrxe54jc0w/kEl4DbSQ= +github.com/testcontainers/testcontainers-go v0.27.0 h1:IeIrJN4twonTDuMuBNQdKZ+K97yd7VrmNGu+lDpYcDk= +github.com/testcontainers/testcontainers-go v0.27.0/go.mod h1:+HgYZcd17GshBUZv9b+jKFJ198heWPQq3KQIp2+N+7U= github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0= github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= -github.com/theupdateframework/notary v0.6.1 h1:7wshjstgS9x9F5LuB1L5mBI2xNMObWqjz+cjWoom6l0= -github.com/theupdateframework/notary v0.6.1/go.mod h1:MOfgIfmox8s7/7fduvB2xyPPMJCrjRLRizA8OFwpnKY= github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85 h1:014iQD8i8EabPWK2XgUuOTxg5s2nhfDmq6GupskfUO8= -github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= -github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0= -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/grpc-web v0.16.0 h1:eeUWZaFg6ZU0I9dWOYE2D5qkNzRBmXzzuRlxdltascY= github.com/traefik/grpc-web v0.16.0/go.mod h1:2ttniSv7pTgBWIU2HZLokxRfFX3SA60c/DTmQQgVml4= github.com/traefik/paerser v0.2.0 h1:zqCLGSXoNlcBd+mzqSCLjon/I6phqIjeJL2xFB2ysgQ= @@ -1716,115 +1107,68 @@ github.com/traefik/yaegi v0.15.1/go.mod h1:AVRxhaI2G+nUsaM1zyktzwXn69G3t/AuTDrCi github.com/transip/gotransip/v6 v6.20.0 h1:AuvwyOZ51f2brzMbTqlRy/wmaM3kF7Vx5Wds8xcDflY= github.com/transip/gotransip/v6 v6.20.0/go.mod h1:nzv9eN2tdsUrm5nG5ZX6AugYIU4qgsMwIn2c0EZLk8c= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.6 h1:tGiWC9HENWE2tqYycIqFTNorMmFRVhNwCpDOpWqnk8E= github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ultradns/ultradns-go-sdk v1.5.0-20230427130837-23c9b0c h1:mKnW6IGLw7uXu6DL6RitufZWcXS6hCnauXRUFof7rKM= github.com/ultradns/ultradns-go-sdk v1.5.0-20230427130837-23c9b0c/go.mod h1:F4UyVEmq4/m5lAmx+GccrxyRCXmnBjzUL09JLTQFp94= github.com/unrolled/render v1.0.2 h1:dGS3EmChQP3yOi1YeFNO/Dx+MbWZhdvhQJTXochM5bs= github.com/unrolled/render v1.0.2/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM= github.com/unrolled/secure v1.0.9 h1:BWRuEb1vDrBFFDdbCnKkof3gZ35I/bnHGyt0LB0TNyQ= github.com/unrolled/secure v1.0.9/go.mod h1:fO+mEan+FLB0CdEnHf6Q4ZZVNqG+5fuLFnP8p0BXDPI= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vdemeester/shakers v0.1.0 h1:K+n9sSyUCg2ywmZkv+3c7vsYZfivcfKhMh8kRxCrONM= -github.com/vdemeester/shakers v0.1.0/go.mod h1:IZ1HHynUOQt32iQ3rvAeVddXLd19h/6LWiKsh9RZtAQ= github.com/vinyldns/go-vinyldns v0.9.16 h1:GZJStDkcCk1F1AcRc64LuuMh+ENL8pHA0CVd4ulRMcQ= github.com/vinyldns/go-vinyldns v0.9.16/go.mod h1:5qIJOdmzAnatKjurI+Tl4uTus7GJKJxb+zitufjHs3Q= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vulcand/oxy/v2 v2.0.0-20230427132221-be5cf38f3c1c h1:Qt/YKpE8uAKNF4x2mwBZxmVo2WtgUL1WFDeXr1nlfpA= github.com/vulcand/oxy/v2 v2.0.0-20230427132221-be5cf38f3c1c/go.mod h1:A2voDnpONyqdplUDK0lt5y4XHLiBXPBw7iQES8+ZWRw= github.com/vulcand/predicate v1.2.0 h1:uFsW1gcnnR7R+QTID+FVcs0sSYlIGntoGOTb3rQJt50= github.com/vulcand/predicate v1.2.0/go.mod h1:VipoNYXny6c8N381zGUWkjuuNHiRbeAZhE7Qm9c+2GA= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= -github.com/weppos/publicsuffix-go v0.4.0/go.mod h1:z3LCPQ38eedDQSwmsSRW4Y7t2L8Ln16JPQ02lHAdn5k= -github.com/weppos/publicsuffix-go v0.5.0 h1:rutRtjBJViU/YjcI5d80t4JAVvDltS6bciJg2K1HrLU= -github.com/weppos/publicsuffix-go v0.5.0/go.mod h1:z3LCPQ38eedDQSwmsSRW4Y7t2L8Ln16JPQ02lHAdn5k= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yandex-cloud/go-genproto v0.0.0-20220805142335-27b56ddae16f h1:cG+ehPRJSlqljSufLf1KXeXpUd1dLNjnzA18mZcB/O0= github.com/yandex-cloud/go-genproto v0.0.0-20220805142335-27b56ddae16f/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= github.com/yandex-cloud/go-sdk v0.0.0-20220805164847-cf028e604997 h1:2wzke3JH7OtN20WsNDZx2VH/TCmsbqtDEbXzjF+i05E= github.com/yandex-cloud/go-sdk v0.0.0-20220805164847-cf028e604997/go.mod h1:2CHKs/YGbCcNn/BPaCkEBwKz/FNCELi+MLILjR9RaTA= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= -github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zeebo/errs v1.2.2 h1:5NFypMTuSdoySVTqlNs1dEoU21QVamMQJxW/Fii5O7g= github.com/zeebo/errs v1.2.2/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= -github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= -github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521/go.mod h1:3YZ9o3WnatTIZhuOtot4IcUfzoKVjUHqu6WALIyI0nE= -github.com/zmap/zcertificate v0.0.0-20180516150559-0e3d58b1bac4/go.mod h1:5iU54tB79AMBcySS0R2XIyZBAVmeHranShAFELYx7is= -github.com/zmap/zcrypto v0.0.0-20190729165852-9051775e6a2e h1:mvOa4+/DXStR4ZXOks/UsjeFdn5O5JpLUtzqk9U8xXw= -github.com/zmap/zcrypto v0.0.0-20190729165852-9051775e6a2e/go.mod h1:w7kd3qXHh8FNaczNjslXqvFQiv5mMWRXlL9klTUAHc8= -github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb h1:vxqkjztXSaPVDc8FQCdHTaejm2x747f6yPbnu1h2xkg= -github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb/go.mod h1:29UiAJNsiVdvTBFCJW8e3q6dcDbOoPkhMgttOSCIMMY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE= go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E= go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/collector/pdata v0.66.0 h1:UdE5U6MsDNzuiWaXdjGx2lC3ElVqWmN/hiUE8vyvSuM= @@ -1858,14 +1202,12 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA= @@ -1873,41 +1215,27 @@ go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6m go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= +golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200422194213-44a606286825/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1925,11 +1253,6 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= @@ -1942,31 +1265,21 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1978,44 +1291,21 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= @@ -2029,19 +1319,10 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2050,15 +1331,12 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2067,98 +1345,48 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2181,19 +1409,19 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -2210,7 +1438,6 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= @@ -2219,8 +1446,6 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -2232,58 +1457,23 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191014205221-18e3458ac98b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210114065538-d78b04bdf963/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= @@ -2297,31 +1487,12 @@ gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.128.0 h1:RjPESny5CnQRn9V6siglged+DZCgfu9l6mO9dkX9VOg= google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -2329,61 +1500,21 @@ google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY= google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= @@ -2391,7 +1522,6 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1: google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -2401,23 +1531,14 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= @@ -2441,31 +1562,21 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/dancannon/gorethink.v3 v3.0.5 h1:/g7PWP7zUS6vSNmHSDbjCHQh1Rqn8Jy6zSMQxAsBSMQ= -gopkg.in/dancannon/gorethink.v3 v3.0.5/go.mod h1:GXsi1e3N2OcKhcP6nsYABTiUejbWMFO4GY5a4pEaeEc= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fatih/pool.v2 v2.0.0 h1:xIFeWtxifuQJGk/IEPKsTduEKcKvPmhoiVDGpC40nKg= -gopkg.in/fatih/pool.v2 v2.0.0/go.mod h1:8xVGeu1/2jr2wm5V9SPuMht2H5AEmf5aFMGSQixtjTY= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/gorethink/gorethink.v3 v3.0.5 h1:e2Uc/Xe+hpcVQFsj6MuHlYog3r0JYpnTzwDj/y2O4MU= -gopkg.in/gorethink/gorethink.v3 v3.0.5/go.mod h1:+3yIIHJUGMBK+wyPH+iN5TP+88ikFDfZdqTlK3Y9q8I= gopkg.in/h2non/gentleman.v1 v1.0.4/go.mod h1:JYuHVdFzS4MKOXe0o+chKJ4hCe6tqKKw9XH9YP6WFrg= gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/h2non/gock.v1 v1.0.16 h1:F11k+OafeuFENsjei5t2vMTSTs9L62AdyTe4E1cgdG8= gopkg.in/h2non/gock.v1 v1.0.16/go.mod h1:XVuDAssexPLwgxCLMvDTWNU5eqklsydR6I5phZ9oPB8= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -2474,12 +1585,9 @@ gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/ns1/ns1-go.v2 v2.7.6 h1:mCPl7q0jbIGACXvGBljAuuApmKZo3rRi4tlRIEbMvjA= gopkg.in/ns1/ns1-go.v2 v2.7.6/go.mod h1:GMnKY+ZuoJ+lVLL+78uSTjwTz2jMazq6AfGKQOYhsPk= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -2500,103 +1608,42 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20191016110408-35e52d86657a/go.mod h1:/L5qH+AD540e7Cetbui1tuJeXdmNhO8jM6VkXeDdDhQ= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= -k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190806215851-162a2dabc72f/go.mod h1:+ntn62igV2hyNj7/0brOvXSMONE2KxcePkSxK7/9FFQ= -k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8/go.mod h1:llRdnznGEAqC3DcNm6yEj472xaFVfLM7hnYofMb12tQ= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v0.0.0-20191016111102-bec269661e48/go.mod h1:hrwktSwYGI4JK+TJA3dMaFyyvHVi/aLarVHpbs8bgCU= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4= k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs= sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/integration/access_log_test.go b/integration/access_log_test.go index 614bad8bd..8e2c9581f 100644 --- a/integration/access_log_test.go +++ b/integration/access_log_test.go @@ -11,13 +11,15 @@ import ( "os" "strconv" "strings" + "testing" "time" - "github.com/go-check/check" "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/middlewares/accesslog" - checker "github.com/vdemeester/shakers" ) const ( @@ -28,6 +30,10 @@ const ( // AccessLogSuite tests suite. type AccessLogSuite struct{ BaseSuite } +func TestAccessLogSuite(t *testing.T) { + suite.Run(t, new(AccessLogSuite)) +} + type accessLogValue struct { formatOnly bool code string @@ -36,67 +42,67 @@ type accessLogValue struct { serviceURL string } -func (s *AccessLogSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "access_log") - s.composeUp(c) +func (s *AccessLogSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + s.createComposeProject("access_log") + s.composeUp() } -func (s *AccessLogSuite) TearDownTest(c *check.C) { - displayTraefikLogFile(c, traefikTestLogFile) +func (s *AccessLogSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *AccessLogSuite) TearDownTest() { + s.displayTraefikLogFile(traefikTestLogFile) _ = os.Remove(traefikTestAccessLogFile) } -func (s *AccessLogSuite) TestAccessLog(c *check.C) { +func (s *AccessLogSuite) TestAccessLog() { ensureWorkingDirectoryIsClean() // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) defer func() { traefikLog, err := os.ReadFile(traefikTestLogFile) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) log.Info().Msg(string(traefikLog)) }() - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.waitForTraefik("server1") - waitForTraefik(c, "server1") - - checkStatsForLogFile(c) + s.checkStatsForLogFile() // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Make some requests req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "frontend1.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "frontend2.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogOutput(c) + count := s.checkAccessLogOutput() - c.Assert(count, checker.GreaterOrEqualThan, 3) + assert.Equal(s.T(), 3, count) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogAuthFrontend(c *check.C) { +func (s *AccessLogSuite) TestAccessLogAuthFrontend() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -124,48 +130,43 @@ func (s *AccessLogSuite) TestAccessLogAuthFrontend(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "authFrontend") + s.waitForTraefik("authFrontend") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test auth entrypoint req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8006/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "frontend.auth.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.SetBasicAuth("test", "") err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.SetBasicAuth("test", "test") err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogDigestAuthMiddleware(c *check.C) { +func (s *AccessLogSuite) TestAccessLogDigestAuthMiddleware() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -193,27 +194,22 @@ func (s *AccessLogSuite) TestAccessLogDigestAuthMiddleware(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "digestAuthMiddleware") + s.waitForTraefik("digestAuthMiddleware") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test auth entrypoint req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8008/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "entrypoint.digest.auth.docker.local" resp, err := try.ResponseUntilStatusCode(req, 500*time.Millisecond, http.StatusUnauthorized) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) digest := digestParts(resp) digest["uri"] = "/" @@ -225,22 +221,22 @@ func (s *AccessLogSuite) TestAccessLogDigestAuthMiddleware(c *check.C) { req.Header.Set("Content-Type", "application/json") err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) digest["password"] = "test" req.Header.Set("Authorization", getDigestAuthorization(digest)) err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } // Thanks to mvndaai for digest authentication @@ -291,7 +287,7 @@ func getDigestAuthorization(digestParts map[string]string) string { return authorization } -func (s *AccessLogSuite) TestAccessLogFrontendRedirect(c *check.C) { +func (s *AccessLogSuite) TestAccessLogFrontendRedirect() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -308,38 +304,33 @@ func (s *AccessLogSuite) TestAccessLogFrontendRedirect(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "frontendRedirect") + s.waitForTraefik("frontendRedirect") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test frontend redirect req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8005/test", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogJSONFrontendRedirect(c *check.C) { +func (s *AccessLogSuite) TestAccessLogJSONFrontendRedirect() { ensureWorkingDirectoryIsClean() type logLine struct { @@ -365,30 +356,25 @@ func (s *AccessLogSuite) TestAccessLogJSONFrontendRedirect(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_json_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_json_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "frontendRedirect") + s.waitForTraefik("frontendRedirect") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test frontend redirect req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8005/test", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - lines := extractLines(c) - c.Assert(len(lines), checker.GreaterOrEqualThan, len(expected)) + lines := s.extractLines() + assert.GreaterOrEqual(s.T(), len(lines), len(expected)) for i, line := range lines { if line == "" { @@ -396,15 +382,15 @@ func (s *AccessLogSuite) TestAccessLogJSONFrontendRedirect(c *check.C) { } var logline logLine err := json.Unmarshal([]byte(line), &logline) - c.Assert(err, checker.IsNil) - c.Assert(logline.DownstreamStatus, checker.Equals, expected[i].DownstreamStatus) - c.Assert(logline.OriginStatus, checker.Equals, expected[i].OriginStatus) - c.Assert(logline.RouterName, checker.Equals, expected[i].RouterName) - c.Assert(logline.ServiceName, checker.Equals, expected[i].ServiceName) + require.NoError(s.T(), err) + assert.Equal(s.T(), expected[i].DownstreamStatus, logline.DownstreamStatus) + assert.Equal(s.T(), expected[i].OriginStatus, logline.OriginStatus) + assert.Equal(s.T(), expected[i].RouterName, logline.RouterName) + assert.Equal(s.T(), expected[i].ServiceName, logline.ServiceName) } } -func (s *AccessLogSuite) TestAccessLogRateLimit(c *check.C) { +func (s *AccessLogSuite) TestAccessLogRateLimit() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -424,42 +410,37 @@ func (s *AccessLogSuite) TestAccessLogRateLimit(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "rateLimit") + s.waitForTraefik("rateLimit") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test rate limit req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8007/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "ratelimit.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusTooManyRequests), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogBackendNotFound(c *check.C) { +func (s *AccessLogSuite) TestAccessLogBackendNotFound() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -473,38 +454,33 @@ func (s *AccessLogSuite) TestAccessLogBackendNotFound(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.waitForTraefik("server1") - waitForTraefik(c, "server1") - - checkStatsForLogFile(c) + s.checkStatsForLogFile() // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test rate limit req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "backendnotfound.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogFrontendAllowlist(c *check.C) { +func (s *AccessLogSuite) TestAccessLogFrontendAllowlist() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -518,38 +494,33 @@ func (s *AccessLogSuite) TestAccessLogFrontendAllowlist(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "frontendAllowlist") + s.waitForTraefik("frontendAllowlist") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test rate limit req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "frontend.allowlist.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusForbidden), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogAuthFrontendSuccess(c *check.C) { +func (s *AccessLogSuite) TestAccessLogAuthFrontendSuccess() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -563,39 +534,34 @@ func (s *AccessLogSuite) TestAccessLogAuthFrontendSuccess(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "authFrontend") + s.waitForTraefik("authFrontend") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test auth entrypoint req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8006/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "frontend.auth.docker.local" req.SetBasicAuth("test", "test") err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func (s *AccessLogSuite) TestAccessLogPreflightHeadersMiddleware(c *check.C) { +func (s *AccessLogSuite) TestAccessLogPreflightHeadersMiddleware() { ensureWorkingDirectoryIsClean() expected := []accessLogValue{ @@ -609,79 +575,74 @@ func (s *AccessLogSuite) TestAccessLogPreflightHeadersMiddleware(c *check.C) { } // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) + s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.checkStatsForLogFile() - checkStatsForLogFile(c) - - waitForTraefik(c, "preflightCORS") + s.waitForTraefik("preflightCORS") // Verify Traefik started OK - checkTraefikStarted(c) + s.checkTraefikStarted() // Test preflight response req, err := http.NewRequest(http.MethodOptions, "http://127.0.0.1:8009/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "preflight.docker.local" req.Header.Set("Origin", "whatever") req.Header.Set("Access-Control-Request-Method", "GET") err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log output as expected - count := checkAccessLogExactValuesOutput(c, expected) + count := s.checkAccessLogExactValuesOutput(expected) - c.Assert(count, checker.GreaterOrEqualThan, len(expected)) + assert.GreaterOrEqual(s.T(), count, len(expected)) // Verify no other Traefik problems - checkNoOtherTraefikProblems(c) + s.checkNoOtherTraefikProblems() } -func checkNoOtherTraefikProblems(c *check.C) { +func (s *AccessLogSuite) checkNoOtherTraefikProblems() { traefikLog, err := os.ReadFile(traefikTestLogFile) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if len(traefikLog) > 0 { fmt.Printf("%s\n", string(traefikLog)) } } -func checkAccessLogOutput(c *check.C) int { - lines := extractLines(c) +func (s *AccessLogSuite) checkAccessLogOutput() int { + lines := s.extractLines() count := 0 for i, line := range lines { if len(line) > 0 { count++ - CheckAccessLogFormat(c, line, i) + s.CheckAccessLogFormat(line, i) } } return count } -func checkAccessLogExactValuesOutput(c *check.C, values []accessLogValue) int { - lines := extractLines(c) +func (s *AccessLogSuite) checkAccessLogExactValuesOutput(values []accessLogValue) int { + lines := s.extractLines() count := 0 for i, line := range lines { fmt.Println(line) if len(line) > 0 { count++ if values[i].formatOnly { - CheckAccessLogFormat(c, line, i) + s.CheckAccessLogFormat(line, i) } else { - checkAccessLogExactValues(c, line, i, values[i]) + s.checkAccessLogExactValues(line, i, values[i]) } } } return count } -func extractLines(c *check.C) []string { +func (s *AccessLogSuite) extractLines() []string { accessLog, err := os.ReadFile(traefikTestAccessLogFile) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) lines := strings.Split(string(accessLog), "\n") @@ -694,14 +655,14 @@ func extractLines(c *check.C) []string { return clean } -func checkStatsForLogFile(c *check.C) { +func (s *AccessLogSuite) checkStatsForLogFile() { err := try.Do(1*time.Second, func() error { if _, errStat := os.Stat(traefikTestLogFile); errStat != nil { return fmt.Errorf("could not get stats for log file: %w", errStat) } return nil }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } func ensureWorkingDirectoryIsClean() { @@ -709,69 +670,38 @@ func ensureWorkingDirectoryIsClean() { os.Remove(traefikTestLogFile) } -func checkTraefikStarted(c *check.C) []byte { +func (s *AccessLogSuite) checkTraefikStarted() []byte { traefikLog, err := os.ReadFile(traefikTestLogFile) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if len(traefikLog) > 0 { fmt.Printf("%s\n", string(traefikLog)) } return traefikLog } -func CheckAccessLogFormat(c *check.C, line string, i int) { +func (s *BaseSuite) CheckAccessLogFormat(line string, i int) { results, err := accesslog.ParseAccessLog(line) - c.Assert(err, checker.IsNil) - c.Assert(results, checker.HasLen, 14) - c.Assert(results[accesslog.OriginStatus], checker.Matches, `^(-|\d{3})$`) + require.NoError(s.T(), err) + assert.Len(s.T(), results, 14) + assert.Regexp(s.T(), `^(-|\d{3})$`, results[accesslog.OriginStatus]) count, _ := strconv.Atoi(results[accesslog.RequestCount]) - c.Assert(count, checker.GreaterOrEqualThan, i+1) - c.Assert(results[accesslog.RouterName], checker.Matches, `"(rt-.+@docker|api@internal)"`) - c.Assert(results[accesslog.ServiceURL], checker.HasPrefix, `"http://`) - c.Assert(results[accesslog.Duration], checker.Matches, `^\d+ms$`) + assert.GreaterOrEqual(s.T(), count, i+1) + assert.Regexp(s.T(), `"(rt-.+@docker|api@internal)"`, results[accesslog.RouterName]) + assert.True(s.T(), strings.HasPrefix(results[accesslog.ServiceURL], `"http://`)) + assert.Regexp(s.T(), `^\d+ms$`, results[accesslog.Duration]) } -func checkAccessLogExactValues(c *check.C, line string, i int, v accessLogValue) { +func (s *AccessLogSuite) checkAccessLogExactValues(line string, i int, v accessLogValue) { results, err := accesslog.ParseAccessLog(line) - c.Assert(err, checker.IsNil) - c.Assert(results, checker.HasLen, 14) + require.NoError(s.T(), err) + assert.Len(s.T(), results, 14) if len(v.user) > 0 { - c.Assert(results[accesslog.ClientUsername], checker.Equals, v.user) + assert.Equal(s.T(), v.user, results[accesslog.ClientUsername]) } - c.Assert(results[accesslog.OriginStatus], checker.Equals, v.code) + assert.Equal(s.T(), v.code, results[accesslog.OriginStatus]) count, _ := strconv.Atoi(results[accesslog.RequestCount]) - c.Assert(count, checker.GreaterOrEqualThan, i+1) - c.Assert(results[accesslog.RouterName], checker.Matches, `^"?`+v.routerName+`.*(@docker)?$`) - c.Assert(results[accesslog.ServiceURL], checker.Matches, `^"?`+v.serviceURL+`.*$`) - c.Assert(results[accesslog.Duration], checker.Matches, `^\d+ms$`) -} - -func waitForTraefik(c *check.C, containerName string) { - time.Sleep(1 * time.Second) - - // Wait for Traefik to turn ready. - req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/api/rawdata", nil) - c.Assert(err, checker.IsNil) - - err = try.Request(req, 2*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains(containerName)) - c.Assert(err, checker.IsNil) -} - -func displayTraefikLogFile(c *check.C, path string) { - if c.Failed() { - if _, err := os.Stat(path); !os.IsNotExist(err) { - content, errRead := os.ReadFile(path) - fmt.Printf("%s: Traefik logs: \n", c.TestName()) - if errRead == nil { - fmt.Println(content) - } else { - fmt.Println(errRead) - } - } else { - fmt.Printf("%s: No Traefik logs.\n", c.TestName()) - } - errRemove := os.Remove(path) - if errRemove != nil { - fmt.Println(errRemove) - } - } + assert.GreaterOrEqual(s.T(), count, i+1) + assert.Regexp(s.T(), `^"?`+v.routerName+`.*(@docker)?$`, results[accesslog.RouterName]) + assert.Regexp(s.T(), `^"?`+v.serviceURL+`.*$`, results[accesslog.ServiceURL]) + assert.Regexp(s.T(), `^\d+ms$`, results[accesslog.Duration]) } diff --git a/integration/acme_test.go b/integration/acme_test.go index fe5fc413b..c6c92e24b 100644 --- a/integration/acme_test.go +++ b/integration/acme_test.go @@ -8,16 +8,19 @@ import ( "net/http" "os" "path/filepath" + "testing" "time" - "github.com/go-check/check" "github.com/miekg/dns" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/config/static" "github.com/traefik/traefik/v3/pkg/provider/acme" "github.com/traefik/traefik/v3/pkg/testhelpers" "github.com/traefik/traefik/v3/pkg/types" - checker "github.com/vdemeester/shakers" ) // ACME test suites. @@ -27,6 +30,10 @@ type AcmeSuite struct { fakeDNSServer *dns.Server } +func TestAcmeSuite(t *testing.T) { + suite.Run(t, new(AcmeSuite)) +} + type subCases struct { host string expectedCommonName string @@ -87,17 +94,18 @@ func setupPebbleRootCA() (*http.Transport, error) { }, nil } -func (s *AcmeSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "pebble") - s.composeUp(c) +func (s *AcmeSuite) SetupSuite() { + s.BaseSuite.SetupSuite() - s.fakeDNSServer = startFakeDNSServer(s.getContainerIP(c, "traefik")) - s.pebbleIP = s.getComposeServiceIP(c, "pebble") + s.createComposeProject("pebble") + s.composeUp() + + // Retrieving the Docker host ip. + s.fakeDNSServer = startFakeDNSServer(s.hostIP) + s.pebbleIP = s.getComposeServiceIP("pebble") pebbleTransport, err := setupPebbleRootCA() - if err != nil { - c.Fatal(err) - } + require.NoError(s.T(), err) // wait for pebble req := testhelpers.MustNewRequest(http.MethodGet, s.getAcmeURL(), nil) @@ -113,21 +121,24 @@ func (s *AcmeSuite) SetUpSuite(c *check.C) { } return try.StatusCodeIs(http.StatusOK)(resp) }) - c.Assert(err, checker.IsNil) + + require.NoError(s.T(), err) } -func (s *AcmeSuite) TearDownSuite(c *check.C) { +func (s *AcmeSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() + if s.fakeDNSServer != nil { err := s.fakeDNSServer.Shutdown() if err != nil { - c.Log(err) + log.Info().Msg(err.Error()) } } - s.composeDown(c) + s.composeDown() } -func (s *AcmeSuite) TestHTTP01Domains(c *check.C) { +func (s *AcmeSuite) TestHTTP01Domains() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_domains.toml", subCases: []subCases{{ @@ -147,10 +158,10 @@ func (s *AcmeSuite) TestHTTP01Domains(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01StoreDomains(c *check.C) { +func (s *AcmeSuite) TestHTTP01StoreDomains() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_store_domains.toml", subCases: []subCases{{ @@ -170,10 +181,10 @@ func (s *AcmeSuite) TestHTTP01StoreDomains(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01DomainsInSAN(c *check.C) { +func (s *AcmeSuite) TestHTTP01DomainsInSAN() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_domains.toml", subCases: []subCases{{ @@ -194,10 +205,10 @@ func (s *AcmeSuite) TestHTTP01DomainsInSAN(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01OnHostRule(c *check.C) { +func (s *AcmeSuite) TestHTTP01OnHostRule() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_base.toml", subCases: []subCases{{ @@ -214,10 +225,10 @@ func (s *AcmeSuite) TestHTTP01OnHostRule(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestMultipleResolver(c *check.C) { +func (s *AcmeSuite) TestMultipleResolver() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_multiple_resolvers.toml", subCases: []subCases{ @@ -245,10 +256,10 @@ func (s *AcmeSuite) TestMultipleResolver(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01OnHostRuleECDSA(c *check.C) { +func (s *AcmeSuite) TestHTTP01OnHostRuleECDSA() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_base.toml", subCases: []subCases{{ @@ -266,10 +277,10 @@ func (s *AcmeSuite) TestHTTP01OnHostRuleECDSA(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01OnHostRuleInvalidAlgo(c *check.C) { +func (s *AcmeSuite) TestHTTP01OnHostRuleInvalidAlgo() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_base.toml", subCases: []subCases{{ @@ -287,10 +298,10 @@ func (s *AcmeSuite) TestHTTP01OnHostRuleInvalidAlgo(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01OnHostRuleDefaultDynamicCertificatesWithWildcard(c *check.C) { +func (s *AcmeSuite) TestHTTP01OnHostRuleDefaultDynamicCertificatesWithWildcard() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_tls.toml", subCases: []subCases{{ @@ -307,10 +318,10 @@ func (s *AcmeSuite) TestHTTP01OnHostRuleDefaultDynamicCertificatesWithWildcard(c }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestHTTP01OnHostRuleDynamicCertificatesWithWildcard(c *check.C) { +func (s *AcmeSuite) TestHTTP01OnHostRuleDynamicCertificatesWithWildcard() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_tls_dynamic.toml", subCases: []subCases{{ @@ -327,10 +338,10 @@ func (s *AcmeSuite) TestHTTP01OnHostRuleDynamicCertificatesWithWildcard(c *check }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestTLSALPN01OnHostRuleTCP(c *check.C) { +func (s *AcmeSuite) TestTLSALPN01OnHostRuleTCP() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_tcp.toml", subCases: []subCases{{ @@ -347,10 +358,10 @@ func (s *AcmeSuite) TestTLSALPN01OnHostRuleTCP(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestTLSALPN01OnHostRule(c *check.C) { +func (s *AcmeSuite) TestTLSALPN01OnHostRule() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_base.toml", subCases: []subCases{{ @@ -367,10 +378,10 @@ func (s *AcmeSuite) TestTLSALPN01OnHostRule(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestTLSALPN01Domains(c *check.C) { +func (s *AcmeSuite) TestTLSALPN01Domains() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_domains.toml", subCases: []subCases{{ @@ -390,10 +401,10 @@ func (s *AcmeSuite) TestTLSALPN01Domains(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } -func (s *AcmeSuite) TestTLSALPN01DomainsInSAN(c *check.C) { +func (s *AcmeSuite) TestTLSALPN01DomainsInSAN() { testCase := acmeTestCase{ traefikConfFilePath: "fixtures/acme/acme_domains.toml", subCases: []subCases{{ @@ -414,12 +425,12 @@ func (s *AcmeSuite) TestTLSALPN01DomainsInSAN(c *check.C) { }, } - s.retrieveAcmeCertificate(c, testCase) + s.retrieveAcmeCertificate(testCase) } // Test Let's encrypt down. -func (s *AcmeSuite) TestNoValidLetsEncryptServer(c *check.C) { - file := s.adaptFile(c, "fixtures/acme/acme_base.toml", templateModel{ +func (s *AcmeSuite) TestNoValidLetsEncryptServer() { + file := s.adaptFile("fixtures/acme/acme_base.toml", templateModel{ Acme: map[string]static.CertificateResolver{ "default": {ACME: &acme.Configuration{ CAServer: "http://wrongurl:4001/directory", @@ -427,21 +438,16 @@ func (s *AcmeSuite) TestNoValidLetsEncryptServer(c *check.C) { }}, }, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // Expected traefik works - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) } // Doing an HTTPS request and test the response certificate. -func (s *AcmeSuite) retrieveAcmeCertificate(c *check.C, testCase acmeTestCase) { +func (s *AcmeSuite) retrieveAcmeCertificate(testCase acmeTestCase) { if len(testCase.template.PortHTTP) == 0 { testCase.template.PortHTTP = ":5002" } @@ -456,14 +462,10 @@ func (s *AcmeSuite) retrieveAcmeCertificate(c *check.C, testCase acmeTestCase) { } } - file := s.adaptFile(c, testCase.traefikConfFilePath, testCase.template) - defer os.Remove(file) + file := s.adaptFile(testCase.traefikConfFilePath, testCase.template) + + s.traefikCmd(withConfigFile(file)) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) // A real file is needed to have the right mode on acme.json file defer os.Remove("/tmp/acme.json") @@ -477,11 +479,11 @@ func (s *AcmeSuite) retrieveAcmeCertificate(c *check.C, testCase acmeTestCase) { } // wait for traefik (generating acme account take some seconds) - err = try.Do(60*time.Second, func() error { + err := try.Do(60*time.Second, func() error { _, errGet := client.Get("https://127.0.0.1:5001") return errGet }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) for _, sub := range testCase.subCases { client = &http.Client{ @@ -503,7 +505,7 @@ func (s *AcmeSuite) retrieveAcmeCertificate(c *check.C, testCase acmeTestCase) { var resp *http.Response // Retry to send a Request which uses the LE generated certificate - err = try.Do(60*time.Second, func() error { + err := try.Do(60*time.Second, func() error { resp, err = client.Do(req) if err != nil { return err @@ -517,10 +519,10 @@ func (s *AcmeSuite) retrieveAcmeCertificate(c *check.C, testCase acmeTestCase) { return nil }) - c.Assert(err, checker.IsNil) - c.Assert(resp.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, resp.StatusCode) // Check Domain into response certificate - c.Assert(resp.TLS.PeerCertificates[0].Subject.CommonName, checker.Equals, sub.expectedCommonName) - c.Assert(resp.TLS.PeerCertificates[0].PublicKeyAlgorithm, checker.Equals, sub.expectedAlgorithm) + assert.Equal(s.T(), sub.expectedCommonName, resp.TLS.PeerCertificates[0].Subject.CommonName) + assert.Equal(s.T(), sub.expectedAlgorithm, resp.TLS.PeerCertificates[0].PublicKeyAlgorithm) } } diff --git a/integration/conf_throttling_test.go b/integration/conf_throttling_test.go index 3a7b89baa..297bb56fd 100644 --- a/integration/conf_throttling_test.go +++ b/integration/conf_throttling_test.go @@ -8,36 +8,38 @@ import ( "net/http" "regexp" "strconv" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/config/dynamic" - checker "github.com/vdemeester/shakers" ) type ThrottlingSuite struct{ BaseSuite } -func (s *ThrottlingSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "rest") - s.composeUp(c) +func TestThrottlingSuite(t *testing.T) { + suite.Run(t, new(ThrottlingSuite)) } -func (s *ThrottlingSuite) TestThrottleConfReload(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/throttling/simple.toml")) +func (s *ThrottlingSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + s.createComposeProject("rest") + s.composeUp() +} - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *ThrottlingSuite) TestThrottleConfReload() { + s.traefikCmd(withConfigFile("fixtures/throttling/simple.toml")) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("rest@internal")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("rest@internal")) + require.NoError(s.T(), err) // Expected a 404 as we did not configure anything. err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) config := &dynamic.Configuration{ HTTP: &dynamic.HTTPConfiguration{ @@ -47,7 +49,7 @@ func (s *ThrottlingSuite) TestThrottleConfReload(c *check.C) { LoadBalancer: &dynamic.ServersLoadBalancer{ Servers: []dynamic.Server{ { - URL: "http://" + s.getComposeServiceIP(c, "whoami1") + ":80", + URL: "http://" + s.getComposeServiceIP("whoami1") + ":80", }, }, }, @@ -68,28 +70,28 @@ func (s *ThrottlingSuite) TestThrottleConfReload(c *check.C) { for i := 0; i < confChanges; i++ { config.HTTP.Routers[fmt.Sprintf("routerHTTP%d", i)] = router data, err := json.Marshal(config) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodPut, "http://127.0.0.1:8080/api/providers/rest", bytes.NewReader(data)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) time.Sleep(200 * time.Millisecond) } reloadsRegexp := regexp.MustCompile(`traefik_config_reloads_total (\d*)\n`) resp, err := http.Get("http://127.0.0.1:8080/metrics") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) defer resp.Body.Close() body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) fields := reloadsRegexp.FindStringSubmatch(string(body)) - c.Assert(len(fields), checker.Equals, 2) + assert.Len(s.T(), fields, 2) reloads, err := strconv.Atoi(fields[1]) if err != nil { @@ -101,5 +103,5 @@ func (s *ThrottlingSuite) TestThrottleConfReload(c *check.C) { // Therefore the throttling (set at 400ms for this test) should only let // (2s / 400 ms =) 5 config reloads happen in theory. // In addition, we have to take into account the extra config reload from the internal provider (5 + 1). - c.Assert(reloads, checker.LessOrEqualThan, 6) + assert.LessOrEqual(s.T(), reloads, 6) } diff --git a/integration/consul_catalog_test.go b/integration/consul_catalog_test.go index bf0db5da1..95f0ab713 100644 --- a/integration/consul_catalog_test.go +++ b/integration/consul_catalog_test.go @@ -4,13 +4,14 @@ import ( "fmt" "net" "net/http" - "os" + "testing" "time" - "github.com/go-check/check" "github.com/hashicorp/consul/api" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type ConsulCatalogSuite struct { @@ -20,26 +21,36 @@ type ConsulCatalogSuite struct { consulURL string } -func (s *ConsulCatalogSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "consul_catalog") - s.composeUp(c) +func TestConsulCatalogSuite(t *testing.T) { + suite.Run(t, new(ConsulCatalogSuite)) +} - s.consulURL = "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "consul"), "8500") +func (s *ConsulCatalogSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("consul_catalog") + s.composeUp() + + s.consulURL = "http://" + net.JoinHostPort(s.getComposeServiceIP("consul"), "8500") var err error s.consulClient, err = api.NewClient(&api.Config{ Address: s.consulURL, }) - c.Check(err, check.IsNil) + require.NoError(s.T(), err) // Wait for consul to elect itself leader err = s.waitToElectConsulLeader() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) s.consulAgentClient, err = api.NewClient(&api.Config{ - Address: "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "consul-agent"), "8500"), + Address: "http://" + net.JoinHostPort(s.getComposeServiceIP("consul-agent"), "8500"), }) - c.Check(err, check.IsNil) + require.NoError(s.T(), err) +} + +func (s *ConsulCatalogSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() } func (s *ConsulCatalogSuite) waitToElectConsulLeader() error { @@ -83,36 +94,36 @@ func (s *ConsulCatalogSuite) deregisterService(id string, onAgent bool) error { return client.Agent().ServiceDeregister(id) } -func (s *ConsulCatalogSuite) TestWithNotExposedByDefaultAndDefaultsSettings(c *check.C) { +func (s *ConsulCatalogSuite) TestWithNotExposedByDefaultAndDefaultsSettings() { reg1 := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami", Tags: []string{"traefik.enable=true"}, Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg1, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) reg2 := &api.AgentServiceRegistration{ ID: "whoami2", Name: "whoami", Tags: []string{"traefik.enable=true"}, Port: 80, - Address: s.getComposeServiceIP(c, "whoami2"), + Address: s.getComposeServiceIP("whoami2"), } err = s.registerService(reg2, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) reg3 := &api.AgentServiceRegistration{ ID: "whoami3", Name: "whoami", Tags: []string{"traefik.enable=true"}, Port: 80, - Address: s.getComposeServiceIP(c, "whoami3"), + Address: s.getComposeServiceIP("whoami3"), } err = s.registerService(reg3, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tempObjects := struct { ConsulAddress string @@ -120,23 +131,18 @@ func (s *ConsulCatalogSuite) TestWithNotExposedByDefaultAndDefaultsSettings(c *c ConsulAddress: s.consulURL, } - file := s.adaptFile(c, "fixtures/consul_catalog/default_not_exposed.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/default_not_exposed.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "whoami" err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami1", "Hostname: whoami2", "Hostname: whoami3")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.StatusCodeIs(200), @@ -145,18 +151,18 @@ func (s *ConsulCatalogSuite) TestWithNotExposedByDefaultAndDefaultsSettings(c *c fmt.Sprintf(`"http://%s:80":"UP"`, reg2.Address), fmt.Sprintf(`"http://%s:80":"UP"`, reg3.Address), )) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami2", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami3", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestByLabels(c *check.C) { - containerIP := s.getComposeServiceIP(c, "whoami1") +func (s *ConsulCatalogSuite) TestByLabels() { + containerIP := s.getComposeServiceIP("whoami1") reg := &api.AgentServiceRegistration{ ID: "whoami1", @@ -171,7 +177,7 @@ func (s *ConsulCatalogSuite) TestByLabels(c *check.C) { Address: containerIP, } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tempObjects := struct { ConsulAddress string @@ -179,23 +185,18 @@ func (s *ConsulCatalogSuite) TestByLabels(c *check.C) { ConsulAddress: s.consulURL, } - file := s.adaptFile(c, "fixtures/consul_catalog/default_not_exposed.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/default_not_exposed.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8000/whoami", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContainsOr("Hostname: whoami1", "Hostname: whoami2", "Hostname: whoami3")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestSimpleConfiguration(c *check.C) { +func (s *ConsulCatalogSuite) TestSimpleConfiguration() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -204,37 +205,32 @@ func (s *ConsulCatalogSuite) TestSimpleConfiguration(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) reg := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami", Tags: []string{"traefik.enable=true"}, Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "whoami.consul.localhost" err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami1")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestSimpleConfigurationWithWatch(c *check.C) { +func (s *ConsulCatalogSuite) TestSimpleConfigurationWithWatch() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -243,39 +239,34 @@ func (s *ConsulCatalogSuite) TestSimpleConfigurationWithWatch(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple_watch.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple_watch.toml", tempObjects) reg := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami", Tags: []string{"traefik.enable=true"}, Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "whoami.consul.localhost" err = try.Request(req, 2*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContainsOr("Hostname: whoami1")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - whoamiIP := s.getComposeServiceIP(c, "whoami1") + whoamiIP := s.getComposeServiceIP("whoami1") reg.Check = &api.AgentServiceCheck{ CheckID: "some-ok-check", TCP: whoamiIP + ":80", @@ -285,10 +276,10 @@ func (s *ConsulCatalogSuite) TestSimpleConfigurationWithWatch(c *check.C) { } err = s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - err = try.Request(req, 2*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContainsOr("Hostname: whoami1")) - c.Assert(err, checker.IsNil) + err = try.Request(req, 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContainsOr("Hostname: whoami1")) + require.NoError(s.T(), err) reg.Check = &api.AgentServiceCheck{ CheckID: "some-failing-check", @@ -299,16 +290,16 @@ func (s *ConsulCatalogSuite) TestSimpleConfigurationWithWatch(c *check.C) { } err = s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - err = try.Request(req, 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err = try.Request(req, 5*time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestRegisterServiceWithoutIP(c *check.C) { +func (s *ConsulCatalogSuite) TestRegisterServiceWithoutIP() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -317,8 +308,7 @@ func (s *ConsulCatalogSuite) TestRegisterServiceWithoutIP(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) reg := &api.AgentServiceRegistration{ ID: "whoami1", @@ -328,25 +318,21 @@ func (s *ConsulCatalogSuite) TestRegisterServiceWithoutIP(c *check.C) { Address: "", } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/api/http/services", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("whoami@consulcatalog", "\"http://127.0.0.1:80\": \"UP\"")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestDefaultConsulService(c *check.C) { +func (s *ConsulCatalogSuite) TestDefaultConsulService() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -355,37 +341,32 @@ func (s *ConsulCatalogSuite) TestDefaultConsulService(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) reg := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami", Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "whoami.consul.localhost" err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami1")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulServiceWithTCPLabels(c *check.C) { +func (s *ConsulCatalogSuite) TestConsulServiceWithTCPLabels() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -394,8 +375,7 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithTCPLabels(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) // Start a container with some tags reg := &api.AgentServiceRegistration{ @@ -407,32 +387,28 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithTCPLabels(c *check.C) { "traefik.tcp.Services.Super.Loadbalancer.server.port=8080", }, Port: 8080, - Address: s.getComposeServiceIP(c, "whoamitcp"), + Address: s.getComposeServiceIP("whoamitcp"), } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`my.super.host`)")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) who, err := guessWho("127.0.0.1:8000", "my.super.host", true) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - c.Assert(who, checker.Contains, "whoamitcp") + assert.Contains(s.T(), who, "whoamitcp") err = s.deregisterService("whoamitcp", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulServiceWithLabels(c *check.C) { +func (s *ConsulCatalogSuite) TestConsulServiceWithLabels() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -441,8 +417,7 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithLabels(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) // Start a container with some tags reg1 := &api.AgentServiceRegistration{ @@ -452,11 +427,11 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithLabels(c *check.C) { "traefik.http.Routers.Super.Rule=Host(`my.super.host`)", }, Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg1, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Start another container by replacing a '.' by a '-' reg2 := &api.AgentServiceRegistration{ @@ -466,40 +441,36 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithLabels(c *check.C) { "traefik.http.Routers.SuperHost.Rule=Host(`my-super.host`)", }, Port: 80, - Address: s.getComposeServiceIP(c, "whoami2"), + Address: s.getComposeServiceIP("whoami2"), } err = s.registerService(reg2, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my-super.host" err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami1")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my.super.host" err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami2")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami2", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestSameServiceIDOnDifferentConsulAgent(c *check.C) { +func (s *ConsulCatalogSuite) TestSameServiceIDOnDifferentConsulAgent() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -508,8 +479,7 @@ func (s *ConsulCatalogSuite) TestSameServiceIDOnDifferentConsulAgent(c *check.C) DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/default_not_exposed.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/default_not_exposed.toml", tempObjects) // Start a container with some tags tags := []string{ @@ -523,50 +493,46 @@ func (s *ConsulCatalogSuite) TestSameServiceIDOnDifferentConsulAgent(c *check.C) Name: "whoami", Tags: tags, Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg1, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) reg2 := &api.AgentServiceRegistration{ ID: "whoami", Name: "whoami", Tags: tags, Port: 80, - Address: s.getComposeServiceIP(c, "whoami2"), + Address: s.getComposeServiceIP("whoami2"), } err = s.registerService(reg2, true) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my.super.host" err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami1", "Hostname: whoami2")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/api/rawdata", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 2*time.Second, try.StatusCodeIs(200), - try.BodyContainsOr(s.getComposeServiceIP(c, "whoami1"), s.getComposeServiceIP(c, "whoami2"))) - c.Assert(err, checker.IsNil) + try.BodyContainsOr(s.getComposeServiceIP("whoami1"), s.getComposeServiceIP("whoami2"))) + require.NoError(s.T(), err) err = s.deregisterService("whoami", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami", true) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulServiceWithOneMissingLabels(c *check.C) { +func (s *ConsulCatalogSuite) TestConsulServiceWithOneMissingLabels() { tempObjects := struct { ConsulAddress string DefaultRule string @@ -575,8 +541,7 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithOneMissingLabels(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.consul.localhost`)", } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) // Start a container with some tags reg := &api.AgentServiceRegistration{ @@ -586,32 +551,28 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithOneMissingLabels(c *check.C) { "traefik.random.value=my.super.host", }, Port: 80, - Address: s.getComposeServiceIP(c, "whoami1"), + Address: s.getComposeServiceIP("whoami1"), } err := s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/version", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my.super.host" // TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?) // TODO validate : run on 80 // Expected a 404 as we did not configure anything err = try.Request(req, 1500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulServiceWithHealthCheck(c *check.C) { - whoamiIP := s.getComposeServiceIP(c, "whoami1") +func (s *ConsulCatalogSuite) TestConsulServiceWithHealthCheck() { + whoamiIP := s.getComposeServiceIP("whoami1") tags := []string{ "traefik.enable=true", "traefik.http.routers.router1.rule=Path(`/whoami`)", @@ -635,7 +596,7 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithHealthCheck(c *check.C) { } err := s.registerService(reg1, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tempObjects := struct { ConsulAddress string @@ -643,22 +604,17 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithHealthCheck(c *check.C) { ConsulAddress: s.consulURL, } - file := s.adaptFile(c, "fixtures/consul_catalog/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/simple.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8000/whoami", 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - whoami2IP := s.getComposeServiceIP(c, "whoami2") + whoami2IP := s.getComposeServiceIP("whoami2") reg2 := &api.AgentServiceRegistration{ ID: "whoami2", Name: "whoami", @@ -675,26 +631,26 @@ func (s *ConsulCatalogSuite) TestConsulServiceWithHealthCheck(c *check.C) { } err = s.registerService(reg2, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "whoami" // TODO Need to wait for up to 10 seconds (for consul discovery or traefik to boot up ?) err = try.Request(req, 10*time.Second, try.StatusCodeIs(200), try.BodyContainsOr("Hostname: whoami2")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami2", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulConnect(c *check.C) { +func (s *ConsulCatalogSuite) TestConsulConnect() { // Wait for consul to fully initialize connect CA err := s.waitForConnectCA() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - connectIP := s.getComposeServiceIP(c, "connect") + connectIP := s.getComposeServiceIP("connect") reg := &api.AgentServiceRegistration{ ID: "uuid-api1", Name: "uuid-api", @@ -712,9 +668,9 @@ func (s *ConsulCatalogSuite) TestConsulConnect(c *check.C) { Address: connectIP, } err = s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - whoamiIP := s.getComposeServiceIP(c, "whoami1") + whoamiIP := s.getComposeServiceIP("whoami1") regWhoami := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami", @@ -727,40 +683,35 @@ func (s *ConsulCatalogSuite) TestConsulConnect(c *check.C) { Address: whoamiIP, } err = s.registerService(regWhoami, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tempObjects := struct { ConsulAddress string }{ ConsulAddress: s.consulURL, } - file := s.adaptFile(c, "fixtures/consul_catalog/connect.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/connect.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8000/", 10*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 10*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("uuid-api1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulConnect_ByDefault(c *check.C) { +func (s *ConsulCatalogSuite) TestConsulConnect_ByDefault() { // Wait for consul to fully initialize connect CA err := s.waitForConnectCA() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - connectIP := s.getComposeServiceIP(c, "connect") + connectIP := s.getComposeServiceIP("connect") reg := &api.AgentServiceRegistration{ ID: "uuid-api1", Name: "uuid-api", @@ -777,9 +728,9 @@ func (s *ConsulCatalogSuite) TestConsulConnect_ByDefault(c *check.C) { Address: connectIP, } err = s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - whoamiIP := s.getComposeServiceIP(c, "whoami1") + whoamiIP := s.getComposeServiceIP("whoami1") regWhoami := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami1", @@ -792,9 +743,9 @@ func (s *ConsulCatalogSuite) TestConsulConnect_ByDefault(c *check.C) { Address: whoamiIP, } err = s.registerService(regWhoami, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - whoami2IP := s.getComposeServiceIP(c, "whoami2") + whoami2IP := s.getComposeServiceIP("whoami2") regWhoami2 := &api.AgentServiceRegistration{ ID: "whoami2", Name: "whoami2", @@ -808,45 +759,40 @@ func (s *ConsulCatalogSuite) TestConsulConnect_ByDefault(c *check.C) { Address: whoami2IP, } err = s.registerService(regWhoami2, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tempObjects := struct { ConsulAddress string }{ ConsulAddress: s.consulURL, } - file := s.adaptFile(c, "fixtures/consul_catalog/connect_by_default.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/connect_by_default.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8000/", 10*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 10*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami2", 10*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("uuid-api1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami2", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulCatalogSuite) TestConsulConnect_NotAware(c *check.C) { +func (s *ConsulCatalogSuite) TestConsulConnect_NotAware() { // Wait for consul to fully initialize connect CA err := s.waitForConnectCA() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - connectIP := s.getComposeServiceIP(c, "connect") + connectIP := s.getComposeServiceIP("connect") reg := &api.AgentServiceRegistration{ ID: "uuid-api1", Name: "uuid-api", @@ -864,9 +810,9 @@ func (s *ConsulCatalogSuite) TestConsulConnect_NotAware(c *check.C) { Address: connectIP, } err = s.registerService(reg, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - whoamiIP := s.getComposeServiceIP(c, "whoami1") + whoamiIP := s.getComposeServiceIP("whoami1") regWhoami := &api.AgentServiceRegistration{ ID: "whoami1", Name: "whoami", @@ -879,30 +825,25 @@ func (s *ConsulCatalogSuite) TestConsulConnect_NotAware(c *check.C) { Address: whoamiIP, } err = s.registerService(regWhoami, false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tempObjects := struct { ConsulAddress string }{ ConsulAddress: s.consulURL, } - file := s.adaptFile(c, "fixtures/consul_catalog/connect_not_aware.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul_catalog/connect_not_aware.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8000/", 10*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 10*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("uuid-api1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = s.deregisterService("whoami1", false) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } diff --git a/integration/consul_test.go b/integration/consul_test.go index fa1c18a9f..076fd4560 100644 --- a/integration/consul_test.go +++ b/integration/consul_test.go @@ -10,16 +10,17 @@ import ( "net/http" "os" "path/filepath" + "testing" "time" - "github.com/go-check/check" "github.com/kvtools/consul" "github.com/kvtools/valkeyrie" "github.com/kvtools/valkeyrie/store" "github.com/pmezard/go-difflib/difflib" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/api" - checker "github.com/vdemeester/shakers" ) // Consul test suites. @@ -29,18 +30,16 @@ type ConsulSuite struct { consulURL string } -func (s *ConsulSuite) resetStore(c *check.C) { - err := s.kvClient.DeleteTree(context.Background(), "traefik") - if err != nil && !errors.Is(err, store.ErrKeyNotFound) { - c.Fatal(err) - } +func TestConsulSuite(t *testing.T) { + suite.Run(t, new(ConsulSuite)) } -func (s *ConsulSuite) setupStore(c *check.C) { - s.createComposeProject(c, "consul") - s.composeUp(c) +func (s *ConsulSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + s.createComposeProject("consul") + s.composeUp() - consulAddr := net.JoinHostPort(s.getComposeServiceIP(c, "consul"), "8500") + consulAddr := net.JoinHostPort(s.getComposeServiceIP("consul"), "8500") s.consulURL = fmt.Sprintf("http://%s", consulAddr) kv, err := valkeyrie.NewStore( @@ -51,21 +50,27 @@ func (s *ConsulSuite) setupStore(c *check.C) { ConnectionTimeout: 10 * time.Second, }, ) - if err != nil { - c.Fatal("Cannot create store consul") - } + require.NoError(s.T(), err, "Cannot create store consul") s.kvClient = kv // wait for consul err = try.Do(60*time.Second, try.KVExists(kv, "test")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ConsulSuite) TestSimpleConfiguration(c *check.C) { - s.setupStore(c) +func (s *ConsulSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} - file := s.adaptFile(c, "fixtures/consul/simple.toml", struct{ ConsulAddress string }{s.consulURL}) - defer os.Remove(file) +func (s *ConsulSuite) TearDownTest() { + err := s.kvClient.DeleteTree(context.Background(), "traefik") + if err != nil && !errors.Is(err, store.ErrKeyNotFound) { + require.ErrorIs(s.T(), err, store.ErrKeyNotFound) + } +} + +func (s *ConsulSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/consul/simple.toml", struct{ ConsulAddress string }{s.consulURL}) data := map[string]string{ "traefik/http/routers/Router0/entryPoints/0": "web", @@ -114,39 +119,35 @@ func (s *ConsulSuite) TestSimpleConfiguration(c *check.C) { for k, v := range data { err := s.kvClient.Put(context.Background(), k, []byte(v), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains(`"striper@consul":`, `"compressor@consul":`, `"srvcA@consul":`, `"srvcB@consul":`), ) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var obtained api.RunTimeRepresentation err = json.NewDecoder(resp.Body).Decode(&obtained) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) got, err := json.MarshalIndent(obtained, "", " ") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) expectedJSON := filepath.FromSlash("testdata/rawdata-consul.json") if *updateExpected { err = os.WriteFile(expectedJSON, got, 0o666) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } expected, err := os.ReadFile(expectedJSON) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if !bytes.Equal(expected, got) { diff := difflib.UnifiedDiff{ @@ -158,33 +159,27 @@ func (s *ConsulSuite) TestSimpleConfiguration(c *check.C) { } text, err := difflib.GetUnifiedDiffString(diff) - c.Assert(err, checker.IsNil) - c.Error(text) + require.NoError(s.T(), err, text) } } -func (s *ConsulSuite) assertWhoami(c *check.C, host string, expectedStatusCode int) { +func (s *ConsulSuite) assertWhoami(host string, expectedStatusCode int) { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - if err != nil { - c.Fatal(err) - } + require.NoError(s.T(), err) req.Host = host resp, err := try.ResponseUntilStatusCode(req, 15*time.Second, expectedStatusCode) + require.NoError(s.T(), err) resp.Body.Close() - c.Assert(err, checker.IsNil) } -func (s *ConsulSuite) TestDeleteRootKey(c *check.C) { +func (s *ConsulSuite) TestDeleteRootKey() { // This test case reproduce the issue: https://github.com/traefik/traefik/issues/8092 - s.setupStore(c) - s.resetStore(c) - file := s.adaptFile(c, "fixtures/consul/simple.toml", struct{ ConsulAddress string }{s.consulURL}) - defer os.Remove(file) + file := s.adaptFile("fixtures/consul/simple.toml", struct{ ConsulAddress string }{s.consulURL}) ctx := context.Background() - svcaddr := net.JoinHostPort(s.getComposeServiceIP(c, "whoami"), "80") + svcaddr := net.JoinHostPort(s.getComposeServiceIP("whoami"), "80") data := map[string]string{ "traefik/http/routers/Router0/entryPoints/0": "web", @@ -201,32 +196,28 @@ func (s *ConsulSuite) TestDeleteRootKey(c *check.C) { for k, v := range data { err := s.kvClient.Put(ctx, k, []byte(v), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains(`"Router0@consul":`, `"Router1@consul":`, `"simplesvc0@consul":`, `"simplesvc1@consul":`), ) - c.Assert(err, checker.IsNil) - s.assertWhoami(c, "kv1.localhost", http.StatusOK) - s.assertWhoami(c, "kv2.localhost", http.StatusOK) + require.NoError(s.T(), err) + s.assertWhoami("kv1.localhost", http.StatusOK) + s.assertWhoami("kv2.localhost", http.StatusOK) // delete router1 err = s.kvClient.DeleteTree(ctx, "traefik/http/routers/Router1") - c.Assert(err, checker.IsNil) - s.assertWhoami(c, "kv1.localhost", http.StatusOK) - s.assertWhoami(c, "kv2.localhost", http.StatusNotFound) + require.NoError(s.T(), err) + s.assertWhoami("kv1.localhost", http.StatusOK) + s.assertWhoami("kv2.localhost", http.StatusNotFound) // delete simple services and router0 err = s.kvClient.DeleteTree(ctx, "traefik") - c.Assert(err, checker.IsNil) - s.assertWhoami(c, "kv1.localhost", http.StatusNotFound) - s.assertWhoami(c, "kv2.localhost", http.StatusNotFound) + require.NoError(s.T(), err) + s.assertWhoami("kv1.localhost", http.StatusNotFound) + s.assertWhoami("kv2.localhost", http.StatusNotFound) } diff --git a/integration/docker_compose_test.go b/integration/docker_compose_test.go index 39347dca5..39f4fbf92 100644 --- a/integration/docker_compose_test.go +++ b/integration/docker_compose_test.go @@ -3,15 +3,16 @@ package integration import ( "encoding/json" "net/http" - "os" "strings" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/api" "github.com/traefik/traefik/v3/pkg/testhelpers" - checker "github.com/vdemeester/shakers" ) // Docker tests suite. @@ -19,12 +20,21 @@ type DockerComposeSuite struct { BaseSuite } -func (s *DockerComposeSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "minimal") - s.composeUp(c) +func TestDockerComposeSuite(t *testing.T) { + suite.Run(t, new(DockerComposeSuite)) } -func (s *DockerComposeSuite) TestComposeScale(c *check.C) { +func (s *DockerComposeSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + s.createComposeProject("minimal") + s.composeUp() +} + +func (s *DockerComposeSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *DockerComposeSuite) TestComposeScale() { tempObjects := struct { DockerHost string DefaultRule string @@ -32,41 +42,36 @@ func (s *DockerComposeSuite) TestComposeScale(c *check.C) { DockerHost: s.getDockerHost(), DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/minimal.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/minimal.toml", tempObjects) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req := testhelpers.MustNewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil) req.Host = "my.super.host" - _, err = try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK) - c.Assert(err, checker.IsNil) + _, err := try.ResponseUntilStatusCode(req, 5*time.Second, http.StatusOK) + require.NoError(s.T(), err) resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) defer resp.Body.Close() var rtconf api.RunTimeRepresentation err = json.NewDecoder(resp.Body).Decode(&rtconf) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // check that we have only three routers (the one from this test + 2 unrelated internal ones) - c.Assert(rtconf.Routers, checker.HasLen, 3) + assert.Len(s.T(), rtconf.Routers, 3) // check that we have only one service (not counting the internal ones) with n servers services := rtconf.Services - c.Assert(services, checker.HasLen, 4) + assert.Len(s.T(), services, 4) for name, service := range services { if strings.HasSuffix(name, "@internal") { continue } - c.Assert(name, checker.Equals, "whoami1-"+s.composeProject.Name+"@docker") - c.Assert(service.LoadBalancer.Servers, checker.HasLen, 2) + assert.Equal(s.T(), "service-mini@docker", name) + assert.Len(s.T(), service.LoadBalancer.Servers, 2) // We could break here, but we don't just to keep us honest. } } diff --git a/integration/docker_test.go b/integration/docker_test.go index dad1ef809..1a767ff6f 100644 --- a/integration/docker_test.go +++ b/integration/docker_test.go @@ -2,15 +2,15 @@ package integration import ( "encoding/json" - "fmt" "io" "net/http" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) // Docker tests suite. @@ -18,15 +18,24 @@ type DockerSuite struct { BaseSuite } -func (s *DockerSuite) SetUpTest(c *check.C) { - s.createComposeProject(c, "docker") +func TestDockerSuite(t *testing.T) { + suite.Run(t, new(DockerSuite)) } -func (s *DockerSuite) TearDownTest(c *check.C) { - s.composeDown(c) +func (s *DockerSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + s.createComposeProject("docker") } -func (s *DockerSuite) TestSimpleConfiguration(c *check.C) { +func (s *DockerSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *DockerSuite) TearDownTest() { + s.composeStop("simple", "withtcplabels", "withlabels1", "withlabels2", "withonelabelmissing", "powpow") +} + +func (s *DockerSuite) TestSimpleConfiguration() { tempObjects := struct { DockerHost string DefaultRule string @@ -35,24 +44,18 @@ func (s *DockerSuite) TestSimpleConfiguration(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/simple.toml", tempObjects) - s.composeUp(c) + s.composeUp() - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // Expected a 404 as we did not configure anything - err = try.GetRequest("http://127.0.0.1:8000/", 500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) } -func (s *DockerSuite) TestDefaultDockerContainers(c *check.C) { +func (s *DockerSuite) TestDefaultDockerContainers() { tempObjects := struct { DockerHost string DefaultRule string @@ -61,37 +64,30 @@ func (s *DockerSuite) TestDefaultDockerContainers(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/simple.toml", tempObjects) - s.composeUp(c, "simple") + s.composeUp("simple") // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/version", nil) - c.Assert(err, checker.IsNil) - req.Host = fmt.Sprintf("simple-%s.docker.localhost", s.composeProject.Name) + require.NoError(s.T(), err) + req.Host = "simple.docker.localhost" - // TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?) - resp, err := try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK) - c.Assert(err, checker.IsNil) + resp, err := try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var version map[string]interface{} - c.Assert(json.Unmarshal(body, &version), checker.IsNil) - c.Assert(version["Version"], checker.Equals, "swarm/1.0.0") + assert.NoError(s.T(), json.Unmarshal(body, &version)) + assert.Equal(s.T(), "swarm/1.0.0", version["Version"]) } -func (s *DockerSuite) TestDockerContainersWithTCPLabels(c *check.C) { +func (s *DockerSuite) TestDockerContainersWithTCPLabels() { tempObjects := struct { DockerHost string DefaultRule string @@ -100,29 +96,23 @@ func (s *DockerSuite) TestDockerContainersWithTCPLabels(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/simple.toml", tempObjects) - s.composeUp(c, "withtcplabels") + s.composeUp("withtcplabels") // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`my.super.host`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`my.super.host`)")) + require.NoError(s.T(), err) who, err := guessWho("127.0.0.1:8000", "my.super.host", true) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - c.Assert(who, checker.Contains, "my.super.host") + assert.Contains(s.T(), who, "my.super.host") } -func (s *DockerSuite) TestDockerContainersWithLabels(c *check.C) { +func (s *DockerSuite) TestDockerContainersWithLabels() { tempObjects := struct { DockerHost string DefaultRule string @@ -131,44 +121,37 @@ func (s *DockerSuite) TestDockerContainersWithLabels(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/simple.toml", tempObjects) - s.composeUp(c, "withlabels1", "withlabels2") + s.composeUp("withlabels1", "withlabels2") // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/version", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my-super.host" - // TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?) - _, err = try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK) - c.Assert(err, checker.IsNil) + _, err = try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/version", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my.super.host" - // TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?) - resp, err := try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK) - c.Assert(err, checker.IsNil) + resp, err := try.ResponseUntilStatusCode(req, 3*time.Second, http.StatusOK) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var version map[string]interface{} - c.Assert(json.Unmarshal(body, &version), checker.IsNil) - c.Assert(version["Version"], checker.Equals, "swarm/1.0.0") + assert.NoError(s.T(), json.Unmarshal(body, &version)) + assert.Equal(s.T(), "swarm/1.0.0", version["Version"]) } -func (s *DockerSuite) TestDockerContainersWithOneMissingLabels(c *check.C) { +func (s *DockerSuite) TestDockerContainersWithOneMissingLabels() { tempObjects := struct { DockerHost string DefaultRule string @@ -177,31 +160,23 @@ func (s *DockerSuite) TestDockerContainersWithOneMissingLabels(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/simple.toml", tempObjects) - s.composeUp(c, "withonelabelmissing") + s.composeUp("withonelabelmissing") // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/version", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my.super.host" - // TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?) - // TODO validate : run on 80 // Expected a 404 as we did not configure anything - err = try.Request(req, 1500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err = try.Request(req, 3*time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) } -func (s *DockerSuite) TestRestartDockerContainers(c *check.C) { +func (s *DockerSuite) TestRestartDockerContainers() { tempObjects := struct { DockerHost string DefaultRule string @@ -210,46 +185,40 @@ func (s *DockerSuite) TestRestartDockerContainers(c *check.C) { DefaultRule: "Host(`{{ normalize .Name }}.docker.localhost`)", } - file := s.adaptFile(c, "fixtures/docker/simple.toml", tempObjects) - defer os.Remove(file) + file := s.adaptFile("fixtures/docker/simple.toml", tempObjects) - s.composeUp(c, "powpow") + s.composeUp("powpow") // Start traefik - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/version", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "my.super.host" // TODO Need to wait than 500 milliseconds more (for swarm or traefik to boot up ?) resp, err := try.ResponseUntilStatusCode(req, 1500*time.Millisecond, http.StatusOK) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var version map[string]interface{} - c.Assert(json.Unmarshal(body, &version), checker.IsNil) - c.Assert(version["Version"], checker.Equals, "swarm/1.0.0") + assert.NoError(s.T(), json.Unmarshal(body, &version)) + assert.Equal(s.T(), "swarm/1.0.0", version["Version"]) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("powpow")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - s.composeStop(c, "powpow") + s.composeStop("powpow") time.Sleep(5 * time.Second) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("powpow")) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) - s.composeUp(c, "powpow") + s.composeUp("powpow") err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("powpow")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } diff --git a/integration/error_pages_test.go b/integration/error_pages_test.go index 8a6deba89..8fd77ac58 100644 --- a/integration/error_pages_test.go +++ b/integration/error_pages_test.go @@ -3,12 +3,12 @@ package integration import ( "net/http" "net/http/httptest" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) // ErrorPagesSuite test suites. @@ -18,83 +18,78 @@ type ErrorPagesSuite struct { BackendIP string } -func (s *ErrorPagesSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "error_pages") - s.composeUp(c) - - s.ErrorPageIP = s.getComposeServiceIP(c, "nginx2") - s.BackendIP = s.getComposeServiceIP(c, "nginx1") +func TestErrorPagesSuite(t *testing.T) { + suite.Run(t, new(ErrorPagesSuite)) } -func (s *ErrorPagesSuite) TestSimpleConfiguration(c *check.C) { - file := s.adaptFile(c, "fixtures/error_pages/simple.toml", struct { +func (s *ErrorPagesSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("error_pages") + s.composeUp() + + s.ErrorPageIP = s.getComposeServiceIP("nginx2") + s.BackendIP = s.getComposeServiceIP("nginx1") +} + +func (s *ErrorPagesSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *ErrorPagesSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/error_pages/simple.toml", struct { Server1 string Server2 string }{"http://" + s.BackendIP + ":80", s.ErrorPageIP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) frontendReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendReq.Host = "test.local" err = try.Request(frontendReq, 2*time.Second, try.BodyContains("nginx")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ErrorPagesSuite) TestErrorPage(c *check.C) { +func (s *ErrorPagesSuite) TestErrorPage() { // error.toml contains a mis-configuration of the backend host - file := s.adaptFile(c, "fixtures/error_pages/error.toml", struct { + file := s.adaptFile("fixtures/error_pages/error.toml", struct { Server1 string Server2 string }{s.BackendIP, s.ErrorPageIP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) frontendReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendReq.Host = "test.local" err = try.Request(frontendReq, 2*time.Second, try.BodyContains("An error occurred.")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ErrorPagesSuite) TestErrorPageFlush(c *check.C) { +func (s *ErrorPagesSuite) TestErrorPageFlush() { srv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { rw.Header().Add("Transfer-Encoding", "chunked") rw.WriteHeader(http.StatusInternalServerError) _, _ = rw.Write([]byte("KO")) })) - file := s.adaptFile(c, "fixtures/error_pages/simple.toml", struct { + file := s.adaptFile("fixtures/error_pages/simple.toml", struct { Server1 string Server2 string }{srv.URL, s.ErrorPageIP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) frontendReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendReq.Host = "test.local" err = try.Request(frontendReq, 2*time.Second, try.BodyContains("An error occurred."), try.HasHeaderValue("Content-Type", "text/html", true), ) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } diff --git a/integration/etcd_test.go b/integration/etcd_test.go index a9e9bb532..01132ba88 100644 --- a/integration/etcd_test.go +++ b/integration/etcd_test.go @@ -8,16 +8,17 @@ import ( "net/http" "os" "path/filepath" + "testing" "time" - "github.com/go-check/check" "github.com/kvtools/etcdv3" "github.com/kvtools/valkeyrie" "github.com/kvtools/valkeyrie/store" "github.com/pmezard/go-difflib/difflib" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/api" - checker "github.com/vdemeester/shakers" ) // etcd test suites. @@ -27,12 +28,18 @@ type EtcdSuite struct { etcdAddr string } -func (s *EtcdSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "etcd") - s.composeUp(c) +func TestEtcdSuite(t *testing.T) { + suite.Run(t, new(EtcdSuite)) +} + +func (s *EtcdSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("etcd") + s.composeUp() var err error - s.etcdAddr = net.JoinHostPort(s.getComposeServiceIP(c, "etcd"), "2379") + s.etcdAddr = net.JoinHostPort(s.getComposeServiceIP("etcd"), "2379") s.kvClient, err = valkeyrie.NewStore( context.Background(), etcdv3.StoreName, @@ -41,18 +48,19 @@ func (s *EtcdSuite) SetUpSuite(c *check.C) { ConnectionTimeout: 10 * time.Second, }, ) - if err != nil { - c.Fatal("Cannot create store etcd") - } + require.NoError(s.T(), err) // wait for etcd err = try.Do(60*time.Second, try.KVExists(s.kvClient, "test")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *EtcdSuite) TestSimpleConfiguration(c *check.C) { - file := s.adaptFile(c, "fixtures/etcd/simple.toml", struct{ EtcdAddress string }{s.etcdAddr}) - defer os.Remove(file) +func (s *EtcdSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *EtcdSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/etcd/simple.toml", struct{ EtcdAddress string }{s.etcdAddr}) data := map[string]string{ "traefik/http/routers/Router0/entryPoints/0": "web", @@ -101,39 +109,35 @@ func (s *EtcdSuite) TestSimpleConfiguration(c *check.C) { for k, v := range data { err := s.kvClient.Put(context.Background(), k, []byte(v), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains(`"striper@etcd":`, `"compressor@etcd":`, `"srvcA@etcd":`, `"srvcB@etcd":`), ) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var obtained api.RunTimeRepresentation err = json.NewDecoder(resp.Body).Decode(&obtained) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) got, err := json.MarshalIndent(obtained, "", " ") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) expectedJSON := filepath.FromSlash("testdata/rawdata-etcd.json") if *updateExpected { err = os.WriteFile(expectedJSON, got, 0o666) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } expected, err := os.ReadFile(expectedJSON) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if !bytes.Equal(expected, got) { diff := difflib.UnifiedDiff{ @@ -145,7 +149,6 @@ func (s *EtcdSuite) TestSimpleConfiguration(c *check.C) { } text, err := difflib.GetUnifiedDiffString(diff) - c.Assert(err, checker.IsNil) - c.Error(text) + require.NoError(s.T(), err, text) } } diff --git a/integration/file_test.go b/integration/file_test.go index 38c30db35..7e909e109 100644 --- a/integration/file_test.go +++ b/integration/file_test.go @@ -2,61 +2,58 @@ package integration import ( "net/http" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) // File tests suite. type FileSuite struct{ BaseSuite } -func (s *FileSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "file") - s.composeUp(c) +func TestFileSuite(t *testing.T) { + suite.Run(t, new(FileSuite)) } -func (s *FileSuite) TestSimpleConfiguration(c *check.C) { - file := s.adaptFile(c, "fixtures/file/simple.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *FileSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("file") + s.composeUp() +} + +func (s *FileSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *FileSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/file/simple.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // Expected a 404 as we did not configure anything - err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) } // #56 regression test, make sure it does not fail? -func (s *FileSuite) TestSimpleConfigurationNoPanic(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/file/56-simple-panic.toml")) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *FileSuite) TestSimpleConfigurationNoPanic() { + s.traefikCmd(withConfigFile("fixtures/file/56-simple-panic.toml")) // Expected a 404 as we did not configure anything - err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) } -func (s *FileSuite) TestDirectoryConfiguration(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/file/directory.toml")) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *FileSuite) TestDirectoryConfiguration() { + s.traefikCmd(withConfigFile("fixtures/file/directory.toml")) // Expected a 404 as we did not configure anything at /test - err = try.GetRequest("http://127.0.0.1:8000/test", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/test", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) // Expected a 502 as there is no backend server err = try.GetRequest("http://127.0.0.1:8000/test2", 1000*time.Millisecond, try.StatusCodeIs(http.StatusBadGateway)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } diff --git a/integration/fixtures/k8s/01-traefik-crd.yml b/integration/fixtures/k8s/01-traefik-crd.yml index 504c5cd9c..e388639a9 100644 --- a/integration/fixtures/k8s/01-traefik-crd.yml +++ b/integration/fixtures/k8s/01-traefik-crd.yml @@ -1192,6 +1192,32 @@ spec: type: string type: array type: object + ipWhiteList: + description: 'Deprecated: please use IPAllowList instead.' + properties: + ipStrategy: + description: 'IPStrategy holds the IP strategy configuration used + by Traefik to determine the client IP. More info: https://doc.traefik.io/traefik/v3.0/middlewares/http/ipallowlist/#ipstrategy' + properties: + depth: + description: Depth tells Traefik to use the X-Forwarded-For + header and take the IP located at the depth position (starting + from the right). + type: integer + excludedIPs: + description: ExcludedIPs configures Traefik to scan the X-Forwarded-For + header and select the first IP not in the list. + items: + type: string + type: array + type: object + sourceRange: + description: SourceRange defines the set of allowed IPs (or ranges + of allowed IPs by using CIDR notation). + items: + type: string + type: array + type: object passTLSClientCert: description: 'PassTLSClientCert holds the pass TLS client cert middleware configuration. This middleware adds the selected data from the passed @@ -1528,6 +1554,17 @@ spec: type: string type: array type: object + ipWhiteList: + description: 'IPWhiteList defines the IPWhiteList middleware configuration. + Deprecated: please use IPAllowList instead.' + properties: + sourceRange: + description: SourceRange defines the allowed IPs (or ranges of + allowed IPs by using CIDR notation). + items: + type: string + type: array + type: object type: object required: - metadata diff --git a/integration/fixtures/proxy-protocol/with.toml b/integration/fixtures/proxy-protocol/proxy-protocol.toml similarity index 70% rename from integration/fixtures/proxy-protocol/with.toml rename to integration/fixtures/proxy-protocol/proxy-protocol.toml index 0c51207e0..4945a9099 100644 --- a/integration/fixtures/proxy-protocol/with.toml +++ b/integration/fixtures/proxy-protocol/proxy-protocol.toml @@ -7,10 +7,14 @@ noColor = true [entryPoints] - [entryPoints.web] + [entryPoints.trust] address = ":8000" - [entryPoints.web.proxyProtocol] - trustedIPs = ["{{.HaproxyIP}}"] + [entryPoints.trust.proxyProtocol] + trustedIPs = ["127.0.0.1"] + [entryPoints.nottrust] + address = ":9000" + [entryPoints.nottrust.proxyProtocol] + trustedIPs = ["1.2.3.4"] [api] insecure = true diff --git a/integration/fixtures/proxy-protocol/without.toml b/integration/fixtures/proxy-protocol/without.toml deleted file mode 100644 index 4346c9926..000000000 --- a/integration/fixtures/proxy-protocol/without.toml +++ /dev/null @@ -1,33 +0,0 @@ -[global] - checkNewVersion = false - sendAnonymousUsage = false - -[log] - level = "DEBUG" - noColor = true - -[entryPoints] - [entryPoints.web] - address = ":8000" - [entryPoints.web.proxyProtocol] - trustedIPs = ["1.2.3.4"] - -[api] - insecure = true - -[providers.file] - filename = "{{ .SelfFilename }}" - -## dynamic configuration ## - -[http.routers] - [http.routers.router1] - service = "service1" - rule = "Path(`/whoami`)" - -[http.services] - [http.services.service1] - [http.services.service1.loadBalancer] - - [[http.services.service1.loadBalancer.servers]] - url = "http://{{.WhoamiIP}}" diff --git a/integration/fixtures/simple_whitelist.toml b/integration/fixtures/simple_whitelist.toml new file mode 100644 index 000000000..03fa451e4 --- /dev/null +++ b/integration/fixtures/simple_whitelist.toml @@ -0,0 +1,18 @@ +[global] + checkNewVersion = false + sendAnonymousUsage = false + +[log] + level = "DEBUG" + +[entryPoints] + [entryPoints.web] + address = ":8000" + [entryPoints.web.ForwardedHeaders] + insecure = true + +[api] + insecure = true + +[providers] + [providers.docker] diff --git a/integration/fixtures/tcp/ipallowlist.toml b/integration/fixtures/tcp/ip-allowlist.toml similarity index 72% rename from integration/fixtures/tcp/ipallowlist.toml rename to integration/fixtures/tcp/ip-allowlist.toml index 2ef8c13f4..786971f52 100644 --- a/integration/fixtures/tcp/ipallowlist.toml +++ b/integration/fixtures/tcp/ip-allowlist.toml @@ -4,6 +4,8 @@ [log] level = "DEBUG" + noColor = true + [entryPoints] [entryPoints.tcp] @@ -24,16 +26,16 @@ rule = "HostSNI(`whoami-a.test`)" service = "whoami-a" middlewares = ["blocking-ipallowlist"] - [tcp.routers.to-whoami-a.tls] - passthrough = true + [tcp.routers.to-whoami-a.tls] + passthrough = true [tcp.routers.to-whoami-b] entryPoints = ["tcp"] rule = "HostSNI(`whoami-b.test`)" service = "whoami-b" middlewares = ["allowing-ipallowlist"] - [tcp.routers.to-whoami-b.tls] - passthrough = true + [tcp.routers.to-whoami-b.tls] + passthrough = true [tcp.services] [tcp.services.whoami-a.loadBalancer] @@ -44,8 +46,8 @@ [[tcp.services.whoami-b.loadBalancer.servers]] address = "{{ .WhoamiB }}" - [tcp.middlewares] - [tcp.middlewares.allowing-ipallowlist.ipAllowList] - sourceRange = ["127.0.0.1/32"] - [tcp.middlewares.blocking-ipallowlist.ipAllowList] - sourceRange = ["127.127.127.127/32"] +[tcp.middlewares] + [tcp.middlewares.allowing-ipallowlist.ipAllowList] + sourceRange = ["127.0.0.1/32"] + [tcp.middlewares.blocking-ipallowlist.ipAllowList] + sourceRange = ["127.127.127.127/32"] diff --git a/integration/fixtures/tcp/ip-whitelist.toml b/integration/fixtures/tcp/ip-whitelist.toml new file mode 100644 index 000000000..b9c6cc998 --- /dev/null +++ b/integration/fixtures/tcp/ip-whitelist.toml @@ -0,0 +1,52 @@ +[global] + checkNewVersion = false + sendAnonymousUsage = false + +[log] + level = "DEBUG" + noColor = true + +[entryPoints] + [entryPoints.tcp] + address = ":8093" + +[api] + insecure = true + +[providers.file] + filename = "{{ .SelfFilename }}" + +## dynamic configuration ## + +[tcp] + [tcp.routers] + [tcp.routers.to-whoami-a] + entryPoints = ["tcp"] + rule = "HostSNI(`whoami-a.test`)" + service = "whoami-a" + middlewares = ["blocking-ipwhitelist"] + [tcp.routers.to-whoami-a.tls] + passthrough = true + + [tcp.routers.to-whoami-b] + entryPoints = ["tcp"] + rule = "HostSNI(`whoami-b.test`)" + service = "whoami-b" + middlewares = ["allowing-ipwhitelist"] + [tcp.routers.to-whoami-b.tls] + passthrough = true + + [tcp.services] + [tcp.services.whoami-a.loadBalancer] + [[tcp.services.whoami-a.loadBalancer.servers]] + address = "{{ .WhoamiA }}" + + [tcp.services.whoami-b.loadBalancer] + [[tcp.services.whoami-b.loadBalancer.servers]] + address = "{{ .WhoamiB }}" + +[tcp.middlewares] + [tcp.middlewares.allowing-ipwhitelist.ipWhiteList] + sourceRange = ["127.0.0.1/32"] + [tcp.middlewares.blocking-ipwhitelist.ipWhiteList] + sourceRange = ["127.127.127.127/32"] diff --git a/integration/grpc_test.go b/integration/grpc_test.go index c9a30b9ec..6dce232d7 100644 --- a/integration/grpc_test.go +++ b/integration/grpc_test.go @@ -8,10 +8,12 @@ import ( "math/rand" "net" "os" + "testing" "time" - "github.com/go-check/check" "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/helloworld" "github.com/traefik/traefik/v3/integration/try" "google.golang.org/grpc" @@ -29,16 +31,20 @@ const randCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567 // GRPCSuite tests suite. type GRPCSuite struct{ BaseSuite } +func TestGRPCSuite(t *testing.T) { + suite.Run(t, new(GRPCSuite)) +} + type myserver struct { stopStreamExample chan bool } -func (s *GRPCSuite) SetUpSuite(c *check.C) { +func (s *GRPCSuite) SetupSuite() { var err error LocalhostCert, err = os.ReadFile("./resources/tls/local.cert") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) LocalhostKey, err = os.ReadFile("./resources/tls/local.key") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) } func (s *myserver) SayHello(ctx context.Context, in *helloworld.HelloRequest) (*helloworld.HelloReply, error) { @@ -137,19 +143,18 @@ func callStreamExampleClientGRPC() (helloworld.Greeter_StreamExampleClient, func return t, closer, nil } -func (s *GRPCSuite) TestGRPC(c *check.C) { +func (s *GRPCSuite) TestGRPC() { lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := startGRPCServer(lis, &myserver{}) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config.toml", struct { + file := s.adaptFile("fixtures/grpc/config.toml", struct { CertContent string KeyContent string GRPCServerPort string @@ -159,79 +164,65 @@ func (s *GRPCSuite) TestGRPC(c *check.C) { GRPCServerPort: port, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var response string err = try.Do(1*time.Second, func() error { response, err = callHelloClientGRPC("World", true) return err }) - c.Assert(err, check.IsNil) - c.Assert(response, check.Equals, "Hello World") + assert.NoError(s.T(), err) + assert.Equal(s.T(), "Hello World", response) } -func (s *GRPCSuite) TestGRPCh2c(c *check.C) { +func (s *GRPCSuite) TestGRPCh2c() { lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := starth2cGRPCServer(lis, &myserver{}) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config_h2c.toml", struct { + file := s.adaptFile("fixtures/grpc/config_h2c.toml", struct { GRPCServerPort string }{ GRPCServerPort: port, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var response string err = try.Do(1*time.Second, func() error { response, err = callHelloClientGRPC("World", false) return err }) - c.Assert(err, check.IsNil) - c.Assert(response, check.Equals, "Hello World") + assert.NoError(s.T(), err) + assert.Equal(s.T(), "Hello World", response) } -func (s *GRPCSuite) TestGRPCh2cTermination(c *check.C) { +func (s *GRPCSuite) TestGRPCh2cTermination() { lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := starth2cGRPCServer(lis, &myserver{}) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config_h2c_termination.toml", struct { + file := s.adaptFile("fixtures/grpc/config_h2c_termination.toml", struct { CertContent string KeyContent string GRPCServerPort string @@ -241,40 +232,33 @@ func (s *GRPCSuite) TestGRPCh2cTermination(c *check.C) { GRPCServerPort: port, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var response string err = try.Do(1*time.Second, func() error { response, err = callHelloClientGRPC("World", true) return err }) - c.Assert(err, check.IsNil) - c.Assert(response, check.Equals, "Hello World") + assert.NoError(s.T(), err) + assert.Equal(s.T(), "Hello World", response) } -func (s *GRPCSuite) TestGRPCInsecure(c *check.C) { +func (s *GRPCSuite) TestGRPCInsecure() { lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := startGRPCServer(lis, &myserver{}) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config_insecure.toml", struct { + file := s.adaptFile("fixtures/grpc/config_insecure.toml", struct { CertContent string KeyContent string GRPCServerPort string @@ -284,44 +268,37 @@ func (s *GRPCSuite) TestGRPCInsecure(c *check.C) { GRPCServerPort: port, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var response string err = try.Do(1*time.Second, func() error { response, err = callHelloClientGRPC("World", true) return err }) - c.Assert(err, check.IsNil) - c.Assert(response, check.Equals, "Hello World") + assert.NoError(s.T(), err) + assert.Equal(s.T(), "Hello World", response) } -func (s *GRPCSuite) TestGRPCBuffer(c *check.C) { +func (s *GRPCSuite) TestGRPCBuffer() { stopStreamExample := make(chan bool) defer func() { stopStreamExample <- true }() lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := startGRPCServer(lis, &myserver{ stopStreamExample: stopStreamExample, }) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config.toml", struct { + file := s.adaptFile("fixtures/grpc/config.toml", struct { CertContent string KeyContent string GRPCServerPort string @@ -331,27 +308,21 @@ func (s *GRPCSuite) TestGRPCBuffer(c *check.C) { GRPCServerPort: port, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var client helloworld.Greeter_StreamExampleClient client, closer, err := callStreamExampleClientGRPC() defer func() { _ = closer() }() - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) received := make(chan bool) go func() { tr, err := client.Recv() - c.Assert(err, check.IsNil) - c.Assert(len(tr.GetData()), check.Equals, 512) + assert.NoError(s.T(), err) + assert.Len(s.T(), tr.GetData(), 512) received <- true }() @@ -363,25 +334,24 @@ func (s *GRPCSuite) TestGRPCBuffer(c *check.C) { return errors.New("failed to receive stream data") } }) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) } -func (s *GRPCSuite) TestGRPCBufferWithFlushInterval(c *check.C) { +func (s *GRPCSuite) TestGRPCBufferWithFlushInterval() { stopStreamExample := make(chan bool) lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := startGRPCServer(lis, &myserver{ stopStreamExample: stopStreamExample, }) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config.toml", struct { + file := s.adaptFile("fixtures/grpc/config.toml", struct { CertContent string KeyContent string GRPCServerPort string @@ -390,17 +360,11 @@ func (s *GRPCSuite) TestGRPCBufferWithFlushInterval(c *check.C) { KeyContent: string(LocalhostKey), GRPCServerPort: port, }) - defer os.Remove(file) - - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var client helloworld.Greeter_StreamExampleClient client, closer, err := callStreamExampleClientGRPC() @@ -408,13 +372,13 @@ func (s *GRPCSuite) TestGRPCBufferWithFlushInterval(c *check.C) { _ = closer() stopStreamExample <- true }() - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) received := make(chan bool) go func() { tr, err := client.Recv() - c.Assert(err, check.IsNil) - c.Assert(len(tr.GetData()), check.Equals, 512) + assert.NoError(s.T(), err) + assert.Len(s.T(), tr.GetData(), 512) received <- true }() @@ -426,22 +390,21 @@ func (s *GRPCSuite) TestGRPCBufferWithFlushInterval(c *check.C) { return errors.New("failed to receive stream data") } }) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) } -func (s *GRPCSuite) TestGRPCWithRetry(c *check.C) { +func (s *GRPCSuite) TestGRPCWithRetry() { lis, err := net.Listen("tcp", ":0") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) _, port, err := net.SplitHostPort(lis.Addr().String()) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) go func() { err := startGRPCServer(lis, &myserver{}) - c.Log(err) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) }() - file := s.adaptFile(c, "fixtures/grpc/config_retry.toml", struct { + file := s.adaptFile("fixtures/grpc/config_retry.toml", struct { CertContent string KeyContent string GRPCServerPort string @@ -451,23 +414,17 @@ func (s *GRPCSuite) TestGRPCWithRetry(c *check.C) { GRPCServerPort: port, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err = cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`127.0.0.1`)")) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) var response string err = try.Do(1*time.Second, func() error { response, err = callHelloClientGRPC("World", true) return err }) - c.Assert(err, check.IsNil) - c.Assert(response, check.Equals, "Hello World") + assert.NoError(s.T(), err) + assert.Equal(s.T(), "Hello World", response) } diff --git a/integration/headers_test.go b/integration/headers_test.go index d5c7a4f34..e47fe1d73 100644 --- a/integration/headers_test.go +++ b/integration/headers_test.go @@ -4,50 +4,45 @@ import ( "net" "net/http" "net/http/httptest" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) // Headers tests suite. type HeadersSuite struct{ BaseSuite } -func (s *HeadersSuite) TestSimpleConfiguration(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/headers/basic.toml")) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - // Expected a 404 as we did not configure anything - err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) +func TestHeadersSuite(t *testing.T) { + suite.Run(t, new(HeadersSuite)) } -func (s *HeadersSuite) TestReverseProxyHeaderRemoved(c *check.C) { - file := s.adaptFile(c, "fixtures/headers/remove_reverseproxy_headers.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) +func (s *HeadersSuite) TestSimpleConfiguration() { + s.traefikCmd(withConfigFile("fixtures/headers/basic.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + // Expected a 404 as we did not configure anything + err := try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) +} + +func (s *HeadersSuite) TestReverseProxyHeaderRemoved() { + file := s.adaptFile("fixtures/headers/remove_reverseproxy_headers.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, found := r.Header["X-Forwarded-Host"] - c.Assert(found, checker.True) + assert.True(s.T(), found) _, found = r.Header["Foo"] - c.Assert(found, checker.False) + assert.False(s.T(), found) _, found = r.Header["X-Forwarded-For"] - c.Assert(found, checker.False) + assert.False(s.T(), found) }) listener, err := net.Listen("tcp", "127.0.0.1:9000") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) ts := &httptest.Server{ Listener: listener, @@ -57,31 +52,25 @@ func (s *HeadersSuite) TestReverseProxyHeaderRemoved(c *check.C) { defer ts.Close() req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "test.localhost" req.Header = http.Header{ "Foo": {"bar"}, } err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *HeadersSuite) TestCorsResponses(c *check.C) { - file := s.adaptFile(c, "fixtures/headers/cors.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HeadersSuite) TestCorsResponses() { + file := s.adaptFile("fixtures/headers/cors.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) backend := startTestServer("9000", http.StatusOK, "") defer backend.Close() - err = try.GetRequest(backend.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest(backend.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) testCase := []struct { desc string @@ -147,30 +136,24 @@ func (s *HeadersSuite) TestCorsResponses(c *check.C) { for _, test := range testCase { req, err := http.NewRequest(test.method, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.reqHost req.Header = test.requestHeaders err = try.Request(req, 500*time.Millisecond, try.HasHeaderStruct(test.expected)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } -func (s *HeadersSuite) TestSecureHeadersResponses(c *check.C) { - file := s.adaptFile(c, "fixtures/headers/secure.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HeadersSuite) TestSecureHeadersResponses() { + file := s.adaptFile("fixtures/headers/secure.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) backend := startTestServer("9000", http.StatusOK, "") defer backend.Close() - err = try.GetRequest(backend.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest(backend.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) testCase := []struct { desc string @@ -190,36 +173,30 @@ func (s *HeadersSuite) TestSecureHeadersResponses(c *check.C) { for _, test := range testCase { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.reqHost err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasHeaderStruct(test.expected)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/api/rawdata", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.internalReqHost err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasHeaderStruct(test.expected)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } -func (s *HeadersSuite) TestMultipleSecureHeadersResponses(c *check.C) { - file := s.adaptFile(c, "fixtures/headers/secure_multiple.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HeadersSuite) TestMultipleSecureHeadersResponses() { + file := s.adaptFile("fixtures/headers/secure_multiple.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) backend := startTestServer("9000", http.StatusOK, "") defer backend.Close() - err = try.GetRequest(backend.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest(backend.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) testCase := []struct { desc string @@ -238,10 +215,10 @@ func (s *HeadersSuite) TestMultipleSecureHeadersResponses(c *check.C) { for _, test := range testCase { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.reqHost err = try.Request(req, 500*time.Millisecond, try.HasHeaderStruct(test.expected)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } diff --git a/integration/healthcheck_test.go b/integration/healthcheck_test.go index 79262fc89..1cfabb176 100644 --- a/integration/healthcheck_test.go +++ b/integration/healthcheck_test.go @@ -7,11 +7,13 @@ import ( "net/http" "os" "strings" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) // HealthCheck test suites. @@ -23,287 +25,272 @@ type HealthCheckSuite struct { whoami4IP string } -func (s *HealthCheckSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "healthcheck") - s.composeUp(c) - - s.whoami1IP = s.getComposeServiceIP(c, "whoami1") - s.whoami2IP = s.getComposeServiceIP(c, "whoami2") - s.whoami3IP = s.getComposeServiceIP(c, "whoami3") - s.whoami4IP = s.getComposeServiceIP(c, "whoami4") +func TestHealthCheckSuite(t *testing.T) { + suite.Run(t, new(HealthCheckSuite)) } -func (s *HealthCheckSuite) TestSimpleConfiguration(c *check.C) { - file := s.adaptFile(c, "fixtures/healthcheck/simple.toml", struct { +func (s *HealthCheckSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("healthcheck") + s.composeUp() + + s.whoami1IP = s.getComposeServiceIP("whoami1") + s.whoami2IP = s.getComposeServiceIP("whoami2") + s.whoami3IP = s.getComposeServiceIP("whoami3") + s.whoami4IP = s.getComposeServiceIP("whoami4") +} + +func (s *HealthCheckSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *HealthCheckSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/healthcheck/simple.toml", struct { Server1 string Server2 string }{s.whoami1IP, s.whoami2IP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`test.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`test.localhost`)")) + require.NoError(s.T(), err) frontendHealthReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/health", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendHealthReq.Host = "test.localhost" err = try.Request(frontendHealthReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Fix all whoami health to 500 client := &http.Client{} whoamiHosts := []string{s.whoami1IP, s.whoami2IP} for _, whoami := range whoamiHosts { statusInternalServerErrorReq, err := http.NewRequest(http.MethodPost, "http://"+whoami+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // Verify no backend service is available due to failing health checks err = try.Request(frontendHealthReq, 3*time.Second, try.StatusCodeIs(http.StatusServiceUnavailable)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Change one whoami health to 200 statusOKReq1, err := http.NewRequest(http.MethodPost, "http://"+s.whoami1IP+"/health", bytes.NewBufferString("200")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusOKReq1) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify frontend health : after err = try.Request(frontendHealthReq, 3*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendReq.Host = "test.localhost" // Check if whoami1 responds err = try.Request(frontendReq, 500*time.Millisecond, try.BodyContains(s.whoami1IP)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Check if the service with bad health check (whoami2) never respond. err = try.Request(frontendReq, 2*time.Second, try.BodyContains(s.whoami2IP)) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) // TODO validate : run on 80 resp, err := http.Get("http://127.0.0.1:8000/") // Expected a 404 as we did not configure anything - c.Assert(err, checker.IsNil) - c.Assert(resp.StatusCode, checker.Equals, http.StatusNotFound) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusNotFound, resp.StatusCode) } -func (s *HealthCheckSuite) TestMultipleEntrypoints(c *check.C) { - file := s.adaptFile(c, "fixtures/healthcheck/multiple-entrypoints.toml", struct { +func (s *HealthCheckSuite) TestMultipleEntrypoints() { + file := s.adaptFile("fixtures/healthcheck/multiple-entrypoints.toml", struct { Server1 string Server2 string }{s.whoami1IP, s.whoami2IP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // Wait for traefik - err = try.GetRequest("http://localhost:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`test.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`test.localhost`)")) + require.NoError(s.T(), err) // Check entrypoint http1 frontendHealthReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/health", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendHealthReq.Host = "test.localhost" - err = try.Request(frontendHealthReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err = try.Request(frontendHealthReq, 5*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) // Check entrypoint http2 frontendHealthReq, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:9000/health", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendHealthReq.Host = "test.localhost" - err = try.Request(frontendHealthReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err = try.Request(frontendHealthReq, 5*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) // Set the both whoami health to 500 client := &http.Client{} whoamiHosts := []string{s.whoami1IP, s.whoami2IP} for _, whoami := range whoamiHosts { statusInternalServerErrorReq, err := http.NewRequest(http.MethodPost, "http://"+whoami+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // Verify no backend service is available due to failing health checks err = try.Request(frontendHealthReq, 5*time.Second, try.StatusCodeIs(http.StatusServiceUnavailable)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // reactivate the whoami2 statusInternalServerOkReq, err := http.NewRequest(http.MethodPost, "http://"+s.whoami2IP+"/health", bytes.NewBufferString("200")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerOkReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontend1Req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontend1Req.Host = "test.localhost" frontend2Req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:9000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontend2Req.Host = "test.localhost" // Check if whoami1 never responds err = try.Request(frontend2Req, 2*time.Second, try.BodyContains(s.whoami1IP)) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) // Check if whoami1 never responds err = try.Request(frontend1Req, 2*time.Second, try.BodyContains(s.whoami1IP)) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) } -func (s *HealthCheckSuite) TestPortOverload(c *check.C) { +func (s *HealthCheckSuite) TestPortOverload() { // Set one whoami health to 200 client := &http.Client{} statusInternalServerErrorReq, err := http.NewRequest(http.MethodPost, "http://"+s.whoami1IP+"/health", bytes.NewBufferString("200")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - file := s.adaptFile(c, "fixtures/healthcheck/port_overload.toml", struct { + file := s.adaptFile("fixtures/healthcheck/port_overload.toml", struct { Server1 string }{s.whoami1IP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("Host(`test.localhost`)")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendHealthReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/health", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) frontendHealthReq.Host = "test.localhost" // We test bad gateway because we use an invalid port for the backend err = try.Request(frontendHealthReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusBadGateway)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Set one whoami health to 500 statusInternalServerErrorReq, err = http.NewRequest(http.MethodPost, "http://"+s.whoami1IP+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify no backend service is available due to failing health checks err = try.Request(frontendHealthReq, 3*time.Second, try.StatusCodeIs(http.StatusServiceUnavailable)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // Checks if all the loadbalancers created will correctly update the server status. -func (s *HealthCheckSuite) TestMultipleRoutersOnSameService(c *check.C) { - file := s.adaptFile(c, "fixtures/healthcheck/multiple-routers-one-same-service.toml", struct { +func (s *HealthCheckSuite) TestMultipleRoutersOnSameService() { + file := s.adaptFile("fixtures/healthcheck/multiple-routers-one-same-service.toml", struct { Server1 string }{s.whoami1IP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`test.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`test.localhost`)")) + require.NoError(s.T(), err) // Set whoami health to 200 to be sure to start with the wanted status client := &http.Client{} statusOkReq, err := http.NewRequest(http.MethodPost, "http://"+s.whoami1IP+"/health", bytes.NewBufferString("200")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusOkReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // check healthcheck on web1 entrypoint healthReqWeb1, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/health", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) healthReqWeb1.Host = "test.localhost" err = try.Request(healthReqWeb1, 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // check healthcheck on web2 entrypoint healthReqWeb2, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:9000/health", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) healthReqWeb2.Host = "test.localhost" err = try.Request(healthReqWeb2, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Set whoami health to 500 statusInternalServerErrorReq, err := http.NewRequest(http.MethodPost, "http://"+s.whoami1IP+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify no backend service is available due to failing health checks err = try.Request(healthReqWeb1, 3*time.Second, try.StatusCodeIs(http.StatusServiceUnavailable)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(healthReqWeb2, 3*time.Second, try.StatusCodeIs(http.StatusServiceUnavailable)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Change one whoami health to 200 statusOKReq1, err := http.NewRequest(http.MethodPost, "http://"+s.whoami1IP+"/health", bytes.NewBufferString("200")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusOKReq1) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify health check err = try.Request(healthReqWeb1, 3*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(healthReqWeb2, 3*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *HealthCheckSuite) TestPropagate(c *check.C) { - file := s.adaptFile(c, "fixtures/healthcheck/propagate.toml", struct { +func (s *HealthCheckSuite) TestPropagate() { + file := s.adaptFile("fixtures/healthcheck/propagate.toml", struct { Server1 string Server2 string Server3 string Server4 string }{s.whoami1IP, s.whoami2IP, s.whoami3IP, s.whoami4IP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`root.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`root.localhost`)")) + require.NoError(s.T(), err) rootReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) rootReq.Host = "root.localhost" err = try.Request(rootReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Bring whoami1 and whoami3 down client := http.Client{ @@ -313,9 +300,9 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { whoamiHosts := []string{s.whoami1IP, s.whoami3IP} for _, whoami := range whoamiHosts { statusInternalServerErrorReq, err := http.NewRequest(http.MethodPost, "http://"+whoami+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } try.Sleep(time.Second) @@ -327,19 +314,19 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { reachedServers := make(map[string]int) for i := 0; i < 4; i++ { resp, err := client.Do(rootReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if reachedServers[s.whoami4IP] > reachedServers[s.whoami2IP] { - c.Assert(string(body), checker.Contains, want2) + assert.Contains(s.T(), string(body), want2) reachedServers[s.whoami2IP]++ continue } if reachedServers[s.whoami2IP] > reachedServers[s.whoami4IP] { - c.Assert(string(body), checker.Contains, want4) + assert.Contains(s.T(), string(body), want4) reachedServers[s.whoami4IP]++ continue } @@ -356,48 +343,48 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { } } - c.Assert(reachedServers[s.whoami2IP], checker.Equals, 2) - c.Assert(reachedServers[s.whoami4IP], checker.Equals, 2) + assert.Equal(s.T(), 2, reachedServers[s.whoami2IP]) + assert.Equal(s.T(), 2, reachedServers[s.whoami4IP]) fooReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) fooReq.Host = "foo.localhost" // Verify load-balancing on foo still works, and that we're getting wsp2, wsp2, wsp2, wsp2, etc. want := `IP: ` + s.whoami2IP for i := 0; i < 4; i++ { resp, err := client.Do(fooReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - c.Assert(string(body), checker.Contains, want) + assert.Contains(s.T(), string(body), want) } barReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) barReq.Host = "bar.localhost" // Verify load-balancing on bar still works, and that we're getting wsp2, wsp2, wsp2, wsp2, etc. want = `IP: ` + s.whoami2IP for i := 0; i < 4; i++ { resp, err := client.Do(barReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - c.Assert(string(body), checker.Contains, want) + assert.Contains(s.T(), string(body), want) } // Bring whoami2 and whoami4 down whoamiHosts = []string{s.whoami2IP, s.whoami4IP} for _, whoami := range whoamiHosts { statusInternalServerErrorReq, err := http.NewRequest(http.MethodPost, "http://"+whoami+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusInternalServerErrorReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } try.Sleep(time.Second) @@ -405,25 +392,25 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { // Verify that everything is down, and that we get 503s everywhere. for i := 0; i < 2; i++ { resp, err := client.Do(rootReq) - c.Assert(err, checker.IsNil) - c.Assert(resp.StatusCode, checker.Equals, http.StatusServiceUnavailable) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusServiceUnavailable, resp.StatusCode) resp, err = client.Do(fooReq) - c.Assert(err, checker.IsNil) - c.Assert(resp.StatusCode, checker.Equals, http.StatusServiceUnavailable) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusServiceUnavailable, resp.StatusCode) resp, err = client.Do(barReq) - c.Assert(err, checker.IsNil) - c.Assert(resp.StatusCode, checker.Equals, http.StatusServiceUnavailable) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusServiceUnavailable, resp.StatusCode) } // Bring everything back up. whoamiHosts = []string{s.whoami1IP, s.whoami2IP, s.whoami3IP, s.whoami4IP} for _, whoami := range whoamiHosts { statusOKReq, err := http.NewRequest(http.MethodPost, "http://"+whoami+"/health", bytes.NewBufferString("200")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusOKReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } try.Sleep(time.Second) @@ -432,10 +419,10 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { reachedServers = make(map[string]int) for i := 0; i < 4; i++ { resp, err := client.Do(rootReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if strings.Contains(string(body), `IP: `+s.whoami1IP) { reachedServers[s.whoami1IP]++ @@ -458,19 +445,19 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { } } - c.Assert(reachedServers[s.whoami1IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami2IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami3IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami4IP], checker.Equals, 1) + assert.Equal(s.T(), 1, reachedServers[s.whoami1IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami2IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami3IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami4IP]) // Verify everything is up on foo router. reachedServers = make(map[string]int) for i := 0; i < 4; i++ { resp, err := client.Do(fooReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if strings.Contains(string(body), `IP: `+s.whoami1IP) { reachedServers[s.whoami1IP]++ @@ -493,19 +480,19 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { } } - c.Assert(reachedServers[s.whoami1IP], checker.Equals, 2) - c.Assert(reachedServers[s.whoami2IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami3IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami4IP], checker.Equals, 0) + assert.Equal(s.T(), 2, reachedServers[s.whoami1IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami2IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami3IP]) + assert.Equal(s.T(), 0, reachedServers[s.whoami4IP]) // Verify everything is up on bar router. reachedServers = make(map[string]int) for i := 0; i < 4; i++ { resp, err := client.Do(barReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if strings.Contains(string(body), `IP: `+s.whoami1IP) { reachedServers[s.whoami1IP]++ @@ -528,102 +515,87 @@ func (s *HealthCheckSuite) TestPropagate(c *check.C) { } } - c.Assert(reachedServers[s.whoami1IP], checker.Equals, 2) - c.Assert(reachedServers[s.whoami2IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami3IP], checker.Equals, 1) - c.Assert(reachedServers[s.whoami4IP], checker.Equals, 0) + assert.Equal(s.T(), 2, reachedServers[s.whoami1IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami2IP]) + assert.Equal(s.T(), 1, reachedServers[s.whoami3IP]) + assert.Equal(s.T(), 0, reachedServers[s.whoami4IP]) } -func (s *HealthCheckSuite) TestPropagateNoHealthCheck(c *check.C) { - file := s.adaptFile(c, "fixtures/healthcheck/propagate_no_healthcheck.toml", struct { +func (s *HealthCheckSuite) TestPropagateNoHealthCheck() { + file := s.adaptFile("fixtures/healthcheck/propagate_no_healthcheck.toml", struct { Server1 string }{s.whoami1IP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`noop.localhost`)"), try.BodyNotContains("Host(`root.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`noop.localhost`)"), try.BodyNotContains("Host(`root.localhost`)")) + require.NoError(s.T(), err) rootReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) rootReq.Host = "root.localhost" err = try.Request(rootReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *HealthCheckSuite) TestPropagateReload(c *check.C) { +func (s *HealthCheckSuite) TestPropagateReload() { // Setup a WSP service without the healthcheck enabled (wsp-service1) - withoutHealthCheck := s.adaptFile(c, "fixtures/healthcheck/reload_without_healthcheck.toml", struct { + withoutHealthCheck := s.adaptFile("fixtures/healthcheck/reload_without_healthcheck.toml", struct { Server1 string Server2 string }{s.whoami1IP, s.whoami2IP}) - defer os.Remove(withoutHealthCheck) - withHealthCheck := s.adaptFile(c, "fixtures/healthcheck/reload_with_healthcheck.toml", struct { + withHealthCheck := s.adaptFile("fixtures/healthcheck/reload_with_healthcheck.toml", struct { Server1 string Server2 string }{s.whoami1IP, s.whoami2IP}) - defer os.Remove(withHealthCheck) - cmd, display := s.traefikCmd(withConfigFile(withoutHealthCheck)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(withoutHealthCheck)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`root.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Host(`root.localhost`)")) + require.NoError(s.T(), err) // Allow one of the underlying services on it to fail all servers HC (whoami2) client := http.Client{ Timeout: 10 * time.Second, } statusOKReq, err := http.NewRequest(http.MethodPost, "http://"+s.whoami2IP+"/health", bytes.NewBufferString("500")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = client.Do(statusOKReq) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) rootReq, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) rootReq.Host = "root.localhost" // Check the failed service (whoami2) is getting requests, but answer 500 err = try.Request(rootReq, 500*time.Millisecond, try.StatusCodeIs(http.StatusServiceUnavailable)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Enable the healthcheck on the root WSP (wsp-service1) and let Traefik reload the config fr1, err := os.OpenFile(withoutHealthCheck, os.O_APPEND|os.O_WRONLY, 0o644) - c.Assert(fr1, checker.NotNil) - c.Assert(err, checker.IsNil) + assert.NotNil(s.T(), fr1) + require.NoError(s.T(), err) err = fr1.Truncate(0) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) fr2, err := os.ReadFile(withHealthCheck) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = fmt.Fprint(fr1, string(fr2)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = fr1.Close() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - try.Sleep(1 * time.Second) + // Waiting for the reflected change. + err = try.Request(rootReq, 5*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) // Check the failed service (whoami2) is not getting requests wantIPs := []string{s.whoami1IP, s.whoami1IP, s.whoami1IP, s.whoami1IP} for _, ip := range wantIPs { - want := "IP: " + ip - resp, err := client.Do(rootReq) - c.Assert(err, checker.IsNil) - - body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) - - c.Assert(string(body), checker.Contains, want) + err = try.Request(rootReq, 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("IP: "+ip)) + require.NoError(s.T(), err) } } diff --git a/integration/hostresolver_test.go b/integration/hostresolver_test.go index e69e33dd9..6d6e3965a 100644 --- a/integration/hostresolver_test.go +++ b/integration/hostresolver_test.go @@ -2,27 +2,33 @@ package integration import ( "net/http" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type HostResolverSuite struct{ BaseSuite } -func (s *HostResolverSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "hostresolver") - s.composeUp(c) +func TestHostResolverSuite(t *testing.T) { + suite.Run(t, new(HostResolverSuite)) } -func (s *HostResolverSuite) TestSimpleConfig(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/simple_hostresolver.toml")) - defer display(c) +func (s *HostResolverSuite) SetupSuite() { + s.BaseSuite.SetupSuite() - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.createComposeProject("hostresolver") + s.composeUp() +} + +func (s *HostResolverSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *HostResolverSuite) TestSimpleConfig() { + s.traefikCmd(withConfigFile("fixtures/simple_hostresolver.toml")) testCase := []struct { desc string @@ -43,10 +49,10 @@ func (s *HostResolverSuite) TestSimpleConfig(c *check.C) { for _, test := range testCase { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.host - err = try.Request(req, 1*time.Second, try.StatusCodeIs(test.status), try.HasBody()) - c.Assert(err, checker.IsNil) + err = try.Request(req, 5*time.Second, try.StatusCodeIs(test.status), try.HasBody()) + require.NoError(s.T(), err) } } diff --git a/integration/http_test.go b/integration/http_test.go index 6e28fa2d7..5d9bff4dc 100644 --- a/integration/http_test.go +++ b/integration/http_test.go @@ -5,28 +5,27 @@ import ( "net" "net/http" "net/http/httptest" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/config/dynamic" - checker "github.com/vdemeester/shakers" ) type HTTPSuite struct{ BaseSuite } -func (s *HTTPSuite) TestSimpleConfiguration(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/http/simple.toml")) - defer display(c) +func TestHTTPSuite(t *testing.T) { + suite.Run(t, new(HTTPSuite)) +} - err := cmd.Start() - c.Assert(err, checker.IsNil) - - defer s.killCmd(cmd) +func (s *HTTPSuite) TestSimpleConfiguration() { + s.traefikCmd(withConfigFile("fixtures/http/simple.toml")) // Expect a 404 as we configured nothing. - err = try.GetRequest("http://127.0.0.1:8000/", time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) // Provide a configuration, fetched by Traefik provider. configuration := &dynamic.Configuration{ @@ -55,14 +54,14 @@ func (s *HTTPSuite) TestSimpleConfiguration(c *check.C) { } configData, err := json.Marshal(configuration) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) server := startTestServerWithResponse(configData) defer server.Close() // Expect configuration to be applied. err = try.GetRequest("http://127.0.0.1:9090/api/rawdata", 3*time.Second, try.BodyContains("routerHTTP@http", "serviceHTTP@http", "http://bacon:80")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } func startTestServerWithResponse(response []byte) (ts *httptest.Server) { diff --git a/integration/https_test.go b/integration/https_test.go index 89a88c880..e4a68dfb8 100644 --- a/integration/https_test.go +++ b/integration/https_test.go @@ -8,34 +8,36 @@ import ( "net/http" "net/http/httptest" "os" + "testing" "time" "github.com/BurntSushi/toml" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/config/dynamic" traefiktls "github.com/traefik/traefik/v3/pkg/tls" - checker "github.com/vdemeester/shakers" + "github.com/traefik/traefik/v3/pkg/types" ) // HTTPSSuite tests suite. type HTTPSSuite struct{ BaseSuite } +func TestHTTPSSuite(t *testing.T) { + suite.Run(t, &HTTPSSuite{}) +} + // TestWithSNIConfigHandshake involves a client sending a SNI hostname of // "snitest.com", which happens to match the CN of 'snitest.com.crt'. The test // verifies that traefik presents the correct certificate. -func (s *HTTPSSuite) TestWithSNIConfigHandshake(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HTTPSSuite) TestWithSNIConfigHandshake() { + file := s.adaptFile("fixtures/https/https_sni.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.org`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.org`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -43,35 +45,30 @@ func (s *HTTPSSuite) TestWithSNIConfigHandshake(c *check.C) { NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") defer conn.Close() err = conn.Handshake() - c.Assert(err, checker.IsNil, check.Commentf("TLS handshake error")) + assert.NoError(s.T(), err, "TLS handshake error") cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("snitest.com") - c.Assert(err, checker.IsNil, check.Commentf("certificate did not match SNI servername")) + assert.NoError(s.T(), err, "certificate did not match SNI servername") proto := conn.ConnectionState().NegotiatedProtocol - c.Assert(proto, checker.Equals, "h2") + assert.Equal(s.T(), "h2", proto) } // TestWithSNIConfigRoute involves a client sending HTTPS requests with // SNI hostnames of "snitest.org" and "snitest.com". The test verifies // that traefik routes the requests to the expected backends. -func (s *HTTPSSuite) TestWithSNIConfigRoute(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HTTPSSuite) TestWithSNIConfigRoute() { + file := s.adaptFile("fixtures/https/https_sni.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) + require.NoError(s.T(), err) backend1 := startTestServer("9010", http.StatusNoContent, "") backend2 := startTestServer("9020", http.StatusResetContent, "") @@ -79,9 +76,9 @@ func (s *HTTPSSuite) TestWithSNIConfigRoute(c *check.C) { defer backend2.Close() err = try.GetRequest(backend1.URL, 1*time.Second, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest(backend2.URL, 1*time.Second, try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tr1 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -97,37 +94,33 @@ func (s *HTTPSSuite) TestWithSNIConfigRoute(c *check.C) { } req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr1.TLSClientConfig.ServerName req.Header.Set("Host", tr1.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, tr1, try.HasCn(tr1.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr2.TLSClientConfig.ServerName req.Header.Set("Host", tr2.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, tr2, try.HasCn(tr2.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // TestWithTLSOptions verifies that traefik routes the requests with the associated tls options. -func (s *HTTPSSuite) TestWithTLSOptions(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_tls_options.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithTLSOptions() { + file := s.adaptFile("fixtures/https/https_tls_options.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) + require.NoError(s.T(), err) backend1 := startTestServer("9010", http.StatusNoContent, "") backend2 := startTestServer("9020", http.StatusResetContent, "") @@ -135,9 +128,9 @@ func (s *HTTPSSuite) TestWithTLSOptions(c *check.C) { defer backend2.Close() err = try.GetRequest(backend1.URL, 1*time.Second, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest(backend2.URL, 1*time.Second, try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tr1 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -165,27 +158,27 @@ func (s *HTTPSSuite) TestWithTLSOptions(c *check.C) { // With valid TLS options and request req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr1.TLSClientConfig.ServerName req.Header.Set("Host", tr1.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, tr1, try.HasCn(tr1.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // With a valid TLS version req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr2.TLSClientConfig.ServerName req.Header.Set("Host", tr2.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 3*time.Second, tr2, try.HasCn(tr2.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // With a bad TLS version req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr3.TLSClientConfig.ServerName req.Header.Set("Host", tr3.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") @@ -193,27 +186,23 @@ func (s *HTTPSSuite) TestWithTLSOptions(c *check.C) { Transport: tr3, } _, err = client.Do(req) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, "tls: no supported versions satisfy MinVersion and MaxVersion") + assert.Error(s.T(), err) + assert.Contains(s.T(), err.Error(), "tls: no supported versions satisfy MinVersion and MaxVersion") // with unknown tls option err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("unknown TLS options: unknown@file")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // TestWithConflictingTLSOptions checks that routers with same SNI but different TLS options get fallbacked to the default TLS options. -func (s *HTTPSSuite) TestWithConflictingTLSOptions(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_tls_options.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithConflictingTLSOptions() { + file := s.adaptFile("fixtures/https/https_tls_options.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.net`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.net`)")) + require.NoError(s.T(), err) backend1 := startTestServer("9010", http.StatusNoContent, "") backend2 := startTestServer("9020", http.StatusResetContent, "") @@ -221,9 +210,9 @@ func (s *HTTPSSuite) TestWithConflictingTLSOptions(c *check.C) { defer backend2.Close() err = try.GetRequest(backend1.URL, 1*time.Second, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest(backend2.URL, 1*time.Second, try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tr4 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -243,17 +232,17 @@ func (s *HTTPSSuite) TestWithConflictingTLSOptions(c *check.C) { // With valid TLS options and request req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = trDefault.TLSClientConfig.ServerName req.Header.Set("Host", trDefault.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, trDefault, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // With a bad TLS version req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr4.TLSClientConfig.ServerName req.Header.Set("Host", tr4.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") @@ -261,29 +250,24 @@ func (s *HTTPSSuite) TestWithConflictingTLSOptions(c *check.C) { Transport: tr4, } _, err = client.Do(req) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, "tls: no supported versions satisfy MinVersion and MaxVersion") + assert.ErrorContains(s.T(), err, "tls: no supported versions satisfy MinVersion and MaxVersion") // with unknown tls option err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains(fmt.Sprintf("found different TLS options for routers on the same host %v, so using the default TLS options instead", tr4.TLSClientConfig.ServerName))) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // TestWithSNIStrictNotMatchedRequest involves a client sending a SNI hostname of // "snitest.org", which does not match the CN of 'snitest.com.crt'. The test // verifies that traefik closes the connection. -func (s *HTTPSSuite) TestWithSNIStrictNotMatchedRequest(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni_strict.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithSNIStrictNotMatchedRequest() { + file := s.adaptFile("fixtures/https/https_sni_strict.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -292,24 +276,20 @@ func (s *HTTPSSuite) TestWithSNIStrictNotMatchedRequest(c *check.C) { } // Connection with no matching certificate should fail _, err = tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.NotNil, check.Commentf("failed to connect to server")) + assert.Error(s.T(), err, "failed to connect to server") } // TestWithDefaultCertificate involves a client sending a SNI hostname of // "snitest.org", which does not match the CN of 'snitest.com.crt'. The test // verifies that traefik returns the default certificate. -func (s *HTTPSSuite) TestWithDefaultCertificate(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni_default_cert.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithDefaultCertificate() { + file := s.adaptFile("fixtures/https/https_sni_default_cert.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -317,71 +297,63 @@ func (s *HTTPSSuite) TestWithDefaultCertificate(c *check.C) { NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") defer conn.Close() err = conn.Handshake() - c.Assert(err, checker.IsNil, check.Commentf("TLS handshake error")) + assert.NoError(s.T(), err, "TLS handshake error") cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("snitest.com") - c.Assert(err, checker.IsNil, check.Commentf("server did not serve correct default certificate")) + assert.NoError(s.T(), err, "server did not serve correct default certificate") proto := cs.NegotiatedProtocol - c.Assert(proto, checker.Equals, "h2") + assert.Equal(s.T(), "h2", proto) } // TestWithDefaultCertificateNoSNI involves a client sending a request with no ServerName // which does not match the CN of 'snitest.com.crt'. The test // verifies that traefik returns the default certificate. -func (s *HTTPSSuite) TestWithDefaultCertificateNoSNI(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni_default_cert.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithDefaultCertificateNoSNI() { + file := s.adaptFile("fixtures/https/https_sni_default_cert.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") defer conn.Close() err = conn.Handshake() - c.Assert(err, checker.IsNil, check.Commentf("TLS handshake error")) + assert.NoError(s.T(), err, "TLS handshake error") cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("snitest.com") - c.Assert(err, checker.IsNil, check.Commentf("server did not serve correct default certificate")) + assert.NoError(s.T(), err, "server did not serve correct default certificate") proto := cs.NegotiatedProtocol - c.Assert(proto, checker.Equals, "h2") + assert.Equal(s.T(), "h2", proto) } // TestWithOverlappingCertificate involves a client sending a SNI hostname of // "www.snitest.com", which matches the CN of two static certificates: // 'wildcard.snitest.com.crt', and `www.snitest.com.crt`. The test // verifies that traefik returns the non-wildcard certificate. -func (s *HTTPSSuite) TestWithOverlappingStaticCertificate(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni_default_cert.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithOverlappingStaticCertificate() { + file := s.adaptFile("fixtures/https/https_sni_default_cert.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -389,36 +361,32 @@ func (s *HTTPSSuite) TestWithOverlappingStaticCertificate(c *check.C) { NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") defer conn.Close() err = conn.Handshake() - c.Assert(err, checker.IsNil, check.Commentf("TLS handshake error")) + assert.NoError(s.T(), err, "TLS handshake error") cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("www.snitest.com") - c.Assert(err, checker.IsNil, check.Commentf("server did not serve correct default certificate")) + assert.NoError(s.T(), err, "server did not serve correct default certificate") proto := cs.NegotiatedProtocol - c.Assert(proto, checker.Equals, "h2") + assert.Equal(s.T(), "h2", proto) } // TestWithOverlappingCertificate involves a client sending a SNI hostname of // "www.snitest.com", which matches the CN of two dynamic certificates: // 'wildcard.snitest.com.crt', and `www.snitest.com.crt`. The test // verifies that traefik returns the non-wildcard certificate. -func (s *HTTPSSuite) TestWithOverlappingDynamicCertificate(c *check.C) { - file := s.adaptFile(c, "fixtures/https/dynamic_https_sni_default_cert.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithOverlappingDynamicCertificate() { + file := s.adaptFile("fixtures/https/dynamic_https_sni_default_cert.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -426,34 +394,30 @@ func (s *HTTPSSuite) TestWithOverlappingDynamicCertificate(c *check.C) { NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") defer conn.Close() err = conn.Handshake() - c.Assert(err, checker.IsNil, check.Commentf("TLS handshake error")) + assert.NoError(s.T(), err, "TLS handshake error") cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("www.snitest.com") - c.Assert(err, checker.IsNil, check.Commentf("server did not serve correct default certificate")) + assert.NoError(s.T(), err, "server did not serve correct default certificate") proto := cs.NegotiatedProtocol - c.Assert(proto, checker.Equals, "h2") + assert.Equal(s.T(), "h2", proto) } // TestWithClientCertificateAuthentication // The client can send a certificate signed by a CA trusted by the server but it's optional. -func (s *HTTPSSuite) TestWithClientCertificateAuthentication(c *check.C) { - file := s.adaptFile(c, "fixtures/https/clientca/https_1ca1config.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + +func (s *HTTPSSuite) TestWithClientCertificateAuthentication() { + file := s.adaptFile("fixtures/https/clientca/https_1ca1config.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.org`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.org`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -462,25 +426,25 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthentication(c *check.C) { } // Connection without client certificate should fail _, err = tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("should be allowed to connect to server")) + assert.NoError(s.T(), err, "should be allowed to connect to server") // Connect with client certificate signed by ca1 cert, err := tls.LoadX509KeyPair("fixtures/https/clientca/client1.crt", "fixtures/https/clientca/client1.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") conn.Close() // Connect with client certificate not signed by ca1 cert, err = tls.LoadX509KeyPair("fixtures/https/snitest.org.cert", "fixtures/https/snitest.org.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) conn, err = tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") conn.Close() @@ -491,16 +455,17 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthentication(c *check.C) { Certificates: []tls.Certificate{}, } cert, err = tls.LoadX509KeyPair("fixtures/https/clientca/client2.crt", "fixtures/https/clientca/client2.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) _, err = tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("should be allowed to connect to server")) + assert.NoError(s.T(), err, "should be allowed to connect to server") } // TestWithClientCertificateAuthentication // Use two CA:s and test that clients with client signed by either of them can connect. -func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check.C) { + +func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs() { server1 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) { _, _ = rw.Write([]byte("server1")) })) server2 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) { _, _ = rw.Write([]byte("server2")) })) defer func() { @@ -508,7 +473,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check server2.Close() }() - file := s.adaptFile(c, "fixtures/https/clientca/https_2ca1config.toml", struct { + file := s.adaptFile("fixtures/https/clientca/https_2ca1config.toml", struct { Server1 string Server2 string }{ @@ -516,19 +481,14 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check Server2: server2.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "snitest.com" tlsConfig := &tls.Config{ @@ -544,15 +504,15 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check // Connection without client certificate should fail _, err = client.Do(req) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) cert, err := tls.LoadX509KeyPair("fixtures/https/clientca/client1.crt", "fixtures/https/clientca/client1.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) // Connect with client signed by ca1 _, err = client.Do(req) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Connect with client signed by ca2 tlsConfig = &tls.Config{ @@ -562,7 +522,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check } cert, err = tls.LoadX509KeyPair("fixtures/https/clientca/client2.crt", "fixtures/https/clientca/client2.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) client = http.Client{ @@ -572,7 +532,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check // Connect with client signed by ca1 _, err = client.Do(req) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Connect with client signed by ca3 should fail tlsConfig = &tls.Config{ @@ -582,7 +542,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check } cert, err = tls.LoadX509KeyPair("fixtures/https/clientca/client3.crt", "fixtures/https/clientca/client3.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) client = http.Client{ @@ -592,12 +552,13 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAs(c *check // Connect with client signed by ca1 _, err = client.Do(req) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) } // TestWithClientCertificateAuthentication // Use two CA:s in two different files and test that clients with client signed by either of them can connect. -func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleFiles(c *check.C) { + +func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleFiles() { server1 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) { _, _ = rw.Write([]byte("server1")) })) server2 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) { _, _ = rw.Write([]byte("server2")) })) defer func() { @@ -605,26 +566,21 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleF server2.Close() }() - file := s.adaptFile(c, "fixtures/https/clientca/https_2ca2config.toml", struct { + file := s.adaptFile("fixtures/https/clientca/https_2ca2config.toml", struct { Server1 string Server2 string }{ Server1: server1.URL, Server2: server2.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`snitest.org`)")) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "snitest.com" tlsConfig := &tls.Config{ @@ -640,15 +596,15 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleF // Connection without client certificate should fail _, err = client.Do(req) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) // Connect with client signed by ca1 cert, err := tls.LoadX509KeyPair("fixtures/https/clientca/client1.crt", "fixtures/https/clientca/client1.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) _, err = client.Do(req) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Connect with client signed by ca2 tlsConfig = &tls.Config{ @@ -658,7 +614,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleF } cert, err = tls.LoadX509KeyPair("fixtures/https/clientca/client2.crt", "fixtures/https/clientca/client2.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) client = http.Client{ @@ -667,7 +623,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleF } _, err = client.Do(req) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Connect with client signed by ca3 should fail tlsConfig = &tls.Config{ @@ -677,7 +633,7 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleF } cert, err = tls.LoadX509KeyPair("fixtures/https/clientca/client3.crt", "fixtures/https/clientca/client3.key") - c.Assert(err, checker.IsNil, check.Commentf("unable to load client certificate and key")) + assert.NoError(s.T(), err, "unable to load client certificate and key") tlsConfig.Certificates = append(tlsConfig.Certificates, cert) client = http.Client{ @@ -686,51 +642,41 @@ func (s *HTTPSSuite) TestWithClientCertificateAuthenticationMultipleCAsMultipleF } _, err = client.Do(req) - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) } -func (s *HTTPSSuite) TestWithRootCAsContentForHTTPSOnBackend(c *check.C) { +func (s *HTTPSSuite) TestWithRootCAsContentForHTTPSOnBackend() { backend := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) })) defer backend.Close() - file := s.adaptFile(c, "fixtures/https/rootcas/https.toml", struct{ BackendHost string }{backend.URL}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + file := s.adaptFile("fixtures/https/rootcas/https.toml", struct{ BackendHost string }{backend.URL}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains(backend.URL)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains(backend.URL)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8081/ping", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *HTTPSSuite) TestWithRootCAsFileForHTTPSOnBackend(c *check.C) { +func (s *HTTPSSuite) TestWithRootCAsFileForHTTPSOnBackend() { backend := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) })) defer backend.Close() - file := s.adaptFile(c, "fixtures/https/rootcas/https_with_file.toml", struct{ BackendHost string }{backend.URL}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + file := s.adaptFile("fixtures/https/rootcas/https_with_file.toml", struct{ BackendHost string }{backend.URL}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains(backend.URL)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains(backend.URL)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8081/ping", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } func startTestServer(port string, statusCode int, textContent string) (ts *httptest.Server) { @@ -757,20 +703,14 @@ func startTestServer(port string, statusCode int, textContent string) (ts *httpt // SNI hostnames of "snitest.org" and "snitest.com". The test verifies // that traefik routes the requests to the expected backends thanks to given certificate if possible // otherwise thanks to the default one. -func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithNoChange(c *check.C) { - dynamicConfFileName := s.adaptFile(c, "fixtures/https/dynamic_https.toml", struct{}{}) - defer os.Remove(dynamicConfFileName) - confFileName := s.adaptFile(c, "fixtures/https/dynamic_https_sni.toml", struct { +func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithNoChange() { + dynamicConfFileName := s.adaptFile("fixtures/https/dynamic_https.toml", struct{}{}) + confFileName := s.adaptFile("fixtures/https/dynamic_https_sni.toml", struct { DynamicConfFileName string }{ DynamicConfFileName: dynamicConfFileName, }) - defer os.Remove(confFileName) - cmd, display := s.traefikCmd(withConfigFile(confFileName)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(confFileName)) tr1 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -787,8 +727,8 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithNoChange(c *check.C) { } // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`"+tr1.TLSClientConfig.ServerName+"`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`"+tr1.TLSClientConfig.ServerName+"`)")) + require.NoError(s.T(), err) backend1 := startTestServer("9010", http.StatusNoContent, "") backend2 := startTestServer("9020", http.StatusResetContent, "") @@ -796,29 +736,29 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithNoChange(c *check.C) { defer backend2.Close() err = try.GetRequest(backend1.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest(backend2.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr1.TLSClientConfig.ServerName req.Header.Set("Host", tr1.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") // snitest.org certificate must be used yet && Expected a 204 (from backend1) err = try.RequestWithTransport(req, 30*time.Second, tr1, try.HasCn(tr1.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr2.TLSClientConfig.ServerName req.Header.Set("Host", tr2.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") // snitest.com certificate does not exist, default certificate has to be used && Expected a 205 (from backend2) err = try.RequestWithTransport(req, 30*time.Second, tr2, try.HasCn("TRAEFIK DEFAULT CERT"), try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // TestWithSNIDynamicConfigRouteWithChange involves a client sending HTTPS requests with @@ -826,20 +766,15 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithNoChange(c *check.C) { // that traefik updates its configuration when the HTTPS configuration is modified and // it routes the requests to the expected backends thanks to given certificate if possible // otherwise thanks to the default one. -func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithChange(c *check.C) { - dynamicConfFileName := s.adaptFile(c, "fixtures/https/dynamic_https.toml", struct{}{}) - defer os.Remove(dynamicConfFileName) - confFileName := s.adaptFile(c, "fixtures/https/dynamic_https_sni.toml", struct { + +func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithChange() { + dynamicConfFileName := s.adaptFile("fixtures/https/dynamic_https.toml", struct{}{}) + confFileName := s.adaptFile("fixtures/https/dynamic_https_sni.toml", struct { DynamicConfFileName string }{ DynamicConfFileName: dynamicConfFileName, }) - defer os.Remove(confFileName) - cmd, display := s.traefikCmd(withConfigFile(confFileName)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(confFileName)) tr1 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -856,8 +791,8 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithChange(c *check.C) { } // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`"+tr2.TLSClientConfig.ServerName+"`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`"+tr2.TLSClientConfig.ServerName+"`)")) + require.NoError(s.T(), err) backend1 := startTestServer("9010", http.StatusNoContent, "") backend2 := startTestServer("9020", http.StatusResetContent, "") @@ -865,30 +800,30 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithChange(c *check.C) { defer backend2.Close() err = try.GetRequest(backend1.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest(backend2.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Change certificates configuration file content - modifyCertificateConfFileContent(c, tr1.TLSClientConfig.ServerName, dynamicConfFileName) + s.modifyCertificateConfFileContent(tr1.TLSClientConfig.ServerName, dynamicConfFileName) req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr1.TLSClientConfig.ServerName req.Header.Set("Host", tr1.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, tr1, try.HasCn(tr1.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr2.TLSClientConfig.ServerName req.Header.Set("Host", tr2.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, tr2, try.HasCn("TRAEFIK DEFAULT CERT"), try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // TestWithSNIDynamicConfigRouteWithTlsConfigurationDeletion involves a client sending HTTPS requests with @@ -896,20 +831,15 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithChange(c *check.C) { // that traefik updates its configuration when the HTTPS configuration is modified, even if it totally deleted, and // it routes the requests to the expected backends thanks to given certificate if possible // otherwise thanks to the default one. -func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithTlsConfigurationDeletion(c *check.C) { - dynamicConfFileName := s.adaptFile(c, "fixtures/https/dynamic_https.toml", struct{}{}) - defer os.Remove(dynamicConfFileName) - confFileName := s.adaptFile(c, "fixtures/https/dynamic_https_sni.toml", struct { + +func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithTlsConfigurationDeletion() { + dynamicConfFileName := s.adaptFile("fixtures/https/dynamic_https.toml", struct{}{}) + confFileName := s.adaptFile("fixtures/https/dynamic_https_sni.toml", struct { DynamicConfFileName string }{ DynamicConfFileName: dynamicConfFileName, }) - defer os.Remove(confFileName) - cmd, display := s.traefikCmd(withConfigFile(confFileName)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(confFileName)) tr2 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -919,41 +849,41 @@ func (s *HTTPSSuite) TestWithSNIDynamicConfigRouteWithTlsConfigurationDeletion(c } // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`"+tr2.TLSClientConfig.ServerName+"`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`"+tr2.TLSClientConfig.ServerName+"`)")) + require.NoError(s.T(), err) backend2 := startTestServer("9020", http.StatusResetContent, "") defer backend2.Close() err = try.GetRequest(backend2.URL, 500*time.Millisecond, try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = tr2.TLSClientConfig.ServerName req.Header.Set("Host", tr2.TLSClientConfig.ServerName) req.Header.Set("Accept", "*/*") err = try.RequestWithTransport(req, 30*time.Second, tr2, try.HasCn(tr2.TLSClientConfig.ServerName), try.StatusCodeIs(http.StatusResetContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Change certificates configuration file content - modifyCertificateConfFileContent(c, "", dynamicConfFileName) + s.modifyCertificateConfFileContent("", dynamicConfFileName) err = try.RequestWithTransport(req, 30*time.Second, tr2, try.HasCn("TRAEFIK DEFAULT CERT"), try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } // modifyCertificateConfFileContent replaces the content of a HTTPS configuration file. -func modifyCertificateConfFileContent(c *check.C, certFileName, confFileName string) { +func (s *HTTPSSuite) modifyCertificateConfFileContent(certFileName, confFileName string) { file, err := os.OpenFile("./"+confFileName, os.O_WRONLY, os.ModeExclusive) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) defer func() { file.Close() }() err = file.Truncate(0) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // If certificate file is not provided, just truncate the configuration file if len(certFileName) > 0 { @@ -962,8 +892,8 @@ func modifyCertificateConfFileContent(c *check.C, certFileName, confFileName str Certificates: []*traefiktls.CertAndStores{ { Certificate: traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent("fixtures/https/" + certFileName + ".cert"), - KeyFile: traefiktls.FileOrContent("fixtures/https/" + certFileName + ".key"), + CertFile: types.FileOrContent("fixtures/https/" + certFileName + ".cert"), + KeyFile: types.FileOrContent("fixtures/https/" + certFileName + ".key"), }, }, }, @@ -972,25 +902,20 @@ func modifyCertificateConfFileContent(c *check.C, certFileName, confFileName str var confBuffer bytes.Buffer err := toml.NewEncoder(&confBuffer).Encode(tlsConf) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = file.Write(confBuffer.Bytes()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } -func (s *HTTPSSuite) TestEntryPointHttpsRedirectAndPathModification(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_redirect.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HTTPSSuite) TestEntryPointHttpsRedirectAndPathModification() { + file := s.adaptFile("fixtures/https/https_redirect.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.BodyContains("Host(`example.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.BodyContains("Host(`example.com`)")) + require.NoError(s.T(), err) client := &http.Client{ CheckRedirect: func(req *http.Request, via []*http.Request) error { @@ -1064,17 +989,17 @@ func (s *HTTPSSuite) TestEntryPointHttpsRedirectAndPathModification(c *check.C) sourceURL := fmt.Sprintf("http://127.0.0.1:8888%s", test.path) for _, host := range test.hosts { req, err := http.NewRequest(http.MethodGet, sourceURL, nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = host resp, err := client.Do(req) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp.Body.Close() location := resp.Header.Get("Location") expected := "https://" + net.JoinHostPort(host, "8443") + test.path - c.Assert(location, checker.Equals, expected) + assert.Equal(s.T(), expected, location) } } } @@ -1082,18 +1007,13 @@ func (s *HTTPSSuite) TestEntryPointHttpsRedirectAndPathModification(c *check.C) // TestWithSNIDynamicCaseInsensitive involves a client sending a SNI hostname of // "bar.www.snitest.com", which matches the DNS SAN of '*.WWW.SNITEST.COM'. The test // verifies that traefik presents the correct certificate. -func (s *HTTPSSuite) TestWithSNIDynamicCaseInsensitive(c *check.C) { - file := s.adaptFile(c, "fixtures/https/https_sni_case_insensitive_dynamic.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *HTTPSSuite) TestWithSNIDynamicCaseInsensitive() { + file := s.adaptFile("fixtures/https/https_sni_case_insensitive_dynamic.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("HostRegexp(`[a-z1-9-]+\\\\.www\\\\.snitest\\\\.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("HostRegexp(`[a-z1-9-]+\\\\.www\\\\.snitest\\\\.com`)")) + require.NoError(s.T(), err) tlsConfig := &tls.Config{ InsecureSkipVerify: true, @@ -1101,22 +1021,22 @@ func (s *HTTPSSuite) TestWithSNIDynamicCaseInsensitive(c *check.C) { NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) + assert.NoError(s.T(), err, "failed to connect to server") defer conn.Close() err = conn.Handshake() - c.Assert(err, checker.IsNil, check.Commentf("TLS handshake error")) + assert.NoError(s.T(), err, "TLS handshake error") cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("*.WWW.SNITEST.COM") - c.Assert(err, checker.IsNil, check.Commentf("certificate did not match SNI servername")) + assert.NoError(s.T(), err, "certificate did not match SNI servername") proto := conn.ConnectionState().NegotiatedProtocol - c.Assert(proto, checker.Equals, "h2") + assert.Equal(s.T(), "h2", proto) } // TestWithDomainFronting verify the domain fronting behavior -func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) { +func (s *HTTPSSuite) TestWithDomainFronting() { backend := startTestServer("9010", http.StatusOK, "server1") defer backend.Close() backend2 := startTestServer("9020", http.StatusOK, "server2") @@ -1124,17 +1044,12 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) { backend3 := startTestServer("9030", http.StatusOK, "server3") defer backend3.Close() - file := s.adaptFile(c, "fixtures/https/https_domain_fronting.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + file := s.adaptFile("fixtures/https/https_domain_fronting.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`site1.www.snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`site1.www.snitest.com`)")) + require.NoError(s.T(), err) testCases := []struct { desc string @@ -1222,34 +1137,29 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) { test := test req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.hostHeader err = try.RequestWithTransport(req, 500*time.Millisecond, &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true, ServerName: test.serverName}}, try.StatusCodeIs(test.expectedStatusCode), try.BodyContains(test.expectedContent)) if test.expectedError { - c.Assert(err, checker.NotNil) + assert.Error(s.T(), err) } else { - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } } // TestWithInvalidTLSOption verifies the behavior when using an invalid tlsOption configuration. -func (s *HTTPSSuite) TestWithInvalidTLSOption(c *check.C) { +func (s *HTTPSSuite) TestWithInvalidTLSOption() { backend := startTestServer("9010", http.StatusOK, "server1") defer backend.Close() - file := s.adaptFile(c, "fixtures/https/https_invalid_tls_options.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + file := s.adaptFile("fixtures/https/https_invalid_tls_options.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 500*time.Millisecond, try.BodyContains("Host(`snitest.com`)")) + require.NoError(s.T(), err) testCases := []struct { desc string @@ -1279,7 +1189,7 @@ func (s *HTTPSSuite) TestWithInvalidTLSOption(c *check.C) { } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) - c.Assert(err, checker.NotNil, check.Commentf("connected to server successfully")) - c.Assert(conn, checker.IsNil) + assert.Error(s.T(), err, "connected to server successfully") + assert.Nil(s.T(), conn) } } diff --git a/integration/integration_test.go b/integration/integration_test.go index 6c13e75b3..703c4ac79 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -7,208 +7,327 @@ import ( "errors" "flag" "fmt" + "io" "io/fs" stdlog "log" + "net/http" "os" "os/exec" "path/filepath" + "regexp" + "slices" "strings" "testing" "text/template" "time" - "github.com/compose-spec/compose-go/cli" - "github.com/compose-spec/compose-go/types" - "github.com/docker/cli/cli/config/configfile" - "github.com/docker/compose/v2/cmd/formatter" - composeapi "github.com/docker/compose/v2/pkg/api" - "github.com/docker/compose/v2/pkg/compose" - dockertypes "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/client" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/mount" + dockernetwork "github.com/docker/docker/api/types/network" "github.com/fatih/structs" - "github.com/go-check/check" - "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "github.com/sirupsen/logrus" - "github.com/traefik/traefik/v3/pkg/logs" - checker "github.com/vdemeester/shakers" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/network" + "github.com/traefik/traefik/v3/integration/try" + "gopkg.in/yaml.v3" ) -var ( - integration = flag.Bool("integration", false, "run integration tests") - showLog = flag.Bool("tlog", false, "always show Traefik logs") -) +var showLog = flag.Bool("tlog", false, "always show Traefik logs") -func Test(t *testing.T) { - if !*integration { - log.Info().Msg("Integration tests disabled.") - return - } +type composeConfig struct { + Services map[string]composeService `yaml:"services"` +} - log.Logger = zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}). - With().Timestamp().Caller().Logger() - zerolog.SetGlobalLevel(zerolog.InfoLevel) +type composeService struct { + Image string `yaml:"image"` + Labels map[string]string `yaml:"labels"` + Hostname string `yaml:"hostname"` + Volumes []string `yaml:"volumes"` + CapAdd []string `yaml:"cap_add"` + Command []string `yaml:"command"` + Environment map[string]string `yaml:"environment"` + Privileged bool `yaml:"privileged"` + Deploy composeDeploy `yaml:"deploy"` +} - // Global logrus replacement - logrus.StandardLogger().Out = logs.NoLevel(log.Logger, zerolog.DebugLevel) - - // configure default standard log. - stdlog.SetFlags(stdlog.Lshortfile | stdlog.LstdFlags) - stdlog.SetOutput(logs.NoLevel(log.Logger, zerolog.DebugLevel)) - - // TODO(mpl): very niche optimization: do not start tailscale if none of the wanted tests actually need it (e.g. KeepAliveSuite does not). - var ( - vpn *tailscaleNotSuite - useVPN bool - ) - if os.Getenv("IN_DOCKER") != "true" { - if vpn = setupVPN(nil, "tailscale.secret"); vpn != nil { - defer vpn.TearDownSuite(nil) - useVPN = true - } - } - - check.Suite(&AccessLogSuite{}) - if !useVPN { - check.Suite(&AcmeSuite{}) - } - check.Suite(&ConsulCatalogSuite{}) - check.Suite(&ConsulSuite{}) - check.Suite(&DockerComposeSuite{}) - check.Suite(&DockerSuite{}) - check.Suite(&ErrorPagesSuite{}) - check.Suite(&EtcdSuite{}) - check.Suite(&FileSuite{}) - check.Suite(&GRPCSuite{}) - check.Suite(&HeadersSuite{}) - check.Suite(&HealthCheckSuite{}) - check.Suite(&HostResolverSuite{}) - check.Suite(&HTTPSSuite{}) - check.Suite(&HTTPSuite{}) - if !useVPN { - check.Suite(&K8sSuite{}) - } - check.Suite(&KeepAliveSuite{}) - check.Suite(&LogRotationSuite{}) - if !useVPN { - check.Suite(&ProxyProtocolSuite{}) - } - check.Suite(&RateLimitSuite{}) - check.Suite(&RedisSuite{}) - check.Suite(&RestSuite{}) - check.Suite(&RetrySuite{}) - check.Suite(&SimpleSuite{}) - check.Suite(&TCPSuite{}) - check.Suite(&TimeoutSuite{}) - check.Suite(&ThrottlingSuite{}) - check.Suite(&TLSClientHeadersSuite{}) - check.Suite(&TracingSuite{}) - check.Suite(&UDPSuite{}) - check.Suite(&WebsocketSuite{}) - check.Suite(&ZookeeperSuite{}) - - check.TestingT(t) +type composeDeploy struct { + Replicas int `yaml:"replicas"` } var traefikBinary = "../dist/traefik" type BaseSuite struct { - composeProject *types.Project - dockerComposeService composeapi.Service - dockerClient *client.Client + suite.Suite + containers map[string]testcontainers.Container + network *testcontainers.DockerNetwork + hostIP string } -func (s *BaseSuite) TearDownSuite(c *check.C) { - if s.composeProject != nil && s.dockerComposeService != nil { - s.composeDown(c) +func (s *BaseSuite) waitForTraefik(containerName string) { + time.Sleep(1 * time.Second) + + // Wait for Traefik to turn ready. + req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/api/rawdata", nil) + require.NoError(s.T(), err) + + err = try.Request(req, 2*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains(containerName)) + require.NoError(s.T(), err) +} + +func (s *BaseSuite) displayTraefikLogFile(path string) { + if s.T().Failed() { + if _, err := os.Stat(path); !os.IsNotExist(err) { + content, errRead := os.ReadFile(path) + // TODO TestName + // fmt.Printf("%s: Traefik logs: \n", c.TestName()) + fmt.Print("Traefik logs: \n") + if errRead == nil { + fmt.Println(content) + } else { + fmt.Println(errRead) + } + } else { + // fmt.Printf("%s: No Traefik logs.\n", c.TestName()) + fmt.Print("No Traefik logs.\n") + } + errRemove := os.Remove(path) + if errRemove != nil { + fmt.Println(errRemove) + } } } +func (s *BaseSuite) SetupSuite() { + // configure default standard log. + stdlog.SetFlags(stdlog.Lshortfile | stdlog.LstdFlags) + // TODO + // stdlog.SetOutput(log.Logger) + + ctx := context.Background() + // Create docker network + // docker network create traefik-test-network --driver bridge --subnet 172.31.42.0/24 + var opts []network.NetworkCustomizer + opts = append(opts, network.WithDriver("bridge")) + opts = append(opts, network.WithIPAM(&dockernetwork.IPAM{ + Driver: "default", + Config: []dockernetwork.IPAMConfig{ + { + Subnet: "172.31.42.0/24", + }, + }, + })) + dockerNetwork, err := network.New(ctx, opts...) + require.NoError(s.T(), err) + + s.network = dockerNetwork + s.hostIP = "172.31.42.1" + if isDockerDesktop(ctx, s.T()) { + s.hostIP = getDockerDesktopHostIP(ctx, s.T()) + s.setupVPN("tailscale.secret") + } +} + +func getDockerDesktopHostIP(ctx context.Context, t *testing.T) string { + t.Helper() + + req := testcontainers.ContainerRequest{ + Image: "alpine", + HostConfigModifier: func(config *container.HostConfig) { + config.AutoRemove = true + }, + Cmd: []string{"getent", "hosts", "host.docker.internal"}, + } + + con, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ + ContainerRequest: req, + Started: true, + }) + require.NoError(t, err) + + closer, err := con.Logs(ctx) + require.NoError(t, err) + + all, err := io.ReadAll(closer) + require.NoError(t, err) + + ipRegex := regexp.MustCompile(`\b(?:\d{1,3}\.){3}\d{1,3}\b`) + matches := ipRegex.FindAllString(string(all), -1) + require.Len(t, matches, 1) + + return matches[0] +} + +func isDockerDesktop(ctx context.Context, t *testing.T) bool { + t.Helper() + + cli, err := testcontainers.NewDockerClientWithOpts(ctx) + if err != nil { + t.Fatalf("failed to create docker client: %s", err) + } + + info, err := cli.Info(ctx) + if err != nil { + t.Fatalf("failed to get docker info: %s", err) + } + + return info.OperatingSystem == "Docker Desktop" +} + +func (s *BaseSuite) TearDownSuite() { + s.composeDown() + + err := try.Do(5*time.Second, func() error { + if s.network != nil { + err := s.network.Remove(context.Background()) + if err != nil { + return err + } + } + + return nil + }) + require.NoError(s.T(), err) +} + // createComposeProject creates the docker compose project stored as a field in the BaseSuite. // This method should be called before starting and/or stopping compose services. -func (s *BaseSuite) createComposeProject(c *check.C, name string) { - projectName := fmt.Sprintf("traefik-integration-test-%s", name) +func (s *BaseSuite) createComposeProject(name string) { composeFile := fmt.Sprintf("resources/compose/%s.yml", name) - var err error - s.dockerClient, err = client.NewClientWithOpts() - c.Assert(err, checker.IsNil) + file, err := os.ReadFile(composeFile) + require.NoError(s.T(), err) - s.dockerComposeService = compose.NewComposeService(s.dockerClient, &configfile.ConfigFile{}) - ops, err := cli.NewProjectOptions([]string{composeFile}, cli.WithName(projectName)) - c.Assert(err, checker.IsNil) + var composeConfigData composeConfig + err = yaml.Unmarshal(file, &composeConfigData) + require.NoError(s.T(), err) - s.composeProject, err = cli.ProjectFromOptions(ops) - c.Assert(err, checker.IsNil) + if s.containers == nil { + s.containers = map[string]testcontainers.Container{} + } + + ctx := context.Background() + + for id, containerConfig := range composeConfigData.Services { + var mounts []mount.Mount + for _, volume := range containerConfig.Volumes { + split := strings.Split(volume, ":") + if len(split) != 2 { + continue + } + + if strings.HasPrefix(split[0], "./") { + path, err := os.Getwd() + if err != nil { + log.Err(err).Msg("can't determine current directory") + continue + } + split[0] = strings.Replace(split[0], "./", path+"/", 1) + } + + abs, err := filepath.Abs(split[0]) + require.NoError(s.T(), err) + + mounts = append(mounts, mount.Mount{Source: abs, Target: split[1], Type: mount.TypeBind}) + } + + if containerConfig.Deploy.Replicas > 0 { + for i := 0; i < containerConfig.Deploy.Replicas; i++ { + id = fmt.Sprintf("%s-%d", id, i+1) + con, err := s.createContainer(ctx, containerConfig, id, mounts) + require.NoError(s.T(), err) + s.containers[id] = con + } + continue + } + + con, err := s.createContainer(ctx, containerConfig, id, mounts) + require.NoError(s.T(), err) + s.containers[id] = con + } +} + +func (s *BaseSuite) createContainer(ctx context.Context, containerConfig composeService, id string, mounts []mount.Mount) (testcontainers.Container, error) { + req := testcontainers.ContainerRequest{ + Image: containerConfig.Image, + Env: containerConfig.Environment, + Cmd: containerConfig.Command, + Labels: containerConfig.Labels, + Name: id, + Hostname: containerConfig.Hostname, + Privileged: containerConfig.Privileged, + Networks: []string{s.network.Name}, + HostConfigModifier: func(config *container.HostConfig) { + if containerConfig.CapAdd != nil { + config.CapAdd = containerConfig.CapAdd + } + if !isDockerDesktop(ctx, s.T()) { + config.ExtraHosts = append(config.ExtraHosts, "host.docker.internal:"+s.hostIP) + } + config.Mounts = mounts + }, + } + con, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ + ContainerRequest: req, + Started: false, + }) + + return con, err } // composeUp starts the given services of the current docker compose project, if they are not already started. // Already running services are not affected (i.e. not stopped). -func (s *BaseSuite) composeUp(c *check.C, services ...string) { - c.Assert(s.composeProject, check.NotNil) - c.Assert(s.dockerComposeService, check.NotNil) - - // We use Create and Restart instead of Up, because the only option that actually works to control which containers - // are started is within the RestartOptions. - err := s.dockerComposeService.Create(context.Background(), s.composeProject, composeapi.CreateOptions{}) - c.Assert(err, checker.IsNil) - - err = s.dockerComposeService.Restart(context.Background(), s.composeProject, composeapi.RestartOptions{Services: services}) - c.Assert(err, checker.IsNil) -} - -// composeExec runs the command in the given args in the given compose service container. -// Already running services are not affected (i.e. not stopped). -func (s *BaseSuite) composeExec(c *check.C, service string, args ...string) { - c.Assert(s.composeProject, check.NotNil) - c.Assert(s.dockerComposeService, check.NotNil) - - _, err := s.dockerComposeService.Exec(context.Background(), s.composeProject.Name, composeapi.RunOptions{ - Service: service, - Stdin: os.Stdin, - Stdout: os.Stdout, - Stderr: os.Stderr, - Command: args, - Tty: false, - Index: 1, - }) - c.Assert(err, checker.IsNil) +func (s *BaseSuite) composeUp(services ...string) { + for name, con := range s.containers { + if len(services) == 0 || slices.Contains(services, name) { + err := con.Start(context.Background()) + require.NoError(s.T(), err) + } + } } // composeStop stops the given services of the current docker compose project and removes the corresponding containers. -func (s *BaseSuite) composeStop(c *check.C, services ...string) { - c.Assert(s.dockerComposeService, check.NotNil) - c.Assert(s.composeProject, check.NotNil) - - err := s.dockerComposeService.Stop(context.Background(), s.composeProject, composeapi.StopOptions{Services: services}) - c.Assert(err, checker.IsNil) - - err = s.dockerComposeService.Remove(context.Background(), s.composeProject, composeapi.RemoveOptions{ - Services: services, - Force: true, - }) - c.Assert(err, checker.IsNil) +func (s *BaseSuite) composeStop(services ...string) { + for name, con := range s.containers { + if len(services) == 0 || slices.Contains(services, name) { + timeout := 10 * time.Second + err := con.Stop(context.Background(), &timeout) + require.NoError(s.T(), err) + } + } } // composeDown stops all compose project services and removes the corresponding containers. -func (s *BaseSuite) composeDown(c *check.C) { - c.Assert(s.dockerComposeService, check.NotNil) - c.Assert(s.composeProject, check.NotNil) - - err := s.dockerComposeService.Down(context.Background(), s.composeProject.Name, composeapi.DownOptions{}) - c.Assert(err, checker.IsNil) +func (s *BaseSuite) composeDown() { + for _, c := range s.containers { + err := c.Terminate(context.Background()) + require.NoError(s.T(), err) + } + s.containers = map[string]testcontainers.Container{} } func (s *BaseSuite) cmdTraefik(args ...string) (*exec.Cmd, *bytes.Buffer) { cmd := exec.Command(traefikBinary, args...) + + s.T().Cleanup(func() { + s.killCmd(cmd) + }) var out bytes.Buffer cmd.Stdout = &out cmd.Stderr = &out + + err := cmd.Start() + require.NoError(s.T(), err) + return cmd, &out } func (s *BaseSuite) killCmd(cmd *exec.Cmd) { + if cmd.Process == nil { + log.Error().Msg("No process to kill") + return + } err := cmd.Process.Kill() if err != nil { log.Error().Err(err).Msg("Kill") @@ -217,15 +336,18 @@ func (s *BaseSuite) killCmd(cmd *exec.Cmd) { time.Sleep(100 * time.Millisecond) } -func (s *BaseSuite) traefikCmd(args ...string) (*exec.Cmd, func(*check.C)) { +func (s *BaseSuite) traefikCmd(args ...string) *exec.Cmd { cmd, out := s.cmdTraefik(args...) - return cmd, func(c *check.C) { - if c.Failed() || *showLog { + + s.T().Cleanup(func() { + if s.T().Failed() || *showLog { s.displayLogK3S() - s.displayLogCompose(c) - s.displayTraefikLog(c, out) + s.displayLogCompose() + s.displayTraefikLog(out) } - } + }) + + return cmd } func (s *BaseSuite) displayLogK3S() { @@ -242,30 +364,33 @@ func (s *BaseSuite) displayLogK3S() { log.Print() } -func (s *BaseSuite) displayLogCompose(c *check.C) { - if s.dockerComposeService == nil || s.composeProject == nil { - log.Info().Str("testName", c.TestName()).Msg("No docker compose logs.") - return +func (s *BaseSuite) displayLogCompose() { + for name, ctn := range s.containers { + readCloser, err := ctn.Logs(context.Background()) + require.NoError(s.T(), err) + for { + b := make([]byte, 1024) + _, err := readCloser.Read(b) + if errors.Is(err, io.EOF) { + break + } + require.NoError(s.T(), err) + + trimLogs := bytes.Trim(bytes.TrimSpace(b), string([]byte{0})) + if len(trimLogs) > 0 { + log.Info().Str("container", name).Msg(string(trimLogs)) + } + } } - - log.Info().Str("testName", c.TestName()).Msg("docker compose logs") - - logConsumer := formatter.NewLogConsumer(context.Background(), logs.NoLevel(log.Logger, zerolog.InfoLevel), false, true) - - err := s.dockerComposeService.Logs(context.Background(), s.composeProject.Name, logConsumer, composeapi.LogOptions{}) - c.Assert(err, checker.IsNil) - - log.Print() - log.Print("################################") - log.Print() } -func (s *BaseSuite) displayTraefikLog(c *check.C, output *bytes.Buffer) { +func (s *BaseSuite) displayTraefikLog(output *bytes.Buffer) { if output == nil || output.Len() == 0 { - log.Info().Str("testName", c.TestName()).Msg("No Traefik logs.") + log.Info().Msg("No Traefik logs.") } else { - log.Info().Str("testName", c.TestName()). - Str("logs", output.String()).Msg("Traefik logs") + for _, line := range strings.Split(output.String(), "\n") { + log.Info().Msg(line) + } } } @@ -279,67 +404,47 @@ func (s *BaseSuite) getDockerHost() string { return dockerHost } -func (s *BaseSuite) adaptFile(c *check.C, path string, tempObjects interface{}) string { +func (s *BaseSuite) adaptFile(path string, tempObjects interface{}) string { // Load file tmpl, err := template.ParseFiles(path) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) folder, prefix := filepath.Split(path) tmpFile, err := os.CreateTemp(folder, strings.TrimSuffix(prefix, filepath.Ext(prefix))+"_*"+filepath.Ext(prefix)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) defer tmpFile.Close() model := structs.Map(tempObjects) model["SelfFilename"] = tmpFile.Name() err = tmpl.ExecuteTemplate(tmpFile, prefix, model) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = tmpFile.Sync() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) + s.T().Cleanup(func() { + os.Remove(tmpFile.Name()) + }) return tmpFile.Name() } -func (s *BaseSuite) getComposeServiceIP(c *check.C, name string) string { - filter := filters.NewArgs( - filters.Arg("label", fmt.Sprintf("%s=%s", composeapi.ProjectLabel, s.composeProject.Name)), - filters.Arg("label", fmt.Sprintf("%s=%s", composeapi.ServiceLabel, name)), - ) - - containers, err := s.dockerClient.ContainerList(context.Background(), dockertypes.ContainerListOptions{Filters: filter}) - c.Assert(err, checker.IsNil) - c.Assert(containers, checker.HasLen, 1) - - networkNames := s.composeProject.NetworkNames() - c.Assert(networkNames, checker.HasLen, 1) - - network := s.composeProject.Networks[networkNames[0]] - return containers[0].NetworkSettings.Networks[network.Name].IPAddress -} - -func (s *BaseSuite) getContainerIP(c *check.C, name string) string { - container, err := s.dockerClient.ContainerInspect(context.Background(), name) - c.Assert(err, checker.IsNil) - c.Assert(container.NetworkSettings.Networks, check.NotNil) - - for _, network := range container.NetworkSettings.Networks { - return network.IPAddress +func (s *BaseSuite) getComposeServiceIP(name string) string { + container, ok := s.containers[name] + if !ok { + return "" } - - // Should never happen. - c.Error("No network found") - return "" + ip, err := container.ContainerIP(context.Background()) + if err != nil { + return "" + } + return ip } func withConfigFile(file string) string { return "--configFile=" + file } -// tailscaleNotSuite includes a BaseSuite out of convenience, so we can benefit -// from composeUp et co., but it is not meant to function as a TestSuite per se. -type tailscaleNotSuite struct{ BaseSuite } - // setupVPN starts Tailscale on the corresponding container, and makes it a subnet // router, for all the other containers (whoamis, etc) subsequently started for the // integration tests. @@ -355,25 +460,35 @@ type tailscaleNotSuite struct{ BaseSuite } // "172.0.0.0/8": ["your_tailscale_identity"], // }, // }, -// -// TODO(mpl): we could maybe even move this setup to the Makefile, to start it -// and let it run (forever, or until voluntarily stopped). -func setupVPN(c *check.C, keyFile string) *tailscaleNotSuite { +func (s *BaseSuite) setupVPN(keyFile string) { data, err := os.ReadFile(keyFile) if err != nil { if !errors.Is(err, fs.ErrNotExist) { - log.Fatal().Err(err).Send() + log.Error().Err(err).Send() } - return nil + + return } authKey := strings.TrimSpace(string(data)) - // TODO: copy and create versions that don't need a check.C? - vpn := &tailscaleNotSuite{} - vpn.createComposeProject(c, "tailscale") - vpn.composeUp(c) + // // TODO: copy and create versions that don't need a check.C? + s.createComposeProject("tailscale") + s.composeUp() time.Sleep(5 * time.Second) // If we ever change the docker subnet in the Makefile, // we need to change this one below correspondingly. - vpn.composeExec(c, "tailscaled", "tailscale", "up", "--authkey="+authKey, "--advertise-routes=172.31.42.0/24") - return vpn + s.composeExec("tailscaled", "tailscale", "up", "--authkey="+authKey, "--advertise-routes=172.31.42.0/24") +} + +// composeExec runs the command in the given args in the given compose service container. +// Already running services are not affected (i.e. not stopped). +func (s *BaseSuite) composeExec(service string, args ...string) string { + require.Contains(s.T(), s.containers, service) + + _, reader, err := s.containers[service].Exec(context.Background(), args) + require.NoError(s.T(), err) + + content, err := io.ReadAll(reader) + require.NoError(s.T(), err) + + return string(content) } diff --git a/integration/k8s_test.go b/integration/k8s_test.go index 5d54bc3e1..396913538 100644 --- a/integration/k8s_test.go +++ b/integration/k8s_test.go @@ -7,18 +7,21 @@ import ( "flag" "fmt" "io" + "net" "net/http" "os" "path/filepath" "regexp" + "strings" + "testing" "time" - "github.com/go-check/check" "github.com/pmezard/go-difflib/difflib" "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/api" - checker "github.com/vdemeester/shakers" ) var updateExpected = flag.Bool("update_expected", false, "Update expected files in testdata") @@ -26,25 +29,39 @@ var updateExpected = flag.Bool("update_expected", false, "Update expected files // K8sSuite tests suite. type K8sSuite struct{ BaseSuite } -func (s *K8sSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "k8s") - s.composeUp(c) +func TestK8sSuite(t *testing.T) { + suite.Run(t, new(K8sSuite)) +} + +func (s *K8sSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("k8s") + s.composeUp() abs, err := filepath.Abs("./fixtures/k8s/config.skip/kubeconfig.yaml") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Do(60*time.Second, func() error { _, err := os.Stat(abs) return err }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) + + data, err := os.ReadFile(abs) + require.NoError(s.T(), err) + + content := strings.ReplaceAll(string(data), "https://server:6443", fmt.Sprintf("https://%s", net.JoinHostPort(s.getComposeServiceIP("server"), "6443"))) + + err = os.WriteFile(abs, []byte(content), 0o644) + require.NoError(s.T(), err) err = os.Setenv("KUBECONFIG", abs) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *K8sSuite) TearDownSuite(c *check.C) { - s.composeDown(c) +func (s *K8sSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() generatedFiles := []string{ "./fixtures/k8s/config.skip/kubeconfig.yaml", @@ -62,120 +79,84 @@ func (s *K8sSuite) TearDownSuite(c *check.C) { } } -func (s *K8sSuite) TestIngressConfiguration(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_default.toml")) - defer display(c) +func (s *K8sSuite) TestIngressConfiguration() { + s.traefikCmd(withConfigFile("fixtures/k8s_default.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-ingress.json", "8080") + s.testConfiguration("testdata/rawdata-ingress.json", "8080") } -func (s *K8sSuite) TestIngressLabelSelector(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_ingress_label_selector.toml")) - defer display(c) +func (s *K8sSuite) TestIngressLabelSelector() { + s.traefikCmd(withConfigFile("fixtures/k8s_ingress_label_selector.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-ingress-label-selector.json", "8080") + s.testConfiguration("testdata/rawdata-ingress-label-selector.json", "8080") } -func (s *K8sSuite) TestCRDConfiguration(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_crd.toml")) - defer display(c) +func (s *K8sSuite) TestCRDConfiguration() { + s.traefikCmd(withConfigFile("fixtures/k8s_crd.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-crd.json", "8000") + s.testConfiguration("testdata/rawdata-crd.json", "8000") } -func (s *K8sSuite) TestCRDLabelSelector(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_crd_label_selector.toml")) - defer display(c) +func (s *K8sSuite) TestCRDLabelSelector() { + s.traefikCmd(withConfigFile("fixtures/k8s_crd_label_selector.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-crd-label-selector.json", "8000") + s.testConfiguration("testdata/rawdata-crd-label-selector.json", "8000") } -func (s *K8sSuite) TestGatewayConfiguration(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_gateway.toml")) - defer display(c) +func (s *K8sSuite) TestGatewayConfiguration() { + s.traefikCmd(withConfigFile("fixtures/k8s_gateway.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-gateway.json", "8080") + s.testConfiguration("testdata/rawdata-gateway.json", "8080") } -func (s *K8sSuite) TestIngressclass(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_ingressclass.toml")) - defer display(c) +func (s *K8sSuite) TestIngressclass() { + s.traefikCmd(withConfigFile("fixtures/k8s_ingressclass.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-ingressclass.json", "8080") + s.testConfiguration("testdata/rawdata-ingressclass.json", "8080") } -func (s *K8sSuite) TestDisableIngressclassLookup(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/k8s_ingressclass_disabled.toml")) - defer display(c) +func (s *K8sSuite) TestDisableIngressclassLookup() { + s.traefikCmd(withConfigFile("fixtures/k8s_ingressclass_disabled.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - testConfiguration(c, "testdata/rawdata-ingressclass-disabled.json", "8080") + s.testConfiguration("testdata/rawdata-ingressclass-disabled.json", "8080") } -func testConfiguration(c *check.C, path, apiPort string) { +func (s *K8sSuite) testConfiguration(path, apiPort string) { err := try.GetRequest("http://127.0.0.1:"+apiPort+"/api/entrypoints", 20*time.Second, try.BodyContains(`"name":"web"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) expectedJSON := filepath.FromSlash(path) if *updateExpected { fi, err := os.Create(expectedJSON) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = fi.Close() - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } var buf bytes.Buffer err = try.GetRequest("http://127.0.0.1:"+apiPort+"/api/rawdata", 1*time.Minute, try.StatusCodeIs(http.StatusOK), matchesConfig(expectedJSON, &buf)) if !*updateExpected { - if err != nil { - c.Error(err) - } + require.NoError(s.T(), err) return } if err != nil { - c.Logf("In file update mode, got expected error: %v", err) + log.Info().Msgf("In file update mode, got expected error: %v", err) } var rtRepr api.RunTimeRepresentation err = json.Unmarshal(buf.Bytes(), &rtRepr) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) newJSON, err := json.MarshalIndent(rtRepr, "", "\t") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = os.WriteFile(expectedJSON, newJSON, 0o644) - c.Assert(err, checker.IsNil) - c.Errorf("We do not want a passing test in file update mode") + require.NoError(s.T(), err) + + s.T().Fatal("We do not want a passing test in file update mode") } func matchesConfig(wantConfig string, buf *bytes.Buffer) try.ResponseCondition { diff --git a/integration/keepalive_test.go b/integration/keepalive_test.go index a56cbdd48..54fc14555 100644 --- a/integration/keepalive_test.go +++ b/integration/keepalive_test.go @@ -5,18 +5,23 @@ import ( "net" "net/http" "net/http/httptest" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type KeepAliveSuite struct { BaseSuite } +func TestKeepAliveSuite(t *testing.T) { + suite.Run(t, new(KeepAliveSuite)) +} + type KeepAliveConfig struct { KeepAliveServer string IdleConnTimeout string @@ -27,7 +32,7 @@ type connStateChangeEvent struct { state http.ConnState } -func (s *KeepAliveSuite) TestShouldRespectConfiguredBackendHttpKeepAliveTime(c *check.C) { +func (s *KeepAliveSuite) TestShouldRespectConfiguredBackendHttpKeepAliveTime() { idleTimeout := time.Duration(75) * time.Millisecond connStateChanges := make(chan connStateChangeEvent) @@ -59,18 +64,18 @@ func (s *KeepAliveSuite) TestShouldRespectConfiguredBackendHttpKeepAliveTime(c * case <-noMoreRequests: moreRequestsExpected = false case <-maxWaitTimeExceeded: - c.Logf("timeout waiting for all connections to close, waited for %v, configured idle timeout was %v", maxWaitDuration, idleTimeout) - c.Fail() + log.Info().Msgf("timeout waiting for all connections to close, waited for %v, configured idle timeout was %v", maxWaitDuration, idleTimeout) + s.T().Fail() close(completed) return } } - c.Check(connCount, checker.Equals, 1) + require.Equal(s.T(), 1, connCount) for _, idlePeriod := range idlePeriodLengthMap { // Our method of measuring the actual idle period is not precise, so allow some sub-ms deviation - c.Check(math.Round(idlePeriod.Seconds()), checker.LessOrEqualThan, idleTimeout.Seconds()) + require.LessOrEqual(s.T(), math.Round(idlePeriod.Seconds()), idleTimeout.Seconds()) } close(completed) @@ -87,22 +92,16 @@ func (s *KeepAliveSuite) TestShouldRespectConfiguredBackendHttpKeepAliveTime(c * defer server.Close() config := KeepAliveConfig{KeepAliveServer: server.URL, IdleConnTimeout: idleTimeout.String()} - file := s.adaptFile(c, "fixtures/timeout/keepalive.toml", config) + file := s.adaptFile("fixtures/timeout/keepalive.toml", config) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Check(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // Wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Duration(1)*time.Second, try.StatusCodeIs(200), try.BodyContains("PathPrefix(`/keepalive`)")) - c.Check(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Duration(1)*time.Second, try.StatusCodeIs(200), try.BodyContains("PathPrefix(`/keepalive`)")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/keepalive", time.Duration(1)*time.Second, try.StatusCodeIs(200)) - c.Check(err, checker.IsNil) + require.NoError(s.T(), err) close(noMoreRequests) <-completed diff --git a/integration/log_rotation_test.go b/integration/log_rotation_test.go index c753dc7ff..28d72f8cd 100644 --- a/integration/log_rotation_test.go +++ b/integration/log_rotation_test.go @@ -9,12 +9,14 @@ import ( "os" "strings" "syscall" + "testing" "time" - "github.com/go-check/check" "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) const traefikTestAccessLogFileRotated = traefikTestAccessLogFile + ".rotated" @@ -22,13 +24,23 @@ const traefikTestAccessLogFileRotated = traefikTestAccessLogFile + ".rotated" // Log rotation integration test suite. type LogRotationSuite struct{ BaseSuite } -func (s *LogRotationSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "access_log") - s.composeUp(c) +func TestLogRorationSuite(t *testing.T) { + suite.Run(t, new(LogRotationSuite)) } -func (s *LogRotationSuite) TearDownSuite(c *check.C) { - s.composeDown(c) +func (s *LogRotationSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + os.Remove(traefikTestAccessLogFile) + os.Remove(traefikTestLogFile) + os.Remove(traefikTestAccessLogFileRotated) + + s.createComposeProject("access_log") + s.composeUp() +} + +func (s *LogRotationSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() generatedFiles := []string{ traefikTestLogFile, @@ -43,84 +55,80 @@ func (s *LogRotationSuite) TearDownSuite(c *check.C) { } } -func (s *LogRotationSuite) TestAccessLogRotation(c *check.C) { +func (s *LogRotationSuite) TestAccessLogRotation() { // Start Traefik - cmd, display := s.traefikCmd(withConfigFile("fixtures/access_log_config.toml")) - defer display(c) - defer displayTraefikLogFile(c, traefikTestLogFile) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + cmd, _ := s.cmdTraefik(withConfigFile("fixtures/access_log_config.toml")) + defer s.displayTraefikLogFile(traefikTestLogFile) // Verify Traefik started ok - verifyEmptyErrorLog(c, "traefik.log") + s.verifyEmptyErrorLog("traefik.log") - waitForTraefik(c, "server1") + s.waitForTraefik("server1") // Make some requests req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "frontend1.docker.local" err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Rename access log err = os.Rename(traefikTestAccessLogFile, traefikTestAccessLogFileRotated) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // in the midst of the requests, issue SIGUSR1 signal to server process err = cmd.Process.Signal(syscall.SIGUSR1) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // continue issuing requests err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.Request(req, 500*time.Millisecond, try.StatusCodeIs(http.StatusOK), try.HasBody()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Verify access.log.rotated output as expected - logAccessLogFile(c, traefikTestAccessLogFileRotated) - lineCount := verifyLogLines(c, traefikTestAccessLogFileRotated, 0, true) - c.Assert(lineCount, checker.GreaterOrEqualThan, 1) + s.logAccessLogFile(traefikTestAccessLogFileRotated) + lineCount := s.verifyLogLines(traefikTestAccessLogFileRotated, 0, true) + assert.GreaterOrEqual(s.T(), lineCount, 1) // make sure that the access log file is at least created before we do assertions on it err = try.Do(1*time.Second, func() error { _, err := os.Stat(traefikTestAccessLogFile) return err }) - c.Assert(err, checker.IsNil, check.Commentf("access log file was not created in time")) + assert.NoError(s.T(), err, "access log file was not created in time") // Verify access.log output as expected - logAccessLogFile(c, traefikTestAccessLogFile) - lineCount = verifyLogLines(c, traefikTestAccessLogFile, lineCount, true) - c.Assert(lineCount, checker.Equals, 3) + s.logAccessLogFile(traefikTestAccessLogFile) + lineCount = s.verifyLogLines(traefikTestAccessLogFile, lineCount, true) + assert.Equal(s.T(), 3, lineCount) - verifyEmptyErrorLog(c, traefikTestLogFile) + s.verifyEmptyErrorLog(traefikTestLogFile) } -func logAccessLogFile(c *check.C, fileName string) { +func (s *LogRotationSuite) logAccessLogFile(fileName string) { output, err := os.ReadFile(fileName) - c.Assert(err, checker.IsNil) - c.Logf("Contents of file %s\n%s", fileName, string(output)) + require.NoError(s.T(), err) + log.Info().Msgf("Contents of file %s\n%s", fileName, string(output)) } -func verifyEmptyErrorLog(c *check.C, name string) { +func (s *LogRotationSuite) verifyEmptyErrorLog(name string) { err := try.Do(5*time.Second, func() error { traefikLog, e2 := os.ReadFile(name) if e2 != nil { return e2 } - c.Assert(string(traefikLog), checker.HasLen, 0) + assert.Empty(s.T(), string(traefikLog)) + return nil }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func verifyLogLines(c *check.C, fileName string, countInit int, accessLog bool) int { +func (s *LogRotationSuite) verifyLogLines(fileName string, countInit int, accessLog bool) int { rotated, err := os.Open(fileName) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) rotatedLog := bufio.NewScanner(rotated) count := countInit for rotatedLog.Scan() { @@ -128,7 +136,7 @@ func verifyLogLines(c *check.C, fileName string, countInit int, accessLog bool) if accessLog { if len(line) > 0 { if !strings.Contains(line, "/api/rawdata") { - CheckAccessLogFormat(c, line, count) + s.CheckAccessLogFormat(line, count) count++ } } diff --git a/integration/proxy_protocol_test.go b/integration/proxy_protocol_test.go index 40640bae7..f30a641c7 100644 --- a/integration/proxy_protocol_test.go +++ b/integration/proxy_protocol_test.go @@ -1,103 +1,138 @@ package integration import ( - "net/http" - "os" + "bufio" + "net" + "testing" "time" - "github.com/go-check/check" + "github.com/pires/go-proxyproto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type ProxyProtocolSuite struct { BaseSuite - gatewayIP string - haproxyIP string - whoamiIP string + whoamiIP string } -func (s *ProxyProtocolSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "proxy-protocol") - s.composeUp(c) - - s.gatewayIP = s.getContainerIP(c, "traefik") - s.haproxyIP = s.getComposeServiceIP(c, "haproxy") - s.whoamiIP = s.getComposeServiceIP(c, "whoami") +func TestProxyProtocolSuite(t *testing.T) { + suite.Run(t, new(ProxyProtocolSuite)) } -func (s *ProxyProtocolSuite) TestProxyProtocolTrusted(c *check.C) { - file := s.adaptFile(c, "fixtures/proxy-protocol/with.toml", struct { +func (s *ProxyProtocolSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("proxy-protocol") + s.composeUp() + + s.whoamiIP = s.getComposeServiceIP("whoami") +} + +func (s *ProxyProtocolSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *ProxyProtocolSuite) TestProxyProtocolTrusted() { + file := s.adaptFile("fixtures/proxy-protocol/proxy-protocol.toml", struct { HaproxyIP string WhoamiIP string - }{HaproxyIP: s.haproxyIP, WhoamiIP: s.whoamiIP}) - defer os.Remove(file) + }{WhoamiIP: s.whoamiIP}) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) - err = try.GetRequest("http://"+s.haproxyIP+"/whoami", 1*time.Second, - try.StatusCodeIs(http.StatusOK), - try.BodyContains("X-Forwarded-For: "+s.gatewayIP)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/whoami", 10*time.Second) + require.NoError(s.T(), err) + + content, err := proxyProtoRequest("127.0.0.1:8000", 1) + require.NoError(s.T(), err) + assert.Contains(s.T(), content, "X-Forwarded-For: 1.2.3.4") + + content, err = proxyProtoRequest("127.0.0.1:8000", 2) + require.NoError(s.T(), err) + assert.Contains(s.T(), content, "X-Forwarded-For: 1.2.3.4") } -func (s *ProxyProtocolSuite) TestProxyProtocolV2Trusted(c *check.C) { - file := s.adaptFile(c, "fixtures/proxy-protocol/with.toml", struct { +func (s *ProxyProtocolSuite) TestProxyProtocolNotTrusted() { + file := s.adaptFile("fixtures/proxy-protocol/proxy-protocol.toml", struct { HaproxyIP string WhoamiIP string - }{HaproxyIP: s.haproxyIP, WhoamiIP: s.whoamiIP}) - defer os.Remove(file) + }{WhoamiIP: s.whoamiIP}) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) - err = try.GetRequest("http://"+s.haproxyIP+":81/whoami", 1*time.Second, - try.StatusCodeIs(http.StatusOK), - try.BodyContains("X-Forwarded-For: "+s.gatewayIP)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:9000/whoami", 10*time.Second) + require.NoError(s.T(), err) + + content, err := proxyProtoRequest("127.0.0.1:9000", 1) + require.NoError(s.T(), err) + assert.Contains(s.T(), content, "X-Forwarded-For: 127.0.0.1") + + content, err = proxyProtoRequest("127.0.0.1:9000", 2) + require.NoError(s.T(), err) + assert.Contains(s.T(), content, "X-Forwarded-For: 127.0.0.1") } -func (s *ProxyProtocolSuite) TestProxyProtocolNotTrusted(c *check.C) { - file := s.adaptFile(c, "fixtures/proxy-protocol/without.toml", struct { - HaproxyIP string - WhoamiIP string - }{HaproxyIP: s.haproxyIP, WhoamiIP: s.whoamiIP}) - defer os.Remove(file) +func proxyProtoRequest(address string, version byte) (string, error) { + // Open a TCP connection to the server + conn, err := net.Dial("tcp", address) + if err != nil { + return "", err + } + defer conn.Close() - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + // Create a Proxy Protocol header with v1 + proxyHeader := &proxyproto.Header{ + Version: version, + Command: proxyproto.PROXY, + TransportProtocol: proxyproto.TCPv4, + DestinationAddr: &net.TCPAddr{ + IP: net.ParseIP("127.0.0.1"), + Port: 8000, + }, + SourceAddr: &net.TCPAddr{ + IP: net.ParseIP("1.2.3.4"), + Port: 62541, + }, + } - err = try.GetRequest("http://"+s.haproxyIP+"/whoami", 1*time.Second, - try.StatusCodeIs(http.StatusOK), - try.BodyContains("X-Forwarded-For: "+s.haproxyIP)) - c.Assert(err, checker.IsNil) -} - -func (s *ProxyProtocolSuite) TestProxyProtocolV2NotTrusted(c *check.C) { - file := s.adaptFile(c, "fixtures/proxy-protocol/without.toml", struct { - HaproxyIP string - WhoamiIP string - }{HaproxyIP: s.haproxyIP, WhoamiIP: s.whoamiIP}) - defer os.Remove(file) - - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://"+s.haproxyIP+":81/whoami", 1*time.Second, - try.StatusCodeIs(http.StatusOK), - try.BodyContains("X-Forwarded-For: "+s.haproxyIP)) - c.Assert(err, checker.IsNil) + // After the connection was created write the proxy headers first + _, err = proxyHeader.WriteTo(conn) + if err != nil { + return "", err + } + + // Create an HTTP request + request := "GET /whoami HTTP/1.1\r\n" + + "Host: 127.0.0.1\r\n" + + "Connection: close\r\n" + + "\r\n" + + // Write the HTTP request to the TCP connection + writer := bufio.NewWriter(conn) + _, err = writer.WriteString(request) + if err != nil { + return "", err + } + + // Flush the buffer to ensure the request is sent + err = writer.Flush() + if err != nil { + return "", err + } + + // Read the response from the server + var content string + scanner := bufio.NewScanner(conn) + for scanner.Scan() { + content += scanner.Text() + "\n" + } + + if scanner.Err() != nil { + return "", err + } + + return content, nil } diff --git a/integration/ratelimit_test.go b/integration/ratelimit_test.go index 5edbf64b8..b0254564d 100644 --- a/integration/ratelimit_test.go +++ b/integration/ratelimit_test.go @@ -2,12 +2,12 @@ package integration import ( "net/http" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type RateLimitSuite struct { @@ -15,33 +15,38 @@ type RateLimitSuite struct { ServerIP string } -func (s *RateLimitSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "ratelimit") - s.composeUp(c) - - s.ServerIP = s.getComposeServiceIP(c, "whoami1") +func TestRateLimitSuite(t *testing.T) { + suite.Run(t, new(RateLimitSuite)) } -func (s *RateLimitSuite) TestSimpleConfiguration(c *check.C) { - file := s.adaptFile(c, "fixtures/ratelimit/simple.toml", struct { +func (s *RateLimitSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("ratelimit") + s.composeUp() + + s.ServerIP = s.getComposeServiceIP("whoami1") +} + +func (s *RateLimitSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *RateLimitSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/ratelimit/simple.toml", struct { Server1 string }{s.ServerIP}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("ratelimit")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("ratelimit")) + require.NoError(s.T(), err) start := time.Now() count := 0 for { err = try.GetRequest("http://127.0.0.1:8081/", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) count++ if count > 100 { break @@ -50,6 +55,6 @@ func (s *RateLimitSuite) TestSimpleConfiguration(c *check.C) { stop := time.Now() elapsed := stop.Sub(start) if elapsed < time.Second*99/100 { - c.Fatalf("requests throughput was too fast wrt to rate limiting: 100 requests in %v", elapsed) + s.T().Fatalf("requests throughput was too fast wrt to rate limiting: 100 requests in %v", elapsed) } } diff --git a/integration/redis_sentinel_test.go b/integration/redis_sentinel_test.go new file mode 100644 index 000000000..ec60f8c74 --- /dev/null +++ b/integration/redis_sentinel_test.go @@ -0,0 +1,201 @@ +package integration + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net" + "net/http" + "os" + "path/filepath" + "strings" + "testing" + "text/template" + "time" + + "github.com/fatih/structs" + "github.com/kvtools/redis" + "github.com/kvtools/valkeyrie" + "github.com/kvtools/valkeyrie/store" + "github.com/pmezard/go-difflib/difflib" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "github.com/traefik/traefik/v3/integration/try" + "github.com/traefik/traefik/v3/pkg/api" +) + +// Redis test suites. +type RedisSentinelSuite struct { + BaseSuite + kvClient store.Store + redisEndpoints []string +} + +func TestRedisSentinelSuite(t *testing.T) { + suite.Run(t, new(RedisSentinelSuite)) +} + +func (s *RedisSentinelSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.setupSentinelConfiguration([]string{"26379", "26379", "26379"}) + + s.createComposeProject("redis_sentinel") + s.composeUp() + + s.redisEndpoints = []string{ + net.JoinHostPort(s.getComposeServiceIP("sentinel1"), "26379"), + net.JoinHostPort(s.getComposeServiceIP("sentinel2"), "26379"), + net.JoinHostPort(s.getComposeServiceIP("sentinel3"), "26379"), + } + kv, err := valkeyrie.NewStore( + context.Background(), + redis.StoreName, + s.redisEndpoints, + &redis.Config{ + Sentinel: &redis.Sentinel{ + MasterName: "mymaster", + }, + }, + ) + require.NoError(s.T(), err, "Cannot create store redis") + s.kvClient = kv + + // wait for redis + err = try.Do(60*time.Second, try.KVExists(kv, "test")) + require.NoError(s.T(), err) +} + +func (s *RedisSentinelSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() + + for _, filename := range []string{"sentinel1.conf", "sentinel2.conf", "sentinel3.conf"} { + _ = os.Remove(filepath.Join(".", "resources", "compose", "config", filename)) + } +} + +func (s *RedisSentinelSuite) setupSentinelConfiguration(ports []string) { + for i, port := range ports { + templateValue := struct{ SentinelPort string }{SentinelPort: port} + + // Load file + templateFile := "resources/compose/config/sentinel_template.conf" + tmpl, err := template.ParseFiles(templateFile) + require.NoError(s.T(), err) + + folder, prefix := filepath.Split(templateFile) + + fileName := fmt.Sprintf("%s/sentinel%d.conf", folder, i+1) + tmpFile, err := os.Create(fileName) + require.NoError(s.T(), err) + defer tmpFile.Close() + + model := structs.Map(templateValue) + model["SelfFilename"] = tmpFile.Name() + + err = tmpl.ExecuteTemplate(tmpFile, prefix, model) + require.NoError(s.T(), err) + + err = tmpFile.Sync() + require.NoError(s.T(), err) + } +} + +func (s *RedisSentinelSuite) TestSentinelConfiguration() { + file := s.adaptFile("fixtures/redis/sentinel.toml", struct{ RedisAddress string }{ + RedisAddress: strings.Join(s.redisEndpoints, `","`), + }) + + data := map[string]string{ + "traefik/http/routers/Router0/entryPoints/0": "web", + "traefik/http/routers/Router0/middlewares/0": "compressor", + "traefik/http/routers/Router0/middlewares/1": "striper", + "traefik/http/routers/Router0/service": "simplesvc", + "traefik/http/routers/Router0/rule": "Host(`kv1.localhost`)", + "traefik/http/routers/Router0/priority": "42", + "traefik/http/routers/Router0/tls": "true", + + "traefik/http/routers/Router1/rule": "Host(`kv2.localhost`)", + "traefik/http/routers/Router1/priority": "42", + "traefik/http/routers/Router1/tls/domains/0/main": "aaa.localhost", + "traefik/http/routers/Router1/tls/domains/0/sans/0": "aaa.aaa.localhost", + "traefik/http/routers/Router1/tls/domains/0/sans/1": "bbb.aaa.localhost", + "traefik/http/routers/Router1/tls/domains/1/main": "bbb.localhost", + "traefik/http/routers/Router1/tls/domains/1/sans/0": "aaa.bbb.localhost", + "traefik/http/routers/Router1/tls/domains/1/sans/1": "bbb.bbb.localhost", + "traefik/http/routers/Router1/entryPoints/0": "web", + "traefik/http/routers/Router1/service": "simplesvc", + + "traefik/http/services/simplesvc/loadBalancer/servers/0/url": "http://10.0.1.1:8888", + "traefik/http/services/simplesvc/loadBalancer/servers/1/url": "http://10.0.1.1:8889", + + "traefik/http/services/srvcA/loadBalancer/servers/0/url": "http://10.0.1.2:8888", + "traefik/http/services/srvcA/loadBalancer/servers/1/url": "http://10.0.1.2:8889", + + "traefik/http/services/srvcB/loadBalancer/servers/0/url": "http://10.0.1.3:8888", + "traefik/http/services/srvcB/loadBalancer/servers/1/url": "http://10.0.1.3:8889", + + "traefik/http/services/mirror/mirroring/service": "simplesvc", + "traefik/http/services/mirror/mirroring/mirrors/0/name": "srvcA", + "traefik/http/services/mirror/mirroring/mirrors/0/percent": "42", + "traefik/http/services/mirror/mirroring/mirrors/1/name": "srvcB", + "traefik/http/services/mirror/mirroring/mirrors/1/percent": "42", + + "traefik/http/services/Service03/weighted/services/0/name": "srvcA", + "traefik/http/services/Service03/weighted/services/0/weight": "42", + "traefik/http/services/Service03/weighted/services/1/name": "srvcB", + "traefik/http/services/Service03/weighted/services/1/weight": "42", + + "traefik/http/middlewares/compressor/compress": "true", + "traefik/http/middlewares/striper/stripPrefix/prefixes/0": "foo", + "traefik/http/middlewares/striper/stripPrefix/prefixes/1": "bar", + } + + for k, v := range data { + err := s.kvClient.Put(context.Background(), k, []byte(v), nil) + require.NoError(s.T(), err) + } + + s.traefikCmd(withConfigFile(file)) + + // wait for traefik + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + try.BodyContains(`"striper@redis":`, `"compressor@redis":`, `"srvcA@redis":`, `"srvcB@redis":`), + ) + require.NoError(s.T(), err) + + resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") + require.NoError(s.T(), err) + + var obtained api.RunTimeRepresentation + err = json.NewDecoder(resp.Body).Decode(&obtained) + require.NoError(s.T(), err) + got, err := json.MarshalIndent(obtained, "", " ") + require.NoError(s.T(), err) + + expectedJSON := filepath.FromSlash("testdata/rawdata-redis.json") + + if *updateExpected { + err = os.WriteFile(expectedJSON, got, 0o666) + require.NoError(s.T(), err) + } + + expected, err := os.ReadFile(expectedJSON) + require.NoError(s.T(), err) + + if !bytes.Equal(expected, got) { + diff := difflib.UnifiedDiff{ + FromFile: "Expected", + A: difflib.SplitLines(string(expected)), + ToFile: "Got", + B: difflib.SplitLines(string(got)), + Context: 3, + } + + text, err := difflib.GetUnifiedDiffString(diff) + require.NoError(s.T(), err) + log.Info().Msg(text) + } +} diff --git a/integration/redis_test.go b/integration/redis_test.go index ead903629..6685b7645 100644 --- a/integration/redis_test.go +++ b/integration/redis_test.go @@ -4,26 +4,22 @@ import ( "bytes" "context" "encoding/json" - "errors" - "fmt" - "io/fs" "net" "net/http" "os" "path/filepath" "strings" - "text/template" + "testing" "time" - "github.com/fatih/structs" - "github.com/go-check/check" "github.com/kvtools/redis" "github.com/kvtools/valkeyrie" "github.com/kvtools/valkeyrie/store" "github.com/pmezard/go-difflib/difflib" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/api" - checker "github.com/vdemeester/shakers" ) // Redis test suites. @@ -33,23 +29,18 @@ type RedisSuite struct { redisEndpoints []string } -func (s *RedisSuite) TearDownSuite(c *check.C) { - s.composeDown(c) - - for _, filename := range []string{"sentinel1.conf", "sentinel2.conf", "sentinel3.conf"} { - err := os.Remove(filepath.Join(".", "resources", "compose", "config", filename)) - if err != nil && !errors.Is(err, fs.ErrNotExist) { - c.Fatal("unable to clean configuration file for sentinel: ", err) - } - } +func TestRedisSuite(t *testing.T) { + suite.Run(t, new(RedisSuite)) } -func (s *RedisSuite) setupStore(c *check.C) { - s.createComposeProject(c, "redis") - s.composeUp(c) +func (s *RedisSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("redis") + s.composeUp() s.redisEndpoints = []string{} - s.redisEndpoints = append(s.redisEndpoints, net.JoinHostPort(s.getComposeServiceIP(c, "redis"), "6379")) + s.redisEndpoints = append(s.redisEndpoints, net.JoinHostPort(s.getComposeServiceIP("redis"), "6379")) kv, err := valkeyrie.NewStore( context.Background(), @@ -57,23 +48,23 @@ func (s *RedisSuite) setupStore(c *check.C) { s.redisEndpoints, &redis.Config{}, ) - if err != nil { - c.Fatal("Cannot create store redis: ", err) - } + require.NoError(s.T(), err, "Cannot create store redis") + s.kvClient = kv // wait for redis err = try.Do(60*time.Second, try.KVExists(kv, "test")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *RedisSuite) TestSimpleConfiguration(c *check.C) { - s.setupStore(c) +func (s *RedisSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} - file := s.adaptFile(c, "fixtures/redis/simple.toml", struct{ RedisAddress string }{ +func (s *RedisSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/redis/simple.toml", struct{ RedisAddress string }{ RedisAddress: strings.Join(s.redisEndpoints, ","), }) - defer os.Remove(file) data := map[string]string{ "traefik/http/routers/Router0/entryPoints/0": "web", @@ -122,39 +113,35 @@ func (s *RedisSuite) TestSimpleConfiguration(c *check.C) { for k, v := range data { err := s.kvClient.Put(context.Background(), k, []byte(v), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains(`"striper@redis":`, `"compressor@redis":`, `"srvcA@redis":`, `"srvcB@redis":`), ) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var obtained api.RunTimeRepresentation err = json.NewDecoder(resp.Body).Decode(&obtained) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) got, err := json.MarshalIndent(obtained, "", " ") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) expectedJSON := filepath.FromSlash("testdata/rawdata-redis.json") if *updateExpected { err = os.WriteFile(expectedJSON, got, 0o666) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } expected, err := os.ReadFile(expectedJSON) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if !bytes.Equal(expected, got) { diff := difflib.UnifiedDiff{ @@ -166,170 +153,6 @@ func (s *RedisSuite) TestSimpleConfiguration(c *check.C) { } text, err := difflib.GetUnifiedDiffString(diff) - c.Assert(err, checker.IsNil) - c.Error(text) - } -} - -func (s *RedisSuite) setupSentinelStore(c *check.C) { - s.setupSentinelConfiguration(c, []string{"26379", "36379", "46379"}) - - s.createComposeProject(c, "redis_sentinel") - s.composeUp(c) - - s.redisEndpoints = []string{ - net.JoinHostPort(s.getComposeServiceIP(c, "sentinel1"), "26379"), - net.JoinHostPort(s.getComposeServiceIP(c, "sentinel2"), "36379"), - net.JoinHostPort(s.getComposeServiceIP(c, "sentinel3"), "46379"), - } - - kv, err := valkeyrie.NewStore( - context.Background(), - redis.StoreName, - s.redisEndpoints, - &redis.Config{ - Sentinel: &redis.Sentinel{ - MasterName: "mymaster", - }, - }, - ) - if err != nil { - c.Fatal("Cannot create store redis sentinel") - } - s.kvClient = kv - - // wait for redis - err = try.Do(60*time.Second, try.KVExists(kv, "test")) - c.Assert(err, checker.IsNil) -} - -func (s *RedisSuite) setupSentinelConfiguration(c *check.C, ports []string) { - for i, port := range ports { - templateValue := struct{ SentinelPort string }{SentinelPort: port} - - // Load file - templateFile := "resources/compose/config/sentinel_template.conf" - tmpl, err := template.ParseFiles(templateFile) - c.Assert(err, checker.IsNil) - - folder, prefix := filepath.Split(templateFile) - - fileName := fmt.Sprintf("%s/sentinel%d.conf", folder, i+1) - tmpFile, err := os.Create(fileName) - c.Assert(err, checker.IsNil) - defer tmpFile.Close() - - model := structs.Map(templateValue) - model["SelfFilename"] = tmpFile.Name() - - err = tmpl.ExecuteTemplate(tmpFile, prefix, model) - c.Assert(err, checker.IsNil) - - err = tmpFile.Sync() - c.Assert(err, checker.IsNil) - } -} - -func (s *RedisSuite) TestSentinelConfiguration(c *check.C) { - s.setupSentinelStore(c) - - file := s.adaptFile(c, "fixtures/redis/sentinel.toml", struct{ RedisAddress string }{ - RedisAddress: strings.Join(s.redisEndpoints, `","`), - }) - defer os.Remove(file) - - data := map[string]string{ - "traefik/http/routers/Router0/entryPoints/0": "web", - "traefik/http/routers/Router0/middlewares/0": "compressor", - "traefik/http/routers/Router0/middlewares/1": "striper", - "traefik/http/routers/Router0/service": "simplesvc", - "traefik/http/routers/Router0/rule": "Host(`kv1.localhost`)", - "traefik/http/routers/Router0/priority": "42", - "traefik/http/routers/Router0/tls": "true", - - "traefik/http/routers/Router1/rule": "Host(`kv2.localhost`)", - "traefik/http/routers/Router1/priority": "42", - "traefik/http/routers/Router1/tls/domains/0/main": "aaa.localhost", - "traefik/http/routers/Router1/tls/domains/0/sans/0": "aaa.aaa.localhost", - "traefik/http/routers/Router1/tls/domains/0/sans/1": "bbb.aaa.localhost", - "traefik/http/routers/Router1/tls/domains/1/main": "bbb.localhost", - "traefik/http/routers/Router1/tls/domains/1/sans/0": "aaa.bbb.localhost", - "traefik/http/routers/Router1/tls/domains/1/sans/1": "bbb.bbb.localhost", - "traefik/http/routers/Router1/entryPoints/0": "web", - "traefik/http/routers/Router1/service": "simplesvc", - - "traefik/http/services/simplesvc/loadBalancer/servers/0/url": "http://10.0.1.1:8888", - "traefik/http/services/simplesvc/loadBalancer/servers/1/url": "http://10.0.1.1:8889", - - "traefik/http/services/srvcA/loadBalancer/servers/0/url": "http://10.0.1.2:8888", - "traefik/http/services/srvcA/loadBalancer/servers/1/url": "http://10.0.1.2:8889", - - "traefik/http/services/srvcB/loadBalancer/servers/0/url": "http://10.0.1.3:8888", - "traefik/http/services/srvcB/loadBalancer/servers/1/url": "http://10.0.1.3:8889", - - "traefik/http/services/mirror/mirroring/service": "simplesvc", - "traefik/http/services/mirror/mirroring/mirrors/0/name": "srvcA", - "traefik/http/services/mirror/mirroring/mirrors/0/percent": "42", - "traefik/http/services/mirror/mirroring/mirrors/1/name": "srvcB", - "traefik/http/services/mirror/mirroring/mirrors/1/percent": "42", - - "traefik/http/services/Service03/weighted/services/0/name": "srvcA", - "traefik/http/services/Service03/weighted/services/0/weight": "42", - "traefik/http/services/Service03/weighted/services/1/name": "srvcB", - "traefik/http/services/Service03/weighted/services/1/weight": "42", - - "traefik/http/middlewares/compressor/compress": "true", - "traefik/http/middlewares/striper/stripPrefix/prefixes/0": "foo", - "traefik/http/middlewares/striper/stripPrefix/prefixes/1": "bar", - } - - for k, v := range data { - err := s.kvClient.Put(context.Background(), k, []byte(v), nil) - c.Assert(err, checker.IsNil) - } - - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, - try.BodyContains(`"striper@redis":`, `"compressor@redis":`, `"srvcA@redis":`, `"srvcB@redis":`), - ) - c.Assert(err, checker.IsNil) - - resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") - c.Assert(err, checker.IsNil) - - var obtained api.RunTimeRepresentation - err = json.NewDecoder(resp.Body).Decode(&obtained) - c.Assert(err, checker.IsNil) - got, err := json.MarshalIndent(obtained, "", " ") - c.Assert(err, checker.IsNil) - - expectedJSON := filepath.FromSlash("testdata/rawdata-redis.json") - - if *updateExpected { - err = os.WriteFile(expectedJSON, got, 0o666) - c.Assert(err, checker.IsNil) - } - - expected, err := os.ReadFile(expectedJSON) - c.Assert(err, checker.IsNil) - - if !bytes.Equal(expected, got) { - diff := difflib.UnifiedDiff{ - FromFile: "Expected", - A: difflib.SplitLines(string(expected)), - ToFile: "Got", - B: difflib.SplitLines(string(got)), - Context: 3, - } - - text, err := difflib.GetUnifiedDiffString(diff) - c.Assert(err, checker.IsNil) - c.Error(text) + require.NoError(s.T(), err, text) } } diff --git a/integration/resources/compose/access_log.yml b/integration/resources/compose/access_log.yml index 5e928ceba..c9cf06db7 100644 --- a/integration/resources/compose/access_log.yml +++ b/integration/resources/compose/access_log.yml @@ -40,7 +40,7 @@ services: traefik.http.routers.rt-authFrontend.entryPoints: httpFrontendAuth traefik.http.routers.rt-authFrontend.rule: Host(`frontend.auth.docker.local`) traefik.http.routers.rt-authFrontend.middlewares: basicauth - traefik.http.middlewares.basicauth.basicauth.users: test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/ + traefik.http.middlewares.basicauth.basicauth.users: "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/" traefik.http.services.service3.loadbalancer.server.port: 80 digestAuthMiddleware: @@ -94,8 +94,3 @@ services: traefik.http.routers.rt-preflightCORS.middlewares: preflightCORS traefik.http.middlewares.preflightCORS.headers.accessControlAllowMethods: OPTIONS, GET traefik.http.services.preflightCORS.loadbalancer.server.port: 80 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/allowlist.yml b/integration/resources/compose/allowlist.yml index 02e3761ca..0fd241322 100644 --- a/integration/resources/compose/allowlist.yml +++ b/integration/resources/compose/allowlist.yml @@ -34,8 +34,3 @@ services: traefik.http.routers.rt4.middlewares: wl4 traefik.http.middlewares.wl4.ipallowlist.sourceRange: 8.8.8.8 traefik.http.middlewares.wl4.ipallowlist.ipStrategy.excludedIPs: 10.0.0.1,10.0.0.2 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/base.yml b/integration/resources/compose/base.yml index 795f2a214..2d6380051 100644 --- a/integration/resources/compose/base.yml +++ b/integration/resources/compose/base.yml @@ -11,8 +11,3 @@ services: image: traefik/whoami labels: traefik.enable: false - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/consul.yml b/integration/resources/compose/consul.yml index 96860e10c..041ba0b45 100644 --- a/integration/resources/compose/consul.yml +++ b/integration/resources/compose/consul.yml @@ -4,8 +4,3 @@ services: image: consul:1.6 whoami: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/consul_catalog.yml b/integration/resources/compose/consul_catalog.yml index 3c9dd9f3e..6a0fd279c 100644 --- a/integration/resources/compose/consul_catalog.yml +++ b/integration/resources/compose/consul_catalog.yml @@ -2,11 +2,24 @@ version: "3.8" services: consul: image: consul:1.6.2 - command: agent -server -bootstrap -ui -client 0.0.0.0 -hcl 'connect { enabled = true }' + command: + - agent + - -server + - -bootstrap + - -ui + - -client + - 0.0.0.0 + - -hcl + - 'connect { enabled = true }' consul-agent: image: consul:1.6.2 - command: agent -retry-join consul -client 0.0.0.0 + command: + - agent + - -retry-join + - consul + - -client + - 0.0.0.0 whoami1: image: traefik/whoami @@ -30,8 +43,3 @@ services: PORT: 443 BIND: 0.0.0.0 CONSUL_HTTP_ADDR: http://consul:8500 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/docker.yml b/integration/resources/compose/docker.yml index 734e76b25..e594ec87c 100644 --- a/integration/resources/compose/docker.yml +++ b/integration/resources/compose/docker.yml @@ -36,8 +36,3 @@ services: labels: traefik.http.Routers.Super.Rule: Host(`my.super.host`) traefik.http.Services.powpow.LoadBalancer.server.Port: 2375 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/error_pages.yml b/integration/resources/compose/error_pages.yml index 6d6ab1389..03cc13f80 100644 --- a/integration/resources/compose/error_pages.yml +++ b/integration/resources/compose/error_pages.yml @@ -1,12 +1,7 @@ version: "3.8" services: nginx1: - image: nginx:1.13.8-alpine + image: nginx:1.25.3-alpine3.18 nginx2: - image: nginx:1.13.8-alpine - -networks: - default: - name: traefik-test-network - external: true + image: nginx:1.25.3-alpine3.18 diff --git a/integration/resources/compose/etcd.yml b/integration/resources/compose/etcd.yml index 72c0b3698..fb1f3f7ec 100644 --- a/integration/resources/compose/etcd.yml +++ b/integration/resources/compose/etcd.yml @@ -2,9 +2,9 @@ version: "3.8" services: etcd: image: quay.io/coreos/etcd:v3.3.18 - command: etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2380 - -networks: - default: - name: traefik-test-network - external: true + command: + - etcd + - --listen-client-urls + - http://0.0.0.0:2379 + - --advertise-client-urls + - http://0.0.0.0:2380 diff --git a/integration/resources/compose/file.yml b/integration/resources/compose/file.yml index c5f2d696f..52e973e53 100644 --- a/integration/resources/compose/file.yml +++ b/integration/resources/compose/file.yml @@ -14,8 +14,3 @@ services: whoami5: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/healthcheck.yml b/integration/resources/compose/healthcheck.yml index ba130fcf3..9419f4bce 100644 --- a/integration/resources/compose/healthcheck.yml +++ b/integration/resources/compose/healthcheck.yml @@ -11,8 +11,3 @@ services: whoami4: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/hostresolver.yml b/integration/resources/compose/hostresolver.yml index 44d19df57..680962006 100644 --- a/integration/resources/compose/hostresolver.yml +++ b/integration/resources/compose/hostresolver.yml @@ -6,8 +6,3 @@ services: traefik.enable: true traefik.http.services.service1.loadbalancer.server.port: 80 traefik.http.routers.router1.rule: Host(`github.com`) - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/k8s.yml b/integration/resources/compose/k8s.yml index d718743c1..a34f72bd7 100644 --- a/integration/resources/compose/k8s.yml +++ b/integration/resources/compose/k8s.yml @@ -1,10 +1,24 @@ version: "3.8" services: server: - image: rancher/k3s:v1.23.17-k3s1 - command: server --disable-agent --no-deploy coredns --no-deploy servicelb --no-deploy traefik --no-deploy local-storage --no-deploy metrics-server --log /output/k3s.log --bind-address=server --tls-san=server + image: rancher/k3s:v1.20.15-k3s1 + privileged: true + command: + - server + - --disable-agent + - --disable=coredns + - --disable=servicelb + - --disable=traefik + - --disable=local-storage + - --disable=metrics-server + - --log=/output/k3s.log + - --bind-address=server + - --tls-san=server + - --tls-san=172.31.42.3 + - --tls-san=172.31.42.4 environment: K3S_CLUSTER_SECRET: somethingtotallyrandom + K3S_TOKEN: somethingtotallyrandom K3S_KUBECONFIG_OUTPUT: /output/kubeconfig.yaml K3S_KUBECONFIG_MODE: 666 volumes: @@ -12,13 +26,9 @@ services: - ./fixtures/k8s:/var/lib/rancher/k3s/server/manifests node: - image: rancher/k3s:v1.23.17-k3s1 + image: rancher/k3s:v1.20.15-k3s1 privileged: true environment: + K3S_TOKEN: somethingtotallyrandom K3S_URL: https://server:6443 K3S_CLUSTER_SECRET: somethingtotallyrandom - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/minimal.yml b/integration/resources/compose/minimal.yml index c6de60515..acb12804e 100644 --- a/integration/resources/compose/minimal.yml +++ b/integration/resources/compose/minimal.yml @@ -3,12 +3,9 @@ services: whoami1: image: traefik/whoami labels: - traefik.http.Routers.RouterMini.Rule: PathPrefix(`/whoami`) + traefik.http.routers.router-mini.Rule: PathPrefix(`/whoami`) + traefik.http.routers.router-mini.service: service-mini + traefik.http.services.service-mini.loadbalancer.server.port: 80 traefik.enable: true deploy: replicas: 2 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/pebble.yml b/integration/resources/compose/pebble.yml index 0f8c18b1f..f39dc1378 100644 --- a/integration/resources/compose/pebble.yml +++ b/integration/resources/compose/pebble.yml @@ -2,14 +2,12 @@ version: "3.8" services: pebble: image: letsencrypt/pebble:v2.3.1 - command: pebble --dnsserver traefik:5053 + command: + - pebble + - --dnsserver + - host.docker.internal:5053 environment: # https://github.com/letsencrypt/pebble#testing-at-full-speed PEBBLE_VA_NOSLEEP: 1 # https://github.com/letsencrypt/pebble#invalid-anti-replay-nonce-errors PEBBLE_WFE_NONCEREJECT: 0 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/proxy-protocol.yml b/integration/resources/compose/proxy-protocol.yml index 5fa8b101c..8fa69a9ba 100644 --- a/integration/resources/compose/proxy-protocol.yml +++ b/integration/resources/compose/proxy-protocol.yml @@ -1,14 +1,4 @@ version: "3.8" services: - haproxy: - image: haproxy:2.2 - volumes: - - ./resources/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg - whoami: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/ratelimit.yml b/integration/resources/compose/ratelimit.yml index 0f4d4673b..251568165 100644 --- a/integration/resources/compose/ratelimit.yml +++ b/integration/resources/compose/ratelimit.yml @@ -2,8 +2,3 @@ version: "3.8" services: whoami1: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/redis.yml b/integration/resources/compose/redis.yml index cf859c268..09bbeacad 100644 --- a/integration/resources/compose/redis.yml +++ b/integration/resources/compose/redis.yml @@ -2,8 +2,3 @@ version: "3.8" services: redis: image: redis:5.0 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/redis_sentinel.yml b/integration/resources/compose/redis_sentinel.yml index 261e694e5..1737c2a1a 100644 --- a/integration/resources/compose/redis_sentinel.yml +++ b/integration/resources/compose/redis_sentinel.yml @@ -3,59 +3,51 @@ services: master: image: redis container_name: redis-master - command: redis-server --port 6380 - ports: - - 6380:6380 - healthcheck: - test: redis-cli -p 6380 ping + command: + - redis-server + - --port + - 6380 node1: image: redis container_name: redis-node-1 - ports: - - 6381:6381 - command: redis-server --port 6381 --slaveof redis-master 6380 - healthcheck: - test: redis-cli -p 6381 ping + command: + - redis-server + - --port + - 6381 + - --slaveof + - redis-master + - 6380 node2: image: redis container_name: redis-node-2 - ports: - - 6382:6382 - command: redis-server --port 6382 --slaveof redis-master 6380 - healthcheck: - test: redis-cli -p 6382 ping + command: + - redis-server + - --port + - 6382 + - --slaveof + - redis-master + - 6380 sentinel1: image: redis container_name: redis-sentinel-1 - ports: - - 26379:26379 - command: redis-sentinel /usr/local/etc/redis/conf/sentinel1.conf - healthcheck: - test: redis-cli -p 26379 ping + command: + - redis-sentinel + - /usr/local/etc/redis/conf/sentinel1.conf volumes: - ./resources/compose/config:/usr/local/etc/redis/conf sentinel2: image: redis container_name: redis-sentinel-2 - ports: - - 36379:26379 - command: redis-sentinel /usr/local/etc/redis/conf/sentinel2.conf - healthcheck: - test: redis-cli -p 36379 ping + command: + - redis-sentinel + - /usr/local/etc/redis/conf/sentinel2.conf volumes: - ./resources/compose/config:/usr/local/etc/redis/conf sentinel3: image: redis container_name: redis-sentinel-3 - ports: - - 46379:26379 - command: redis-sentinel /usr/local/etc/redis/conf/sentinel3.conf - healthcheck: - test: redis-cli -p 46379 ping + command: + - redis-sentinel + - /usr/local/etc/redis/conf/sentinel3.conf volumes: - ./resources/compose/config:/usr/local/etc/redis/conf - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/reqacceptgrace.yml b/integration/resources/compose/reqacceptgrace.yml index ce50efd8c..8fa69a9ba 100644 --- a/integration/resources/compose/reqacceptgrace.yml +++ b/integration/resources/compose/reqacceptgrace.yml @@ -2,8 +2,3 @@ version: "3.8" services: whoami: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/rest.yml b/integration/resources/compose/rest.yml index 0f4d4673b..251568165 100644 --- a/integration/resources/compose/rest.yml +++ b/integration/resources/compose/rest.yml @@ -2,8 +2,3 @@ version: "3.8" services: whoami1: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/retry.yml b/integration/resources/compose/retry.yml index ce50efd8c..8fa69a9ba 100644 --- a/integration/resources/compose/retry.yml +++ b/integration/resources/compose/retry.yml @@ -2,8 +2,3 @@ version: "3.8" services: whoami: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/stats.yml b/integration/resources/compose/stats.yml index 15a2813ca..599fed311 100644 --- a/integration/resources/compose/stats.yml +++ b/integration/resources/compose/stats.yml @@ -5,8 +5,3 @@ services: whoami2: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/tailscale.yml b/integration/resources/compose/tailscale.yml index 82b033ebf..dbad56561 100644 --- a/integration/resources/compose/tailscale.yml +++ b/integration/resources/compose/tailscale.yml @@ -9,9 +9,5 @@ services: cap_add: # Required for tailscale to work - net_admin - sys_module - command: tailscaled - -networks: - default: - name: traefik-test-network - external: true + command: + - tailscaled diff --git a/integration/resources/compose/tcp.yml b/integration/resources/compose/tcp.yml index 518f70ddd..cd7fc0627 100644 --- a/integration/resources/compose/tcp.yml +++ b/integration/resources/compose/tcp.yml @@ -2,38 +2,58 @@ version: "3.8" services: whoami-a: image: traefik/whoamitcp - command: -name whoami-a -certFile /certs/whoami-a.crt -keyFile /certs/whoami-a.key + command: + - -name + - whoami-a + - -certFile + - /certs/whoami-a.crt + - -keyFile + - /certs/whoami-a.key volumes: - ./fixtures/tcp:/certs whoami-b: image: traefik/whoamitcp - command: -name whoami-b -certFile /certs/whoami-b.crt -keyFile /certs/whoami-b.key + command: + - -name + - whoami-b + - -certFile + - /certs/whoami-b.crt + - -keyFile + - /certs/whoami-b.key volumes: - ./fixtures/tcp:/certs whoami-ab: image: traefik/whoamitcp - command: -name whoami-ab -certFile /certs/whoami-b.crt -keyFile /certs/whoami-b.key + command: + - -name + - whoami-ab + - -certFile + - /certs/whoami-b.crt + - -keyFile + - /certs/whoami-b.key volumes: - ./fixtures/tcp:/certs whoami-no-cert: image: traefik/whoamitcp - command: -name whoami-no-cert + command: + - -name + - whoami-no-cert whoami-no-tls: image: traefik/whoamitcp - command: -name whoami-no-tls + command: + - -name + - whoami-no-tls whoami: image: traefik/whoami whoami-banner: image: traefik/whoamitcp - command: -name whoami-banner --banner - -networks: - default: - name: traefik-test-network - external: true + command: + - -name + - whoami-banner + - --banner diff --git a/integration/resources/compose/timeout.yml b/integration/resources/compose/timeout.yml index 727f2e567..6e415b9b0 100644 --- a/integration/resources/compose/timeout.yml +++ b/integration/resources/compose/timeout.yml @@ -5,8 +5,3 @@ services: environment: PROTO: http PORT: 9000 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/tlsclientheaders.yml b/integration/resources/compose/tlsclientheaders.yml index 5bb836607..ef16f5f36 100644 --- a/integration/resources/compose/tlsclientheaders.yml +++ b/integration/resources/compose/tlsclientheaders.yml @@ -7,8 +7,3 @@ services: traefik.http.routers.route1.middlewares: passtls traefik.http.routers.route1.tls: true traefik.http.middlewares.passtls.passtlsclientcert.pem: true - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/tracing.yml b/integration/resources/compose/tracing.yml index 4cd02cec0..6f6c15526 100644 --- a/integration/resources/compose/tracing.yml +++ b/integration/resources/compose/tracing.yml @@ -12,8 +12,3 @@ services: - ./fixtures/tracing/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml whoami: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/udp.yml b/integration/resources/compose/udp.yml index d3018fae9..ce2633199 100644 --- a/integration/resources/compose/udp.yml +++ b/integration/resources/compose/udp.yml @@ -2,20 +2,21 @@ version: "3.8" services: whoami-a: image: traefik/whoamiudp:latest - command: -name whoami-a + command: + - -name + - whoami-a whoami-b: image: traefik/whoamiudp:latest - command: -name whoami-b + command: + - -name + - whoami-b whoami-c: image: traefik/whoamiudp:latest - command: -name whoami-c + command: + - -name + - whoami-c whoami-d: image: traefik/whoami - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/compose/whitelist.yml b/integration/resources/compose/whitelist.yml new file mode 100644 index 000000000..790ce52b7 --- /dev/null +++ b/integration/resources/compose/whitelist.yml @@ -0,0 +1,36 @@ +version: "3.8" +services: + noOverrideWhitelist: + image: traefik/whoami + labels: + traefik.enable: true + traefik.http.routers.rt1.rule: Host(`no.override.whitelist.docker.local`) + traefik.http.routers.rt1.middlewares: wl1 + traefik.http.middlewares.wl1.ipwhitelist.sourceRange: 8.8.8.8 + + overrideIPStrategyRemoteAddrWhitelist: + image: traefik/whoami + labels: + traefik.enable: true + traefik.http.routers.rt2.rule: Host(`override.remoteaddr.whitelist.docker.local`) + traefik.http.routers.rt2.middlewares: wl2 + traefik.http.middlewares.wl2.ipwhitelist.sourceRange: 8.8.8.8 + traefik.http.middlewares.wl2.ipwhitelist.ipStrategy: true + + overrideIPStrategyDepthWhitelist: + image: traefik/whoami + labels: + traefik.enable: true + traefik.http.routers.rt3.rule: Host(`override.depth.whitelist.docker.local`) + traefik.http.routers.rt3.middlewares: wl3 + traefik.http.middlewares.wl3.ipwhitelist.sourceRange: 8.8.8.8 + traefik.http.middlewares.wl3.ipwhitelist.ipStrategy.depth: 3 + + overrideIPStrategyExcludedIPsWhitelist: + image: traefik/whoami + labels: + traefik.enable: true + traefik.http.routers.rt4.rule: Host(`override.excludedips.whitelist.docker.local`) + traefik.http.routers.rt4.middlewares: wl4 + traefik.http.middlewares.wl4.ipwhitelist.sourceRange: 8.8.8.8 + traefik.http.middlewares.wl4.ipwhitelist.ipStrategy.excludedIPs: 10.0.0.1,10.0.0.2 diff --git a/integration/resources/compose/zookeeper.yml b/integration/resources/compose/zookeeper.yml index c75424e8d..9861c1437 100644 --- a/integration/resources/compose/zookeeper.yml +++ b/integration/resources/compose/zookeeper.yml @@ -2,8 +2,3 @@ version: "3.8" services: zookeeper: image: zookeeper:3.5 - -networks: - default: - name: traefik-test-network - external: true diff --git a/integration/resources/haproxy/haproxy.cfg b/integration/resources/haproxy/haproxy.cfg deleted file mode 100644 index 22b3fbd62..000000000 --- a/integration/resources/haproxy/haproxy.cfg +++ /dev/null @@ -1,30 +0,0 @@ -global - maxconn 4096 - -defaults - log global - mode http - retries 3 - option redispatch - maxconn 2000 - timeout connect 5000 - timeout client 50000 - timeout server 50000 - -frontend TestServerTest - bind 0.0.0.0:80 - mode tcp - default_backend TestServerNodes - -frontend TestServerTestV2 - bind 0.0.0.0:81 - mode tcp - default_backend TestServerNodesV2 - -backend TestServerNodes - mode tcp - server TestServer01 traefik:8000 send-proxy - - backend TestServerNodesV2 - mode tcp - server TestServer01 traefik:8000 send-proxy-v2 diff --git a/integration/rest_test.go b/integration/rest_test.go index 1178fbb94..2600a08c9 100644 --- a/integration/rest_test.go +++ b/integration/rest_test.go @@ -5,14 +5,15 @@ import ( "encoding/json" "net" "net/http" - "os" "strings" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/config/dynamic" - checker "github.com/vdemeester/shakers" ) type RestSuite struct { @@ -20,28 +21,33 @@ type RestSuite struct { whoamiAddr string } -func (s *RestSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "rest") - s.composeUp(c) - - s.whoamiAddr = net.JoinHostPort(s.getComposeServiceIP(c, "whoami1"), "80") +func TestRestSuite(t *testing.T) { + suite.Run(t, new(RestSuite)) } -func (s *RestSuite) TestSimpleConfigurationInsecure(c *check.C) { - cmd, display := s.traefikCmd(withConfigFile("fixtures/rest/simple.toml")) +func (s *RestSuite) SetupSuite() { + s.BaseSuite.SetupSuite() - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.createComposeProject("rest") + s.composeUp() + + s.whoamiAddr = net.JoinHostPort(s.getComposeServiceIP("whoami1"), "80") +} + +func (s *RestSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *RestSuite) TestSimpleConfigurationInsecure() { + s.traefikCmd(withConfigFile("fixtures/rest/simple.toml")) // wait for Traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("rest@internal")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("rest@internal")) + require.NoError(s.T(), err) // Expected a 404 as we did not configure anything. err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) testCase := []struct { desc string @@ -105,47 +111,41 @@ func (s *RestSuite) TestSimpleConfigurationInsecure(c *check.C) { for _, test := range testCase { data, err := json.Marshal(test.config) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodPut, "http://127.0.0.1:8080/api/providers/rest", bytes.NewReader(data)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 3*time.Second, try.BodyContains(test.ruleMatch)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } -func (s *RestSuite) TestSimpleConfiguration(c *check.C) { - file := s.adaptFile(c, "fixtures/rest/simple_secure.toml", struct{}{}) - defer os.Remove(file) +func (s *RestSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/rest/simple_secure.toml", struct{}{}) - cmd, display := s.traefikCmd(withConfigFile(file)) - - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // Expected a 404 as we did not configure anything. - err = try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 1000*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2000*time.Millisecond, try.BodyContains("PathPrefix(`/secure`)")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodPut, "http://127.0.0.1:8080/api/providers/rest", strings.NewReader("{}")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusNotFound) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusNotFound, response.StatusCode) testCase := []struct { desc string @@ -209,19 +209,19 @@ func (s *RestSuite) TestSimpleConfiguration(c *check.C) { for _, test := range testCase { data, err := json.Marshal(test.config) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodPut, "http://127.0.0.1:8000/secure/api/providers/rest", bytes.NewReader(data)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains(test.ruleMatch)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/", time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } } diff --git a/integration/retry_test.go b/integration/retry_test.go index 27d451094..12d0be8ac 100644 --- a/integration/retry_test.go +++ b/integration/retry_test.go @@ -3,13 +3,14 @@ package integration import ( "io" "net/http" - "os" + "testing" "time" - "github.com/go-check/check" "github.com/gorilla/websocket" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type RetrySuite struct { @@ -17,96 +18,86 @@ type RetrySuite struct { whoamiIP string } -func (s *RetrySuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "retry") - s.composeUp(c) - - s.whoamiIP = s.getComposeServiceIP(c, "whoami") +func TestRetrySuite(t *testing.T) { + suite.Run(t, new(RetrySuite)) } -func (s *RetrySuite) TestRetry(c *check.C) { - file := s.adaptFile(c, "fixtures/retry/simple.toml", struct{ WhoamiIP string }{s.whoamiIP}) - defer os.Remove(file) +func (s *RetrySuite) SetupSuite() { + s.BaseSuite.SetupSuite() - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.createComposeProject("retry") + s.composeUp() - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) - c.Assert(err, checker.IsNil) + s.whoamiIP = s.getComposeServiceIP("whoami") +} + +func (s *RetrySuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *RetrySuite) TestRetry() { + file := s.adaptFile("fixtures/retry/simple.toml", struct{ WhoamiIP string }{s.whoamiIP}) + + s.traefikCmd(withConfigFile(file)) + + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) + require.NoError(s.T(), err) response, err := http.Get("http://127.0.0.1:8000/") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // The test only verifies that the retry middleware makes sure that the working service is eventually reached. - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) } -func (s *RetrySuite) TestRetryBackoff(c *check.C) { - file := s.adaptFile(c, "fixtures/retry/backoff.toml", struct{ WhoamiIP string }{s.whoamiIP}) - defer os.Remove(file) +func (s *RetrySuite) TestRetryBackoff() { + file := s.adaptFile("fixtures/retry/backoff.toml", struct{ WhoamiIP string }{s.whoamiIP}) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) + require.NoError(s.T(), err) response, err := http.Get("http://127.0.0.1:8000/") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // The test only verifies that the retry middleware allows finally to reach the working service. - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) } -func (s *RetrySuite) TestRetryWebsocket(c *check.C) { - file := s.adaptFile(c, "fixtures/retry/simple.toml", struct{ WhoamiIP string }{s.whoamiIP}) - defer os.Remove(file) +func (s *RetrySuite) TestRetryWebsocket() { + file := s.adaptFile("fixtures/retry/simple.toml", struct{ WhoamiIP string }{s.whoamiIP}) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) + require.NoError(s.T(), err) // The test only verifies that the retry middleware makes sure that the working service is eventually reached. _, response, err := websocket.DefaultDialer.Dial("ws://127.0.0.1:8000/echo", nil) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusSwitchingProtocols) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusSwitchingProtocols, response.StatusCode) // The test verifies a second time that the working service is eventually reached. _, response, err = websocket.DefaultDialer.Dial("ws://127.0.0.1:8000/echo", nil) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusSwitchingProtocols) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusSwitchingProtocols, response.StatusCode) } -func (s *RetrySuite) TestRetryWithStripPrefix(c *check.C) { - file := s.adaptFile(c, "fixtures/retry/strip_prefix.toml", struct{ WhoamiIP string }{s.whoamiIP}) - defer os.Remove(file) +func (s *RetrySuite) TestRetryWithStripPrefix() { + file := s.adaptFile("fixtures/retry/strip_prefix.toml", struct{ WhoamiIP string }{s.whoamiIP}) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("PathPrefix(`/`)")) + require.NoError(s.T(), err) response, err := http.Get("http://127.0.0.1:8000/test") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body, err := io.ReadAll(response.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - c.Assert(string(body), checker.Contains, "GET / HTTP/1.1") - c.Assert(string(body), checker.Contains, "X-Forwarded-Prefix: /test") + assert.Contains(s.T(), string(body), "GET / HTTP/1.1") + assert.Contains(s.T(), string(body), "X-Forwarded-Prefix: /test") } diff --git a/integration/simple_test.go b/integration/simple_test.go index a8faa6bd7..d8f0f45b7 100644 --- a/integration/simple_test.go +++ b/integration/simple_test.go @@ -15,25 +15,36 @@ import ( "strings" "sync/atomic" "syscall" + "testing" "time" - "github.com/go-check/check" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/config/dynamic" - checker "github.com/vdemeester/shakers" ) // SimpleSuite tests suite. type SimpleSuite struct{ BaseSuite } -func (s *SimpleSuite) TestInvalidConfigShouldFail(c *check.C) { - cmd, output := s.cmdTraefik(withConfigFile("fixtures/invalid_configuration.toml")) +func TestSimpleSuite(t *testing.T) { + suite.Run(t, new(SimpleSuite)) +} - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *SimpleSuite) SetupSuite() { + s.BaseSuite.SetupSuite() +} - err = try.Do(500*time.Millisecond, func() error { +func (s *SimpleSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *SimpleSuite) TestInvalidConfigShouldFail() { + _, output := s.cmdTraefik(withConfigFile("fixtures/invalid_configuration.toml")) + + err := try.Do(500*time.Millisecond, func() error { expected := "expected '.' or '=', but got '{' instead" actual := output.String() @@ -43,40 +54,28 @@ func (s *SimpleSuite) TestInvalidConfigShouldFail(c *check.C) { return nil }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestSimpleDefaultConfig(c *check.C) { - cmd, _ := s.cmdTraefik(withConfigFile("fixtures/simple_default.toml")) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *SimpleSuite) TestSimpleDefaultConfig() { + s.cmdTraefik(withConfigFile("fixtures/simple_default.toml")) // Expected a 404 as we did not configure anything - err = try.GetRequest("http://127.0.0.1:8000/", 1*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 1*time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestWithWebConfig(c *check.C) { - cmd, _ := s.cmdTraefik(withConfigFile("fixtures/simple_web.toml")) +func (s *SimpleSuite) TestWithWebConfig() { + s.cmdTraefik(withConfigFile("fixtures/simple_web.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestPrintHelp(c *check.C) { - cmd, output := s.cmdTraefik("--help") +func (s *SimpleSuite) TestPrintHelp() { + _, output := s.cmdTraefik("--help") - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.Do(500*time.Millisecond, func() error { + err := try.Do(500*time.Millisecond, func() error { expected := "Usage:" notExpected := "panic:" actual := output.String() @@ -90,61 +89,55 @@ func (s *SimpleSuite) TestPrintHelp(c *check.C) { return nil }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestRequestAcceptGraceTimeout(c *check.C) { - s.createComposeProject(c, "reqacceptgrace") +func (s *SimpleSuite) TestRequestAcceptGraceTimeout() { + s.createComposeProject("reqacceptgrace") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoamiURL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami"), "80") + whoamiURL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami"), "80") - file := s.adaptFile(c, "fixtures/reqacceptgrace.toml", struct { + file := s.adaptFile("fixtures/reqacceptgrace.toml", struct { Server string }{whoamiURL}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + cmd, _ := s.cmdTraefik(withConfigFile(file)) // Wait for Traefik to turn ready. - err = try.GetRequest("http://127.0.0.1:8000/", 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) // Make sure exposed service is ready. err = try.GetRequest("http://127.0.0.1:8000/service", 3*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Check that /ping endpoint is responding with 200. err = try.GetRequest("http://127.0.0.1:8001/ping", 3*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Send SIGTERM to Traefik. proc, err := os.FindProcess(cmd.Process.Pid) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = proc.Signal(syscall.SIGTERM) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Give Traefik time to process the SIGTERM and send a request half-way // into the request accepting grace period, by which requests should // still get served. time.Sleep(5 * time.Second) resp, err := http.Get("http://127.0.0.1:8000/service") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) defer resp.Body.Close() - c.Assert(resp.StatusCode, checker.Equals, http.StatusOK) + assert.Equal(s.T(), http.StatusOK, resp.StatusCode) // ping endpoint should now return a Service Unavailable. resp, err = http.Get("http://127.0.0.1:8001/ping") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) defer resp.Body.Close() - c.Assert(resp.StatusCode, checker.Equals, http.StatusServiceUnavailable) + assert.Equal(s.T(), http.StatusServiceUnavailable, resp.StatusCode) // Expect Traefik to shut down gracefully once the request accepting grace // period has elapsed. @@ -155,229 +148,192 @@ func (s *SimpleSuite) TestRequestAcceptGraceTimeout(c *check.C) { select { case err := <-waitErr: - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) case <-time.After(10 * time.Second): // By now we are ~5 seconds out of the request accepting grace period // (start + 5 seconds sleep prior to the mid-grace period request + // 10 seconds timeout = 15 seconds > 10 seconds grace period). // Something must have gone wrong if we still haven't terminated at // this point. - c.Fatal("Traefik did not terminate in time") + s.T().Fatal("Traefik did not terminate in time") } } -func (s *SimpleSuite) TestCustomPingTerminationStatusCode(c *check.C) { - file := s.adaptFile(c, "fixtures/custom_ping_termination_status_code.toml", struct{}{}) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) +func (s *SimpleSuite) TestCustomPingTerminationStatusCode() { + file := s.adaptFile("fixtures/custom_ping_termination_status_code.toml", struct{}{}) + cmd, _ := s.cmdTraefik(withConfigFile(file)) // Wait for Traefik to turn ready. - err = try.GetRequest("http://127.0.0.1:8001/", 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8001/", 2*time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) // Check that /ping endpoint is responding with 200. err = try.GetRequest("http://127.0.0.1:8001/ping", 3*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Send SIGTERM to Traefik. proc, err := os.FindProcess(cmd.Process.Pid) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = proc.Signal(syscall.SIGTERM) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // ping endpoint should now return a Service Unavailable. err = try.GetRequest("http://127.0.0.1:8001/ping", 2*time.Second, try.StatusCodeIs(http.StatusNoContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestStatsWithMultipleEntryPoint(c *check.C) { - c.Skip("Stats is missing") - s.createComposeProject(c, "stats") +func (s *SimpleSuite) TestStatsWithMultipleEntryPoint() { + s.T().Skip("Stats is missing") + s.createComposeProject("stats") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoami1URL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami1"), "80") - whoami2URL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami2"), "80") + whoami1URL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami1"), "80") + whoami2URL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami2"), "80") - file := s.adaptFile(c, "fixtures/simple_stats.toml", struct { + file := s.adaptFile("fixtures/simple_stats.toml", struct { Server1 string Server2 string }{whoami1URL, whoami2URL}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api", 1*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/health", 1*time.Second, try.BodyContains(`"total_status_code_count":{"200":2}`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestNoAuthOnPing(c *check.C) { - c.Skip("Waiting for new api handler implementation") +func (s *SimpleSuite) TestNoAuthOnPing() { + s.T().Skip("Waiting for new api handler implementation") - s.createComposeProject(c, "base") + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - file := s.adaptFile(c, "./fixtures/simple_auth.toml", struct{}{}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + file := s.adaptFile("./fixtures/simple_auth.toml", struct{}{}) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8001/api/rawdata", 2*time.Second, try.StatusCodeIs(http.StatusUnauthorized)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8001/api/rawdata", 2*time.Second, try.StatusCodeIs(http.StatusUnauthorized)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8001/ping", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestDefaultEntryPointHTTP(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestDefaultEntryPointHTTP() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd("--entryPoints.http.Address=:8000", "--log.level=DEBUG", "--providers.docker", "--api.insecure") - defer output(c) + s.traefikCmd("--entryPoints.http.Address=:8000", "--log.level=DEBUG", "--providers.docker", "--api.insecure") - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestWithNonExistingEntryPoint(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestWithNonExistingEntryPoint() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd("--entryPoints.http.Address=:8000", "--log.level=DEBUG", "--providers.docker", "--api.insecure") - defer output(c) + s.traefikCmd("--entryPoints.http.Address=:8000", "--log.level=DEBUG", "--providers.docker", "--api.insecure") - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestMetricsPrometheusDefaultEntryPoint(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestMetricsPrometheusDefaultEntryPoint() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd("--entryPoints.http.Address=:8000", "--api.insecure", "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0", "--providers.docker", "--metrics.prometheus.addrouterslabels=true", "--log.level=DEBUG") - defer output(c) + s.traefikCmd("--entryPoints.http.Address=:8000", "--api.insecure", "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0", "--providers.docker", "--metrics.prometheus.addrouterslabels=true", "--log.level=DEBUG") - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/whoami`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/whoami`)")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/metrics", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/metrics", 1*time.Second, try.BodyContains("_router_")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/metrics", 1*time.Second, try.BodyContains("_entrypoint_")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/metrics", 1*time.Second, try.BodyContains("_service_")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestMetricsPrometheusTwoRoutersOneService(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestMetricsPrometheusTwoRoutersOneService() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd("--entryPoints.http.Address=:8000", "--api.insecure", "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0", "--providers.docker", "--metrics.prometheus.addentrypointslabels=false", "--metrics.prometheus.addrouterslabels=true", "--log.level=DEBUG") - defer output(c) + s.traefikCmd("--entryPoints.http.Address=:8000", "--api.insecure", "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0", "--providers.docker", "--metrics.prometheus.addentrypointslabels=false", "--metrics.prometheus.addrouterslabels=true", "--log.level=DEBUG") - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami2", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // adding a loop to test if metrics are not deleted for i := 0; i < 10; i++ { request, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/metrics", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) body, err := io.ReadAll(response.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // Reqs count of 1 for both routers - c.Assert(string(body), checker.Contains, "traefik_router_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",router=\"router1@docker\",service=\"whoami1-traefik-integration-test-base@docker\"} 1") - c.Assert(string(body), checker.Contains, "traefik_router_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",router=\"router2@docker\",service=\"whoami1-traefik-integration-test-base@docker\"} 1") + assert.Contains(s.T(), string(body), "traefik_router_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",router=\"router1@docker\",service=\"whoami1@docker\"} 1") + assert.Contains(s.T(), string(body), "traefik_router_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",router=\"router2@docker\",service=\"whoami1@docker\"} 1") // Reqs count of 2 for service behind both routers - c.Assert(string(body), checker.Contains, "traefik_service_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"whoami1-traefik-integration-test-base@docker\"} 2") + assert.Contains(s.T(), string(body), "traefik_service_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"whoami1@docker\"} 2") } } // TestMetricsWithBufferingMiddleware checks that the buffering middleware // (which introduces its own response writer in the chain), does not interfere with // the capture middleware on which the metrics mechanism relies. -func (s *SimpleSuite) TestMetricsWithBufferingMiddleware(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestMetricsWithBufferingMiddleware() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) @@ -387,113 +343,96 @@ func (s *SimpleSuite) TestMetricsWithBufferingMiddleware(c *check.C) { server.Start() defer server.Close() - file := s.adaptFile(c, "fixtures/simple_metrics_with_buffer_middleware.toml", struct{ IP string }{IP: strings.TrimPrefix(server.URL, "http://")}) - defer os.Remove(file) + file := s.adaptFile("fixtures/simple_metrics_with_buffer_middleware.toml", struct{ IP string }{IP: strings.TrimPrefix(server.URL, "http://")}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/without`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/without`)")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8001/without", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8002/with-req", strings.NewReader("MORE THAN TEN BYTES IN REQUEST")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // The request should fail because the body is too large. err = try.Request(req, 1*time.Second, try.StatusCodeIs(http.StatusRequestEntityTooLarge)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // The request should fail because the response exceeds the configured limit. err = try.GetRequest("http://127.0.0.1:8003/with-resp", 1*time.Second, try.StatusCodeIs(http.StatusInternalServerError)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8080/metrics", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) body, err := io.ReadAll(response.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // For allowed requests and responses, the entrypoint and service metrics have the same status code. - c.Assert(string(body), checker.Contains, "traefik_entrypoint_requests_total{code=\"200\",entrypoint=\"webA\",method=\"GET\",protocol=\"http\"} 1") - c.Assert(string(body), checker.Contains, "traefik_entrypoint_requests_bytes_total{code=\"200\",entrypoint=\"webA\",method=\"GET\",protocol=\"http\"} 0") - c.Assert(string(body), checker.Contains, "traefik_entrypoint_responses_bytes_total{code=\"200\",entrypoint=\"webA\",method=\"GET\",protocol=\"http\"} 31") + assert.Contains(s.T(), string(body), "traefik_entrypoint_requests_total{code=\"200\",entrypoint=\"webA\",method=\"GET\",protocol=\"http\"} 1") + assert.Contains(s.T(), string(body), "traefik_entrypoint_requests_bytes_total{code=\"200\",entrypoint=\"webA\",method=\"GET\",protocol=\"http\"} 0") + assert.Contains(s.T(), string(body), "traefik_entrypoint_responses_bytes_total{code=\"200\",entrypoint=\"webA\",method=\"GET\",protocol=\"http\"} 31") - c.Assert(string(body), checker.Contains, "traefik_service_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-without@file\"} 1") - c.Assert(string(body), checker.Contains, "traefik_service_requests_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-without@file\"} 0") - c.Assert(string(body), checker.Contains, "traefik_service_responses_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-without@file\"} 31") + assert.Contains(s.T(), string(body), "traefik_service_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-without@file\"} 1") + assert.Contains(s.T(), string(body), "traefik_service_requests_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-without@file\"} 0") + assert.Contains(s.T(), string(body), "traefik_service_responses_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-without@file\"} 31") // For forbidden requests, the entrypoints have metrics, the services don't. - c.Assert(string(body), checker.Contains, "traefik_entrypoint_requests_total{code=\"413\",entrypoint=\"webB\",method=\"GET\",protocol=\"http\"} 1") - c.Assert(string(body), checker.Contains, "traefik_entrypoint_requests_bytes_total{code=\"413\",entrypoint=\"webB\",method=\"GET\",protocol=\"http\"} 0") - c.Assert(string(body), checker.Contains, "traefik_entrypoint_responses_bytes_total{code=\"413\",entrypoint=\"webB\",method=\"GET\",protocol=\"http\"} 24") + assert.Contains(s.T(), string(body), "traefik_entrypoint_requests_total{code=\"413\",entrypoint=\"webB\",method=\"GET\",protocol=\"http\"} 1") + assert.Contains(s.T(), string(body), "traefik_entrypoint_requests_bytes_total{code=\"413\",entrypoint=\"webB\",method=\"GET\",protocol=\"http\"} 0") + assert.Contains(s.T(), string(body), "traefik_entrypoint_responses_bytes_total{code=\"413\",entrypoint=\"webB\",method=\"GET\",protocol=\"http\"} 24") // For disallowed responses, the entrypoint and service metrics don't have the same status code. - c.Assert(string(body), checker.Contains, "traefik_entrypoint_requests_bytes_total{code=\"500\",entrypoint=\"webC\",method=\"GET\",protocol=\"http\"} 0") - c.Assert(string(body), checker.Contains, "traefik_entrypoint_requests_total{code=\"500\",entrypoint=\"webC\",method=\"GET\",protocol=\"http\"} 1") - c.Assert(string(body), checker.Contains, "traefik_entrypoint_responses_bytes_total{code=\"500\",entrypoint=\"webC\",method=\"GET\",protocol=\"http\"} 21") + assert.Contains(s.T(), string(body), "traefik_entrypoint_requests_bytes_total{code=\"500\",entrypoint=\"webC\",method=\"GET\",protocol=\"http\"} 0") + assert.Contains(s.T(), string(body), "traefik_entrypoint_requests_total{code=\"500\",entrypoint=\"webC\",method=\"GET\",protocol=\"http\"} 1") + assert.Contains(s.T(), string(body), "traefik_entrypoint_responses_bytes_total{code=\"500\",entrypoint=\"webC\",method=\"GET\",protocol=\"http\"} 21") - c.Assert(string(body), checker.Contains, "traefik_service_requests_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-resp@file\"} 0") - c.Assert(string(body), checker.Contains, "traefik_service_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-resp@file\"} 1") - c.Assert(string(body), checker.Contains, "traefik_service_responses_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-resp@file\"} 31") + assert.Contains(s.T(), string(body), "traefik_service_requests_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-resp@file\"} 0") + assert.Contains(s.T(), string(body), "traefik_service_requests_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-resp@file\"} 1") + assert.Contains(s.T(), string(body), "traefik_service_responses_bytes_total{code=\"200\",method=\"GET\",protocol=\"http\",service=\"service-resp@file\"} 31") } -func (s *SimpleSuite) TestMultipleProviderSameBackendName(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestMultipleProviderSameBackendName() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoami1IP := s.getComposeServiceIP(c, "whoami1") - whoami2IP := s.getComposeServiceIP(c, "whoami2") - file := s.adaptFile(c, "fixtures/multiple_provider.toml", struct{ IP string }{IP: whoami2IP}) - defer os.Remove(file) + whoami1IP := s.getComposeServiceIP("whoami1") + whoami2IP := s.getComposeServiceIP("whoami2") + file := s.adaptFile("fixtures/multiple_provider.toml", struct{ IP string }{IP: whoami2IP}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/whoami", 1*time.Second, try.BodyContains(whoami1IP)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/file", 1*time.Second, try.BodyContains(whoami2IP)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestIPStrategyAllowlist(c *check.C) { - s.createComposeProject(c, "allowlist") +func (s *SimpleSuite) TestIPStrategyAllowlist() { + s.createComposeProject("allowlist") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd(withConfigFile("fixtures/simple_allowlist.toml")) - defer output(c) + s.traefikCmd(withConfigFile("fixtures/simple_allowlist.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("override")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("override")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("override.remoteaddr.allowlist.docker.local")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) testCases := []struct { desc string @@ -540,31 +479,87 @@ func (s *SimpleSuite) TestIPStrategyAllowlist(c *check.C) { req.RequestURI = "" err = try.Request(req, 1*time.Second, try.StatusCodeIs(test.expectedStatusCode)) - if err != nil { - c.Fatalf("Error while %s: %v", test.desc, err) - } + require.NoErrorf(s.T(), err, "Error during %s: %v", test.desc, err) } } -func (s *SimpleSuite) TestXForwardedHeaders(c *check.C) { - s.createComposeProject(c, "allowlist") +func (s *SimpleSuite) TestIPStrategyWhitelist() { + s.createComposeProject("whitelist") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd(withConfigFile("fixtures/simple_allowlist.toml")) - defer output(c) + s.traefikCmd(withConfigFile("fixtures/simple_whitelist.toml")) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("override")) + require.NoError(s.T(), err) - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("override.remoteaddr.whitelist.docker.local")) + require.NoError(s.T(), err) + + testCases := []struct { + desc string + xForwardedFor string + host string + expectedStatusCode int + }{ + { + desc: "override remote addr reject", + xForwardedFor: "8.8.8.8,8.8.8.8", + host: "override.remoteaddr.whitelist.docker.local", + expectedStatusCode: 403, + }, + { + desc: "override depth accept", + xForwardedFor: "8.8.8.8,10.0.0.1,127.0.0.1", + host: "override.depth.whitelist.docker.local", + expectedStatusCode: 200, + }, + { + desc: "override depth reject", + xForwardedFor: "10.0.0.1,8.8.8.8,127.0.0.1", + host: "override.depth.whitelist.docker.local", + expectedStatusCode: 403, + }, + { + desc: "override excludedIPs reject", + xForwardedFor: "10.0.0.3,10.0.0.1,10.0.0.2", + host: "override.excludedips.whitelist.docker.local", + expectedStatusCode: 403, + }, + { + desc: "override excludedIPs accept", + xForwardedFor: "8.8.8.8,10.0.0.1,10.0.0.2", + host: "override.excludedips.whitelist.docker.local", + expectedStatusCode: 200, + }, + } + + for _, test := range testCases { + req := httptest.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) + req.Header.Set("X-Forwarded-For", test.xForwardedFor) + req.Host = test.host + req.RequestURI = "" + + err = try.Request(req, 1*time.Second, try.StatusCodeIs(test.expectedStatusCode)) + require.NoErrorf(s.T(), err, "Error during %s: %v", test.desc, err) + } +} + +func (s *SimpleSuite) TestXForwardedHeaders() { + s.createComposeProject("allowlist") + + s.composeUp() + defer s.composeDown() + + s.traefikCmd(withConfigFile("fixtures/simple_allowlist.toml")) + + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("override.remoteaddr.allowlist.docker.local")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = "override.depth.allowlist.docker.local" req.Header.Set("X-Forwarded-For", "8.8.8.8,10.0.0.1,127.0.0.1") @@ -573,29 +568,23 @@ func (s *SimpleSuite) TestXForwardedHeaders(c *check.C) { try.StatusCodeIs(http.StatusOK), try.BodyContains("X-Forwarded-Proto", "X-Forwarded-For", "X-Forwarded-Host", "X-Forwarded-Host", "X-Forwarded-Port", "X-Forwarded-Server", "X-Real-Ip")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestMultiProvider(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestMultiProvider() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoamiURL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami1"), "80") + whoamiURL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami1"), "80") - file := s.adaptFile(c, "fixtures/multiprovider.toml", struct{ Server string }{Server: whoamiURL}) - defer os.Remove(file) + file := s.adaptFile("fixtures/multiprovider.toml", struct{ Server string }{Server: whoamiURL}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("service")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("service")) + require.NoError(s.T(), err) config := dynamic.Configuration{ HTTP: &dynamic.HTTPConfiguration{ @@ -611,39 +600,33 @@ func (s *SimpleSuite) TestMultiProvider(c *check.C) { } jsonContent, err := json.Marshal(config) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodPut, "http://127.0.0.1:8080/api/providers/rest", bytes.NewReader(jsonContent)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(request) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1000*time.Millisecond, try.BodyContains("PathPrefix(`/`)")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/", 1*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("CustomValue")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestSimpleConfigurationHostRequestTrailingPeriod(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestSimpleConfigurationHostRequestTrailingPeriod() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoamiURL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami1"), "80") + whoamiURL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami1"), "80") - file := s.adaptFile(c, "fixtures/file/simple-hosts.toml", struct{ Server string }{Server: whoamiURL}) - defer os.Remove(file) + file := s.adaptFile("fixtures/file/simple-hosts.toml", struct{ Server string }{Server: whoamiURL}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) testCases := []struct { desc string @@ -669,177 +652,133 @@ func (s *SimpleSuite) TestSimpleConfigurationHostRequestTrailingPeriod(c *check. for _, test := range testCases { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Host = test.requestHost err = try.Request(req, 1*time.Second, try.StatusCodeIs(http.StatusOK)) - if err != nil { - c.Fatalf("Error while testing %s: %v", test.desc, err) - } + require.NoErrorf(s.T(), err, "Error while testing %s: %v", test.desc, err) } } -func (s *SimpleSuite) TestRouterConfigErrors(c *check.C) { - file := s.adaptFile(c, "fixtures/router_errors.toml", struct{}{}) - defer os.Remove(file) +func (s *SimpleSuite) TestRouterConfigErrors() { + file := s.adaptFile("fixtures/router_errors.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // All errors - err = try.GetRequest("http://127.0.0.1:8080/api/http/routers", 1000*time.Millisecond, try.BodyContains(`["middleware \"unknown@file\" does not exist","found different TLS options for routers on the same host snitest.net, so using the default TLS options instead"]`)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/http/routers", 1000*time.Millisecond, try.BodyContains(`["middleware \"unknown@file\" does not exist","found different TLS options for routers on the same host snitest.net, so using the default TLS options instead"]`)) + require.NoError(s.T(), err) // router3 has an error because it uses an unknown entrypoint err = try.GetRequest("http://127.0.0.1:8080/api/http/routers/router3@file", 1000*time.Millisecond, try.BodyContains(`entryPoint \"unknown-entrypoint\" doesn't exist`, "no valid entryPoint for this router")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // router4 is enabled, but in warning state because its tls options conf was messed up err = try.GetRequest("http://127.0.0.1:8080/api/http/routers/router4@file", 1000*time.Millisecond, try.BodyContains(`"status":"warning"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // router5 is disabled because its middleware conf is broken err = try.GetRequest("http://127.0.0.1:8080/api/http/routers/router5@file", 1000*time.Millisecond, try.BodyContains()) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestServiceConfigErrors(c *check.C) { - file := s.adaptFile(c, "fixtures/service_errors.toml", struct{}{}) - defer os.Remove(file) +func (s *SimpleSuite) TestServiceConfigErrors() { + file := s.adaptFile("fixtures/service_errors.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains(`["the service \"service1@file\" does not have any type defined"]`)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains(`["the service \"service1@file\" does not have any type defined"]`)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/http/services/service1@file", 1000*time.Millisecond, try.BodyContains(`"status":"disabled"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/http/services/service2@file", 1000*time.Millisecond, try.BodyContains(`"status":"enabled"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestTCPRouterConfigErrors(c *check.C) { - file := s.adaptFile(c, "fixtures/router_errors.toml", struct{}{}) - defer os.Remove(file) +func (s *SimpleSuite) TestTCPRouterConfigErrors() { + file := s.adaptFile("fixtures/router_errors.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // router3 has an error because it uses an unknown entrypoint - err = try.GetRequest("http://127.0.0.1:8080/api/tcp/routers/router3@file", 1000*time.Millisecond, try.BodyContains(`entryPoint \"unknown-entrypoint\" doesn't exist`, "no valid entryPoint for this router")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/tcp/routers/router3@file", 1000*time.Millisecond, try.BodyContains(`entryPoint \"unknown-entrypoint\" doesn't exist`, "no valid entryPoint for this router")) + require.NoError(s.T(), err) // router4 has an unsupported Rule err = try.GetRequest("http://127.0.0.1:8080/api/tcp/routers/router4@file", 1000*time.Millisecond, try.BodyContains("invalid rule: \\\"Host(`mydomain.com`)\\\"")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestTCPServiceConfigErrors(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/service_errors.toml", struct{}{}) - defer os.Remove(file) +func (s *SimpleSuite) TestTCPServiceConfigErrors() { + file := s.adaptFile("fixtures/tcp/service_errors.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/tcp/services", 1000*time.Millisecond, try.BodyContains(`["the service \"service1@file\" does not have any type defined"]`)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/tcp/services", 1000*time.Millisecond, try.BodyContains(`["the service \"service1@file\" does not have any type defined"]`)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/tcp/services/service1@file", 1000*time.Millisecond, try.BodyContains(`"status":"disabled"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/tcp/services/service2@file", 1000*time.Millisecond, try.BodyContains(`"status":"enabled"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestUDPRouterConfigErrors(c *check.C) { - file := s.adaptFile(c, "fixtures/router_errors.toml", struct{}{}) - defer os.Remove(file) +func (s *SimpleSuite) TestUDPRouterConfigErrors() { + file := s.adaptFile("fixtures/router_errors.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/udp/routers/router3@file", 1000*time.Millisecond, try.BodyContains(`entryPoint \"unknown-entrypoint\" doesn't exist`, "no valid entryPoint for this router")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/udp/routers/router3@file", 1000*time.Millisecond, try.BodyContains(`entryPoint \"unknown-entrypoint\" doesn't exist`, "no valid entryPoint for this router")) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestUDPServiceConfigErrors(c *check.C) { - file := s.adaptFile(c, "fixtures/udp/service_errors.toml", struct{}{}) - defer os.Remove(file) +func (s *SimpleSuite) TestUDPServiceConfigErrors() { + file := s.adaptFile("fixtures/udp/service_errors.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/udp/services", 1000*time.Millisecond, try.BodyContains(`["the UDP service \"service1@file\" does not have any type defined"]`)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/udp/services", 1000*time.Millisecond, try.BodyContains(`["the UDP service \"service1@file\" does not have any type defined"]`)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/udp/services/service1@file", 1000*time.Millisecond, try.BodyContains(`"status":"disabled"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/udp/services/service2@file", 1000*time.Millisecond, try.BodyContains(`"status":"enabled"`)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestWRR(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestWRR() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoami1IP := s.getComposeServiceIP(c, "whoami1") - whoami2IP := s.getComposeServiceIP(c, "whoami2") + whoami1IP := s.getComposeServiceIP("whoami1") + whoami2IP := s.getComposeServiceIP("whoami2") - file := s.adaptFile(c, "fixtures/wrr.toml", struct { + file := s.adaptFile("fixtures/wrr.toml", struct { Server1 string Server2 string }{Server1: "http://" + whoami1IP, Server2: "http://" + whoami2IP}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("service1", "service2")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("service1", "service2")) + require.NoError(s.T(), err) repartition := map[string]int{} for i := 0; i < 4; i++ { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) body, err := io.ReadAll(response.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if strings.Contains(string(body), whoami1IP) { repartition[whoami1IP]++ @@ -849,50 +788,44 @@ func (s *SimpleSuite) TestWRR(c *check.C) { } } - c.Assert(repartition[whoami1IP], checker.Equals, 3) - c.Assert(repartition[whoami2IP], checker.Equals, 1) + assert.Equal(s.T(), 3, repartition[whoami1IP]) + assert.Equal(s.T(), 1, repartition[whoami2IP]) } -func (s *SimpleSuite) TestWRRSticky(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestWRRSticky() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoami1IP := s.getComposeServiceIP(c, "whoami1") - whoami2IP := s.getComposeServiceIP(c, "whoami2") + whoami1IP := s.getComposeServiceIP("whoami1") + whoami2IP := s.getComposeServiceIP("whoami2") - file := s.adaptFile(c, "fixtures/wrr_sticky.toml", struct { + file := s.adaptFile("fixtures/wrr_sticky.toml", struct { Server1 string Server2 string }{Server1: "http://" + whoami1IP, Server2: "http://" + whoami2IP}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("service1", "service2")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("service1", "service2")) + require.NoError(s.T(), err) repartition := map[string]int{} req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) for i := 0; i < 4; i++ { response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) for _, cookie := range response.Cookies() { req.AddCookie(cookie) } body, err := io.ReadAll(response.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if strings.Contains(string(body), whoami1IP) { repartition[whoami1IP]++ @@ -902,11 +835,11 @@ func (s *SimpleSuite) TestWRRSticky(c *check.C) { } } - c.Assert(repartition[whoami1IP], checker.Equals, 4) - c.Assert(repartition[whoami2IP], checker.Equals, 0) + assert.Equal(s.T(), 4, repartition[whoami1IP]) + assert.Equal(s.T(), 0, repartition[whoami2IP]) } -func (s *SimpleSuite) TestMirror(c *check.C) { +func (s *SimpleSuite) TestMirror() { var count, countMirror1, countMirror2 int32 main := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { @@ -925,64 +858,54 @@ func (s *SimpleSuite) TestMirror(c *check.C) { mirror1Server := mirror1.URL mirror2Server := mirror2.URL - file := s.adaptFile(c, "fixtures/mirror.toml", struct { + file := s.adaptFile("fixtures/mirror.toml", struct { MainServer string Mirror1Server string Mirror2Server string }{MainServer: mainServer, Mirror1Server: mirror1Server, Mirror2Server: mirror2Server}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("mirror1", "mirror2", "service1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("mirror1", "mirror2", "service1")) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) for i := 0; i < 10; i++ { response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) } countTotal := atomic.LoadInt32(&count) val1 := atomic.LoadInt32(&countMirror1) val2 := atomic.LoadInt32(&countMirror2) - c.Assert(countTotal, checker.Equals, int32(10)) - c.Assert(val1, checker.Equals, int32(1)) - c.Assert(val2, checker.Equals, int32(5)) + assert.Equal(s.T(), int32(10), countTotal) + assert.Equal(s.T(), int32(1), val1) + assert.Equal(s.T(), int32(5), val2) } -func (s *SimpleSuite) TestMirrorWithBody(c *check.C) { +func (s *SimpleSuite) TestMirrorWithBody() { var count, countMirror1, countMirror2 int32 body20 := make([]byte, 20) _, err := rand.Read(body20) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) body5 := make([]byte, 5) _, err = rand.Read(body5) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) verifyBody := func(req *http.Request) { b, _ := io.ReadAll(req.Body) switch req.Header.Get("Size") { case "20": - if !bytes.Equal(b, body20) { - c.Fatalf("Not Equals \n%v \n%v", body20, b) - } + require.Equal(s.T(), body20, b) case "5": - if !bytes.Equal(b, body5) { - c.Fatalf("Not Equals \n%v \n%v", body5, b) - } + require.Equal(s.T(), body5, b) default: - c.Fatal("Size header not present") + s.T().Fatal("Size header not present") } } @@ -1005,84 +928,78 @@ func (s *SimpleSuite) TestMirrorWithBody(c *check.C) { mirror1Server := mirror1.URL mirror2Server := mirror2.URL - file := s.adaptFile(c, "fixtures/mirror.toml", struct { + file := s.adaptFile("fixtures/mirror.toml", struct { MainServer string Mirror1Server string Mirror2Server string }{MainServer: mainServer, Mirror1Server: mirror1Server, Mirror2Server: mirror2Server}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) - - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("mirror1", "mirror2", "service1")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", bytes.NewBuffer(body20)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Header.Set("Size", "20") for i := 0; i < 10; i++ { response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) } countTotal := atomic.LoadInt32(&count) val1 := atomic.LoadInt32(&countMirror1) val2 := atomic.LoadInt32(&countMirror2) - c.Assert(countTotal, checker.Equals, int32(10)) - c.Assert(val1, checker.Equals, int32(1)) - c.Assert(val2, checker.Equals, int32(5)) + assert.Equal(s.T(), int32(10), countTotal) + assert.Equal(s.T(), int32(1), val1) + assert.Equal(s.T(), int32(5), val2) atomic.StoreInt32(&count, 0) atomic.StoreInt32(&countMirror1, 0) atomic.StoreInt32(&countMirror2, 0) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoamiWithMaxBody", bytes.NewBuffer(body5)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Header.Set("Size", "5") for i := 0; i < 10; i++ { response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) } countTotal = atomic.LoadInt32(&count) val1 = atomic.LoadInt32(&countMirror1) val2 = atomic.LoadInt32(&countMirror2) - c.Assert(countTotal, checker.Equals, int32(10)) - c.Assert(val1, checker.Equals, int32(1)) - c.Assert(val2, checker.Equals, int32(5)) + assert.Equal(s.T(), int32(10), countTotal) + assert.Equal(s.T(), int32(1), val1) + assert.Equal(s.T(), int32(5), val2) atomic.StoreInt32(&count, 0) atomic.StoreInt32(&countMirror1, 0) atomic.StoreInt32(&countMirror2, 0) req, err = http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoamiWithMaxBody", bytes.NewBuffer(body20)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Header.Set("Size", "20") for i := 0; i < 10; i++ { response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) } countTotal = atomic.LoadInt32(&count) val1 = atomic.LoadInt32(&countMirror1) val2 = atomic.LoadInt32(&countMirror2) - c.Assert(countTotal, checker.Equals, int32(10)) - c.Assert(val1, checker.Equals, int32(0)) - c.Assert(val2, checker.Equals, int32(0)) + assert.Equal(s.T(), int32(10), countTotal) + assert.Equal(s.T(), int32(0), val1) + assert.Equal(s.T(), int32(0), val2) } -func (s *SimpleSuite) TestMirrorCanceled(c *check.C) { +func (s *SimpleSuite) TestMirrorCanceled() { var count, countMirror1, countMirror2 int32 main := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { @@ -1102,26 +1019,20 @@ func (s *SimpleSuite) TestMirrorCanceled(c *check.C) { mirror1Server := mirror1.URL mirror2Server := mirror2.URL - file := s.adaptFile(c, "fixtures/mirror.toml", struct { + file := s.adaptFile("fixtures/mirror.toml", struct { MainServer string Mirror1Server string Mirror2Server string }{MainServer: mainServer, Mirror1Server: mirror1Server, Mirror2Server: mirror2Server}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("mirror1", "mirror2", "service1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/http/services", 1000*time.Millisecond, try.BodyContains("mirror1", "mirror2", "service1")) + require.NoError(s.T(), err) for i := 0; i < 5; i++ { req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/whoami", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) client := &http.Client{ Timeout: time.Second, @@ -1133,38 +1044,32 @@ func (s *SimpleSuite) TestMirrorCanceled(c *check.C) { val1 := atomic.LoadInt32(&countMirror1) val2 := atomic.LoadInt32(&countMirror2) - c.Assert(countTotal, checker.Equals, int32(5)) - c.Assert(val1, checker.Equals, int32(0)) - c.Assert(val2, checker.Equals, int32(0)) + assert.Equal(s.T(), int32(5), countTotal) + assert.Equal(s.T(), int32(0), val1) + assert.Equal(s.T(), int32(0), val2) } -func (s *SimpleSuite) TestSecureAPI(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestSecureAPI() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - file := s.adaptFile(c, "./fixtures/simple_secure_api.toml", struct{}{}) - defer os.Remove(file) + file := s.adaptFile("./fixtures/simple_secure_api.toml", struct{}{}) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8000/secure/api/rawdata", 1*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/secure/api/rawdata", 1*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/api/rawdata", 1*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestContentTypeDisableAutoDetect(c *check.C) { +func (s *SimpleSuite) TestContentTypeDisableAutoDetect() { srv1 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { rw.Header()["Content-Type"] = nil path := strings.TrimPrefix(req.URL.Path, "/autodetect") @@ -1177,7 +1082,7 @@ func (s *SimpleSuite) TestContentTypeDisableAutoDetect(c *check.C) { rw.WriteHeader(http.StatusOK) _, err := rw.Write([]byte(".testcss { }")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) case "/pdf": if strings.Contains(req.URL.Path, "/ct") { rw.Header().Set("Content-Type", "application/pdf") @@ -1186,38 +1091,32 @@ func (s *SimpleSuite) TestContentTypeDisableAutoDetect(c *check.C) { rw.WriteHeader(http.StatusOK) data, err := os.ReadFile("fixtures/test.pdf") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = rw.Write(data) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } })) defer srv1.Close() - file := s.adaptFile(c, "fixtures/simple_contenttype.toml", struct { + file := s.adaptFile("fixtures/simple_contenttype.toml", struct { Server string }{ Server: srv1.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/css/ct", time.Second, try.HasHeaderValue("Content-Type", "text/css", false)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/pdf/ct", time.Second, try.HasHeaderValue("Content-Type", "application/pdf", false)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/css/noct", time.Second, func(res *http.Response) error { if ct, ok := res.Header["Content-Type"]; ok { @@ -1225,7 +1124,7 @@ func (s *SimpleSuite) TestContentTypeDisableAutoDetect(c *check.C) { } return nil }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/pdf/noct", time.Second, func(res *http.Response) error { if ct, ok := res.Header["Content-Type"]; ok { @@ -1233,43 +1132,37 @@ func (s *SimpleSuite) TestContentTypeDisableAutoDetect(c *check.C) { } return nil }) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/autodetect/css/ct", time.Second, try.HasHeaderValue("Content-Type", "text/css", false)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/autodetect/pdf/ct", time.Second, try.HasHeaderValue("Content-Type", "application/pdf", false)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/autodetect/css/noct", time.Second, try.HasHeaderValue("Content-Type", "text/plain; charset=utf-8", false)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/autodetect/pdf/noct", time.Second, try.HasHeaderValue("Content-Type", "application/pdf", false)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *SimpleSuite) TestMuxer(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestMuxer() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoami1URL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami1"), "80") + whoami1URL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami1"), "80") - file := s.adaptFile(c, "fixtures/simple_muxer.toml", struct { + file := s.adaptFile("fixtures/simple_muxer.toml", struct { Server1 string }{whoami1URL}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("!Host")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("!Host")) + require.NoError(s.T(), err) testCases := []struct { desc string @@ -1349,79 +1242,68 @@ func (s *SimpleSuite) TestMuxer(c *check.C) { for _, test := range testCases { conn, err := net.Dial("tcp", test.target) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = conn.Write([]byte(test.request)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.ReadResponse(bufio.NewReader(conn), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - c.Assert(resp.StatusCode, checker.Equals, test.expected, check.Commentf(test.desc)) + assert.Equal(s.T(), test.expected, resp.StatusCode, test.desc) if test.body != "" { body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) - c.Assert(string(body), checker.Contains, test.body) + require.NoError(s.T(), err) + assert.Contains(s.T(), string(body), test.body) } } } -func (s *SimpleSuite) TestDebugLog(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestDebugLog() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - file := s.adaptFile(c, "fixtures/simple_debug_log.toml", struct{}{}) - defer os.Remove(file) + file := s.adaptFile("fixtures/simple_debug_log.toml", struct{}{}) - cmd, output := s.cmdTraefik(withConfigFile(file)) + _, output := s.cmdTraefik(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/whoami`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("PathPrefix(`/whoami`)")) + require.NoError(s.T(), err) req, err := http.NewRequest(http.MethodGet, "http://localhost:8000/whoami", http.NoBody) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req.Header.Set("Autorization", "Bearer ThisIsABearerToken") response, err := http.DefaultClient.Do(req) - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusOK) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusOK, response.StatusCode) if regexp.MustCompile("ThisIsABearerToken").MatchReader(output) { - c.Logf("Traefik Logs: %s", output.String()) - c.Log("Found Authorization Header in Traefik DEBUG logs") - c.Fail() + log.Info().Msgf("Traefik Logs: %s", output.String()) + log.Info().Msg("Found Authorization Header in Traefik DEBUG logs") + s.T().Fail() } } -func (s *SimpleSuite) TestEncodeSemicolons(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestEncodeSemicolons() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - whoami1URL := "http://" + net.JoinHostPort(s.getComposeServiceIP(c, "whoami1"), "80") + whoami1URL := "http://" + net.JoinHostPort(s.getComposeServiceIP("whoami1"), "80") - file := s.adaptFile(c, "fixtures/simple_encode_semicolons.toml", struct { + file := s.adaptFile("fixtures/simple_encode_semicolons.toml", struct { Server1 string }{whoami1URL}) - defer os.Remove(file) - cmd, output := s.traefikCmd(withConfigFile(file)) - defer output(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`other.localhost`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 1*time.Second, try.BodyContains("Host(`other.localhost`)")) + require.NoError(s.T(), err) testCases := []struct { desc string @@ -1448,50 +1330,45 @@ func (s *SimpleSuite) TestEncodeSemicolons(c *check.C) { for _, test := range testCases { conn, err := net.Dial("tcp", test.target) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = conn.Write([]byte(test.request)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.ReadResponse(bufio.NewReader(conn), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if resp.StatusCode != test.expected { - c.Errorf("%s failed with %d instead of %d", test.desc, resp.StatusCode, test.expected) + log.Info().Msgf("%s failed with %d instead of %d", test.desc, resp.StatusCode, test.expected) } if test.body != "" { body, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) - c.Assert(string(body), checker.Contains, test.body) + require.NoError(s.T(), err) + assert.Contains(s.T(), string(body), test.body) } } } -func (s *SimpleSuite) TestDenyFragment(c *check.C) { - s.createComposeProject(c, "base") +func (s *SimpleSuite) TestDenyFragment() { + s.createComposeProject("base") - s.composeUp(c) - defer s.composeDown(c) + s.composeUp() + defer s.composeDown() - cmd, output := s.traefikCmd(withConfigFile("fixtures/simple_default.toml")) - defer output(c) - - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile("fixtures/simple_default.toml")) // Expected a 404 as we did not configure anything - err = try.GetRequest("http://127.0.0.1:8000/", 1*time.Second, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8000/", 1*time.Second, try.StatusCodeIs(http.StatusNotFound)) + require.NoError(s.T(), err) conn, err := net.Dial("tcp", "127.0.0.1:8000") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = conn.Write([]byte("GET /#/?bar=toto;boo=titi HTTP/1.1\nHost: other.localhost\n\n")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.ReadResponse(bufio.NewReader(conn), nil) - c.Assert(err, checker.IsNil) - c.Assert(resp.StatusCode, checker.Equals, http.StatusBadRequest) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusBadRequest, resp.StatusCode) } diff --git a/integration/tcp_test.go b/integration/tcp_test.go index 43a7158d0..732bc1f03 100644 --- a/integration/tcp_test.go +++ b/integration/tcp_test.go @@ -5,63 +5,69 @@ import ( "crypto/x509" "errors" "fmt" + "io" "net" "net/http" "net/http/httptest" - "os" "strings" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type TCPSuite struct{ BaseSuite } -func (s *TCPSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "tcp") - s.composeUp(c) +func TestTCPSuite(t *testing.T) { + suite.Run(t, new(TCPSuite)) } -func (s *TCPSuite) TestMixed(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/mixed.toml", struct { +func (s *TCPSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("tcp") + s.composeUp() +} + +func (s *TCPSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *TCPSuite) TestMixed() { + file := s.adaptFile("fixtures/tcp/mixed.toml", struct { Whoami string WhoamiA string WhoamiB string WhoamiNoCert string }{ - Whoami: "http://" + s.getComposeServiceIP(c, "whoami") + ":80", - WhoamiA: s.getComposeServiceIP(c, "whoami-a") + ":8080", - WhoamiB: s.getComposeServiceIP(c, "whoami-b") + ":8080", - WhoamiNoCert: s.getComposeServiceIP(c, "whoami-no-cert") + ":8080", + Whoami: "http://" + s.getComposeServiceIP("whoami") + ":80", + WhoamiA: s.getComposeServiceIP("whoami-a") + ":8080", + WhoamiB: s.getComposeServiceIP("whoami-b") + ":8080", + WhoamiNoCert: s.getComposeServiceIP("whoami-no-cert") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("Path(`/test`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("Path(`/test`)")) + require.NoError(s.T(), err) // Traefik passes through, termination handled by whoami-a out, err := guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-a.test") - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-a") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-a") // Traefik passes through, termination handled by whoami-b out, err = guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-b.test") - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-b") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-b") // Termination handled by traefik out, err = guessWho("127.0.0.1:8093", "whoami-c.test", true) - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-no-cert") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-no-cert") tr1 := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -69,174 +75,143 @@ func (s *TCPSuite) TestMixed(c *check.C) { }, } req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:8093/whoami/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.RequestWithTransport(req, 10*time.Second, tr1, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) req, err = http.NewRequest(http.MethodGet, "https://127.0.0.1:8093/not-found/", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.RequestWithTransport(req, 10*time.Second, tr1, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8093/test", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8093/not-found", 500*time.Millisecond, try.StatusCodeIs(http.StatusNotFound)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *TCPSuite) TestTLSOptions(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/multi-tls-options.toml", struct { +func (s *TCPSuite) TestTLSOptions() { + file := s.adaptFile("fixtures/tcp/multi-tls-options.toml", struct { WhoamiNoCert string }{ - WhoamiNoCert: s.getComposeServiceIP(c, "whoami-no-cert") + ":8080", + WhoamiNoCert: s.getComposeServiceIP("whoami-no-cert") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-c.test`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-c.test`)")) + require.NoError(s.T(), err) // Check that we can use a client tls version <= 1.2 with hostSNI 'whoami-c.test' out, err := guessWhoTLSMaxVersion("127.0.0.1:8093", "whoami-c.test", true, tls.VersionTLS12) - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-no-cert") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-no-cert") // Check that we can use a client tls version <= 1.3 with hostSNI 'whoami-d.test' out, err = guessWhoTLSMaxVersion("127.0.0.1:8093", "whoami-d.test", true, tls.VersionTLS13) - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-no-cert") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-no-cert") // Check that we cannot use a client tls version <= 1.2 with hostSNI 'whoami-d.test' _, err = guessWhoTLSMaxVersion("127.0.0.1:8093", "whoami-d.test", true, tls.VersionTLS12) - c.Assert(err, checker.NotNil) - c.Assert(err.Error(), checker.Contains, "protocol version not supported") + assert.ErrorContains(s.T(), err, "protocol version not supported") // Check that we can't reach a route with an invalid mTLS configuration. conn, err := tls.Dial("tcp", "127.0.0.1:8093", &tls.Config{ ServerName: "whoami-i.test", InsecureSkipVerify: true, }) - c.Assert(conn, checker.IsNil) - c.Assert(err, checker.NotNil) + assert.Nil(s.T(), conn) + assert.Error(s.T(), err) } -func (s *TCPSuite) TestNonTLSFallback(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/non-tls-fallback.toml", struct { +func (s *TCPSuite) TestNonTLSFallback() { + file := s.adaptFile("fixtures/tcp/non-tls-fallback.toml", struct { WhoamiA string WhoamiB string WhoamiNoCert string WhoamiNoTLS string }{ - WhoamiA: s.getComposeServiceIP(c, "whoami-a") + ":8080", - WhoamiB: s.getComposeServiceIP(c, "whoami-b") + ":8080", - WhoamiNoCert: s.getComposeServiceIP(c, "whoami-no-cert") + ":8080", - WhoamiNoTLS: s.getComposeServiceIP(c, "whoami-no-tls") + ":8080", + WhoamiA: s.getComposeServiceIP("whoami-a") + ":8080", + WhoamiB: s.getComposeServiceIP("whoami-b") + ":8080", + WhoamiNoCert: s.getComposeServiceIP("whoami-no-cert") + ":8080", + WhoamiNoTLS: s.getComposeServiceIP("whoami-no-tls") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) + require.NoError(s.T(), err) // Traefik passes through, termination handled by whoami-a out, err := guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-a.test") - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-a") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-a") // Traefik passes through, termination handled by whoami-b out, err = guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-b.test") - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-b") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-b") // Termination handled by traefik out, err = guessWho("127.0.0.1:8093", "whoami-c.test", true) - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-no-cert") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-no-cert") out, err = guessWho("127.0.0.1:8093", "", false) - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-no-tls") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-no-tls") } -func (s *TCPSuite) TestNonTlsTcp(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/non-tls.toml", struct { +func (s *TCPSuite) TestNonTlsTcp() { + file := s.adaptFile("fixtures/tcp/non-tls.toml", struct { WhoamiNoTLS string }{ - WhoamiNoTLS: s.getComposeServiceIP(c, "whoami-no-tls") + ":8080", + WhoamiNoTLS: s.getComposeServiceIP("whoami-no-tls") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) + require.NoError(s.T(), err) // Traefik will forward every requests on the given port to whoami-no-tls out, err := guessWho("127.0.0.1:8093", "", false) - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-no-tls") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-no-tls") } -func (s *TCPSuite) TestCatchAllNoTLS(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/catch-all-no-tls.toml", struct { +func (s *TCPSuite) TestCatchAllNoTLS() { + file := s.adaptFile("fixtures/tcp/catch-all-no-tls.toml", struct { WhoamiBannerAddress string }{ - WhoamiBannerAddress: s.getComposeServiceIP(c, "whoami-banner") + ":8080", + WhoamiBannerAddress: s.getComposeServiceIP("whoami-banner") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) + require.NoError(s.T(), err) // Traefik will forward every requests on the given port to whoami-no-tls out, err := welcome("127.0.0.1:8093") - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "Welcome") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "Welcome") } -func (s *TCPSuite) TestCatchAllNoTLSWithHTTPS(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/catch-all-no-tls-with-https.toml", struct { +func (s *TCPSuite) TestCatchAllNoTLSWithHTTPS() { + file := s.adaptFile("fixtures/tcp/catch-all-no-tls-with-https.toml", struct { WhoamiNoTLSAddress string WhoamiURL string }{ - WhoamiNoTLSAddress: s.getComposeServiceIP(c, "whoami-no-tls") + ":8080", - WhoamiURL: "http://" + s.getComposeServiceIP(c, "whoami") + ":80", + WhoamiNoTLSAddress: s.getComposeServiceIP("whoami-no-tls") + ":8080", + WhoamiURL: "http://" + s.getComposeServiceIP("whoami") + ":80", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`*`)")) + require.NoError(s.T(), err) req := httptest.NewRequest(http.MethodGet, "https://127.0.0.1:8093/test", nil) req.RequestURI = "" @@ -246,64 +221,76 @@ func (s *TCPSuite) TestCatchAllNoTLSWithHTTPS(c *check.C) { InsecureSkipVerify: true, }, }, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *TCPSuite) TestMiddlewareAllowList(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/ipallowlist.toml", struct { +func (s *TCPSuite) TestMiddlewareAllowList() { + file := s.adaptFile("fixtures/tcp/ip-allowlist.toml", struct { WhoamiA string WhoamiB string }{ - WhoamiA: s.getComposeServiceIP(c, "whoami-a") + ":8080", - WhoamiB: s.getComposeServiceIP(c, "whoami-b") + ":8080", + WhoamiA: s.getComposeServiceIP("whoami-a") + ":8080", + WhoamiB: s.getComposeServiceIP("whoami-b") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-a.test`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-a.test`)")) + require.NoError(s.T(), err) // Traefik not passes through, ipAllowList closes connection _, err = guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-a.test") - c.Assert(err, checker.ErrorMatches, "EOF") + assert.ErrorIs(s.T(), err, io.EOF) // Traefik passes through, termination handled by whoami-b out, err := guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-b.test") - c.Assert(err, checker.IsNil) - c.Assert(out, checker.Contains, "whoami-b") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-b") } -func (s *TCPSuite) TestWRR(c *check.C) { - file := s.adaptFile(c, "fixtures/tcp/wrr.toml", struct { +func (s *TCPSuite) TestMiddlewareWhiteList() { + file := s.adaptFile("fixtures/tcp/ip-whitelist.toml", struct { + WhoamiA string + WhoamiB string + }{ + WhoamiA: s.getComposeServiceIP("whoami-a") + ":8080", + WhoamiB: s.getComposeServiceIP("whoami-b") + ":8080", + }) + + s.traefikCmd(withConfigFile(file)) + + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-a.test`)")) + require.NoError(s.T(), err) + + // Traefik not passes through, ipWhiteList closes connection + _, err = guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-a.test") + assert.ErrorIs(s.T(), err, io.EOF) + + // Traefik passes through, termination handled by whoami-b + out, err := guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-b.test") + require.NoError(s.T(), err) + assert.Contains(s.T(), out, "whoami-b") +} + +func (s *TCPSuite) TestWRR() { + file := s.adaptFile("fixtures/tcp/wrr.toml", struct { WhoamiB string WhoamiAB string }{ - WhoamiB: s.getComposeServiceIP(c, "whoami-b") + ":8080", - WhoamiAB: s.getComposeServiceIP(c, "whoami-ab") + ":8080", + WhoamiB: s.getComposeServiceIP("whoami-b") + ":8080", + WhoamiAB: s.getComposeServiceIP("whoami-ab") + ":8080", }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-b.test`)")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("HostSNI(`whoami-b.test`)")) + require.NoError(s.T(), err) call := map[string]int{} for i := 0; i < 4; i++ { // Traefik passes through, termination handled by whoami-b or whoami-bb out, err := guessWhoTLSPassthrough("127.0.0.1:8093", "whoami-b.test") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) switch { case strings.Contains(out, "whoami-b"): call["whoami-b"]++ @@ -315,7 +302,7 @@ func (s *TCPSuite) TestWRR(c *check.C) { time.Sleep(time.Second) } - c.Assert(call, checker.DeepEquals, map[string]int{"whoami-b": 3, "whoami-ab": 1}) + assert.EqualValues(s.T(), call, map[string]int{"whoami-b": 3, "whoami-ab": 1}) } func welcome(addr string) (string, error) { diff --git a/integration/testdata/rawdata-crd-label-selector.json b/integration/testdata/rawdata-crd-label-selector.json index b5c9f1669..445a7daf3 100644 --- a/integration/testdata/rawdata-crd-label-selector.json +++ b/integration/testdata/rawdata-crd-label-selector.json @@ -45,7 +45,7 @@ "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.6:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -59,7 +59,7 @@ ], "serverStatus": { "http://10.42.0.3:80": "UP", - "http://10.42.0.6:80": "UP" + "http://10.42.0.5:80": "UP" } }, "noop@internal": { diff --git a/integration/testdata/rawdata-crd.json b/integration/testdata/rawdata-crd.json index 81f397196..5724a7126 100644 --- a/integration/testdata/rawdata-crd.json +++ b/integration/testdata/rawdata-crd.json @@ -139,7 +139,7 @@ "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.7:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -153,7 +153,7 @@ ], "serverStatus": { "http://10.42.0.3:80": "UP", - "http://10.42.0.7:80": "UP" + "http://10.42.0.5:80": "UP" } }, "default-test2-route-23c7f4c450289ee29016@kubernetescrd": { @@ -163,7 +163,7 @@ "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.7:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -177,7 +177,7 @@ ], "serverStatus": { "http://10.42.0.3:80": "UP", - "http://10.42.0.7:80": "UP" + "http://10.42.0.5:80": "UP" } }, "default-testst-route-60ad45fcb5fc1f5f3629@kubernetescrd": { @@ -187,7 +187,7 @@ "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.7:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -202,7 +202,7 @@ ], "serverStatus": { "http://10.42.0.3:80": "UP", - "http://10.42.0.7:80": "UP" + "http://10.42.0.5:80": "UP" } }, "default-whoami-80@kubernetescrd": { @@ -212,7 +212,7 @@ "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.7:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -223,7 +223,7 @@ "status": "enabled", "serverStatus": { "http://10.42.0.3:80": "UP", - "http://10.42.0.7:80": "UP" + "http://10.42.0.5:80": "UP" } }, "default-wrr1@kubernetescrd": { @@ -295,7 +295,7 @@ "address": "10.42.0.2:8080" }, { - "address": "10.42.0.4:8080" + "address": "10.42.0.6:8080" } ] }, @@ -347,10 +347,10 @@ "loadBalancer": { "servers": [ { - "address": "10.42.0.5:8090" + "address": "10.42.0.4:8090" }, { - "address": "10.42.0.6:8090" + "address": "10.42.0.7:8090" } ] }, diff --git a/integration/testdata/rawdata-gateway.json b/integration/testdata/rawdata-gateway.json index d629cfc41..f8e364e66 100644 --- a/integration/testdata/rawdata-gateway.json +++ b/integration/testdata/rawdata-gateway.json @@ -127,7 +127,7 @@ "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.4:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -138,7 +138,7 @@ "status": "enabled", "serverStatus": { "http://10.42.0.3:80": "UP", - "http://10.42.0.4:80": "UP" + "http://10.42.0.5:80": "UP" } }, "noop@internal": { diff --git a/integration/testdata/rawdata-ingress-label-selector.json b/integration/testdata/rawdata-ingress-label-selector.json index d72826ae7..f8e4c88a3 100644 --- a/integration/testdata/rawdata-ingress-label-selector.json +++ b/integration/testdata/rawdata-ingress-label-selector.json @@ -83,10 +83,10 @@ "loadBalancer": { "servers": [ { - "url": "http://10.42.0.2:80" + "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.7:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -99,8 +99,8 @@ "default-test-ingress-whoami-test-whoami@kubernetes" ], "serverStatus": { - "http://10.42.0.2:80": "UP", - "http://10.42.0.7:80": "UP" + "http://10.42.0.3:80": "UP", + "http://10.42.0.5:80": "UP" } }, "noop@internal": { diff --git a/integration/testdata/rawdata-ingress.json b/integration/testdata/rawdata-ingress.json index ecfa38ee6..305cb3015 100644 --- a/integration/testdata/rawdata-ingress.json +++ b/integration/testdata/rawdata-ingress.json @@ -119,10 +119,10 @@ "loadBalancer": { "servers": [ { - "url": "XXXX" + "url": "http://10.42.0.3:80" }, { - "url": "XXXX" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -136,18 +136,18 @@ "default-whoami-keep-route-whoami-test-keep-keep@kubernetes" ], "serverStatus": { - "http://XXXX": "UP", - "http://XXXX": "UP" + "http://10.42.0.3:80": "UP", + "http://10.42.0.5:80": "UP" } }, "default-whoami-http@kubernetes": { "loadBalancer": { "servers": [ { - "url": "http://10.42.0.10:80" + "url": "http://10.42.0.3:80" }, { - "url": "http://10.42.0.8:80" + "url": "http://10.42.0.5:80" } ], "passHostHeader": true, @@ -161,8 +161,8 @@ "default-test-ingress-whoami-test-whoami@kubernetes" ], "serverStatus": { - "http://10.42.0.10:80": "UP", - "http://10.42.0.8:80": "UP" + "http://10.42.0.3:80": "UP", + "http://10.42.0.5:80": "UP" } }, "noop@internal": { diff --git a/integration/testdata/rawdata-ingressclass.json b/integration/testdata/rawdata-ingressclass.json index 4215504c0..a020096cc 100644 --- a/integration/testdata/rawdata-ingressclass.json +++ b/integration/testdata/rawdata-ingressclass.json @@ -83,7 +83,7 @@ "loadBalancer": { "servers": [ { - "url": "http://10.42.0.4:80" + "url": "http://10.42.0.3:80" }, { "url": "http://10.42.0.5:80" @@ -99,7 +99,7 @@ "default-whoami-keep-route-whoami-test-keep-keep@kubernetes" ], "serverStatus": { - "http://10.42.0.4:80": "UP", + "http://10.42.0.3:80": "UP", "http://10.42.0.5:80": "UP" } }, diff --git a/integration/timeout_test.go b/integration/timeout_test.go index 457e2bcfb..8d958db9d 100644 --- a/integration/timeout_test.go +++ b/integration/timeout_test.go @@ -4,47 +4,53 @@ import ( "fmt" "net" "net/http" - "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type TimeoutSuite struct{ BaseSuite } -func (s *TimeoutSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "timeout") - s.composeUp(c) +func TestTimeoutSuite(t *testing.T) { + suite.Run(t, new(TimeoutSuite)) } -func (s *TimeoutSuite) TestForwardingTimeouts(c *check.C) { - timeoutEndpointIP := s.getComposeServiceIP(c, "timeoutEndpoint") - file := s.adaptFile(c, "fixtures/timeout/forwarding_timeouts.toml", struct{ TimeoutEndpoint string }{timeoutEndpointIP}) - defer os.Remove(file) +func (s *TimeoutSuite) SetupSuite() { + s.BaseSuite.SetupSuite() - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.createComposeProject("timeout") + s.composeUp() +} - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Path(`/dialTimeout`)")) - c.Assert(err, checker.IsNil) +func (s *TimeoutSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *TimeoutSuite) TestForwardingTimeouts() { + timeoutEndpointIP := s.getComposeServiceIP("timeoutEndpoint") + file := s.adaptFile("fixtures/timeout/forwarding_timeouts.toml", struct{ TimeoutEndpoint string }{timeoutEndpointIP}) + + s.traefikCmd(withConfigFile(file)) + + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 60*time.Second, try.BodyContains("Path(`/dialTimeout`)")) + require.NoError(s.T(), err) // This simulates a DialTimeout when connecting to the backend server. response, err := http.Get("http://127.0.0.1:8000/dialTimeout") - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusGatewayTimeout) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusGatewayTimeout, response.StatusCode) // Check that timeout service is available statusURL := fmt.Sprintf("http://%s/statusTest?status=200", net.JoinHostPort(timeoutEndpointIP, "9000")) - c.Assert(try.GetRequest(statusURL, 60*time.Second, try.StatusCodeIs(http.StatusOK)), checker.IsNil) + assert.NoError(s.T(), try.GetRequest(statusURL, 60*time.Second, try.StatusCodeIs(http.StatusOK))) // This simulates a ResponseHeaderTimeout. response, err = http.Get("http://127.0.0.1:8000/responseHeaderTimeout?sleep=1000") - c.Assert(err, checker.IsNil) - c.Assert(response.StatusCode, checker.Equals, http.StatusGatewayTimeout) + require.NoError(s.T(), err) + assert.Equal(s.T(), http.StatusGatewayTimeout, response.StatusCode) } diff --git a/integration/tls_client_headers_test.go b/integration/tls_client_headers_test.go index 08f0c7ea5..71d27ab71 100644 --- a/integration/tls_client_headers_test.go +++ b/integration/tls_client_headers_test.go @@ -4,11 +4,13 @@ import ( "crypto/tls" "net/http" "os" + "testing" "time" - "github.com/go-check/check" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) const ( @@ -19,20 +21,30 @@ const ( type TLSClientHeadersSuite struct{ BaseSuite } -func (s *TLSClientHeadersSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "tlsclientheaders") - s.composeUp(c) +func TestTLSClientHeadersSuite(t *testing.T) { + suite.Run(t, new(TLSClientHeadersSuite)) } -func (s *TLSClientHeadersSuite) TestTLSClientHeaders(c *check.C) { - rootCertContent, err := os.ReadFile(rootCertPath) - c.Assert(err, check.IsNil) - serverCertContent, err := os.ReadFile(certPemPath) - c.Assert(err, check.IsNil) - ServerKeyContent, err := os.ReadFile(certKeyPath) - c.Assert(err, check.IsNil) +func (s *TLSClientHeadersSuite) SetupSuite() { + s.BaseSuite.SetupSuite() - file := s.adaptFile(c, "fixtures/tlsclientheaders/simple.toml", struct { + s.createComposeProject("tlsclientheaders") + s.composeUp() +} + +func (s *TLSClientHeadersSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} + +func (s *TLSClientHeadersSuite) TestTLSClientHeaders() { + rootCertContent, err := os.ReadFile(rootCertPath) + assert.NoError(s.T(), err) + serverCertContent, err := os.ReadFile(certPemPath) + assert.NoError(s.T(), err) + ServerKeyContent, err := os.ReadFile(certKeyPath) + assert.NoError(s.T(), err) + + file := s.adaptFile("fixtures/tlsclientheaders/simple.toml", struct { RootCertContent string ServerCertContent string ServerKeyContent string @@ -41,22 +53,17 @@ func (s *TLSClientHeadersSuite) TestTLSClientHeaders(c *check.C) { ServerCertContent: string(serverCertContent), ServerKeyContent: string(ServerKeyContent), }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err = cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, try.BodyContains("PathPrefix(`/foo`)")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) request, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:8443/foo", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) certificate, err := tls.LoadX509KeyPair(certPemPath, certKeyPath) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) tr := &http.Transport{ TLSClientConfig: &tls.Config{ @@ -66,5 +73,5 @@ func (s *TLSClientHeadersSuite) TestTLSClientHeaders(c *check.C) { } err = try.RequestWithTransport(request, 2*time.Second, tr, try.BodyContains("Forwarded-Tls-Client-Cert: MIIDNTCCAh0CFD0QQcHXUJuKwMBYDA+bBExVSP26MA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZGcmFuY2UxFTATBgNVBAoMDFRyYWVmaWsgTGFiczEQMA4GA1UECwwHdHJhZWZpazENMAsGA1UEAwwEcm9vdDAeFw0yMTAxMDgxNzQ0MjRaFw0zMTAxMDYxNzQ0MjRaMFgxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZGcmFuY2UxFTATBgNVBAoMDFRyYWVmaWsgTGFiczEQMA4GA1UECwwHdHJhZWZpazEPMA0GA1UEAwwGc2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvYK2z8gLPOfFLgXNWP2460aeJ9vrH47x/lhKLlv4amSDHDx8Cmz/6blOUM8XOfMRW1xx++AgChWN9dx/kf7G2xlA5grZxRvUQ6xj7AvFG9TQUA3muNh2hvm9c3IjaZBNKH27bRKuDIBvZBvXdX4NL/aaFy7w7v7IKxk8j4WkfB23sgyH43g4b7NqKHJugZiedFu5GALmtLbShVOFbjWcre7Wvatdw8dIBmiFJqZQT3UjIuGAgqczIShtLxo4V+XyVkIPmzfPrRV+4zoMFIFOIaj3syyxb4krPBtxhe7nz2cWvvq0wePB2y4YbAAoVY8NYpd5JsMFwZtG6Uk59ygv4QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQDaPg69wNeFNFisfBJTrscqVCTW+B80gMhpLdxXD+KO0/Wgc5xpB/wLSirNtRQyxAa3+EEcIwJv/wdh8EyjlDLSpFm/8ghntrKhkOfIOPDFE41M5HNfx/Fuh5btKEenOL/XdapqtNUt2ZE4RrsfbL79sPYepa9kDUVi2mCbeH5ollZ0MDU68HpB2YwHbCEuQNk5W3pjYK2NaDkVnxTkfEDM1k+3QydO1lqB5JJmcrs59BEveTqaJ3eeh/0I4OOab6OkTTZ0JNjJp1573oxO+fce/bfGud8xHY5gSN9huU7U6RsgvO7Dhmal/sDNl8XC8oU90hVDVXZdA7ewh4jjaoIv")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } diff --git a/integration/tracing_test.go b/integration/tracing_test.go index 328b63d17..c94f3c58b 100644 --- a/integration/tracing_test.go +++ b/integration/tracing_test.go @@ -7,12 +7,14 @@ import ( "net/url" "os" "strings" + "testing" "time" - "github.com/go-check/check" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/tidwall/gjson" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type TracingSuite struct { @@ -23,6 +25,10 @@ type TracingSuite struct { otelCollectorIP string } +func TestTracingSuite(t *testing.T) { + suite.Run(t, new(TracingSuite)) +} + type TracingTemplate struct { WhoamiIP string WhoamiPort int @@ -31,59 +37,60 @@ type TracingTemplate struct { IsHTTP bool } -func (s *TracingSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "tracing") - s.composeUp(c) -} +func (s *TracingSuite) SetupSuite() { + s.BaseSuite.SetupSuite() -func (s *TracingSuite) SetUpTest(c *check.C) { - s.composeUp(c, "tempo", "otel-collector", "whoami") + s.createComposeProject("tracing") + s.composeUp() - s.whoamiIP = s.getComposeServiceIP(c, "whoami") + s.whoamiIP = s.getComposeServiceIP("whoami") s.whoamiPort = 80 // Wait for whoami to turn ready. err := try.GetRequest("http://"+s.whoamiIP+":80", 30*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - s.tempoIP = s.getComposeServiceIP(c, "tempo") - - // Wait for tempo to turn ready. - err = try.GetRequest("http://"+s.tempoIP+":3200/ready", 30*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) - - s.otelCollectorIP = s.getComposeServiceIP(c, "otel-collector") + s.otelCollectorIP = s.getComposeServiceIP("otel-collector") // Wait for otel collector to turn ready. err = try.GetRequest("http://"+s.otelCollectorIP+":13133/", 30*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *TracingSuite) TearDownTest(c *check.C) { - s.composeStop(c, "tempo") +func (s *TracingSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() } -func (s *TracingSuite) TestOpentelemetryBasic_HTTP(c *check.C) { - file := s.adaptFile(c, "fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ +func (s *TracingSuite) SetupTest() { + s.composeUp("tempo") + + s.tempoIP = s.getComposeServiceIP("tempo") + + // Wait for tempo to turn ready. + err := try.GetRequest("http://"+s.tempoIP+":3200/ready", 30*time.Second, try.StatusCodeIs(http.StatusOK)) + require.NoError(s.T(), err) +} + +func (s *TracingSuite) TearDownTest() { + s.composeStop("tempo") +} + +func (s *TracingSuite) TestOpentelemetryBasic_HTTP() { + file := s.adaptFile("fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ WhoamiIP: s.whoamiIP, WhoamiPort: s.whoamiPort, IP: s.otelCollectorIP, IsHTTP: true, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/basic", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) contains := []map[string]string{ { @@ -113,11 +120,11 @@ func (s *TracingSuite) TestOpentelemetryBasic_HTTP(c *check.C) { }, } - checkTraceContent(c, s.tempoIP, contains) + s.checkTraceContent(contains) } -func (s *TracingSuite) TestOpentelemetryBasic_gRPC(c *check.C) { - file := s.adaptFile(c, "fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ +func (s *TracingSuite) TestOpentelemetryBasic_gRPC() { + file := s.adaptFile("fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ WhoamiIP: s.whoamiIP, WhoamiPort: s.whoamiPort, IP: s.otelCollectorIP, @@ -125,18 +132,14 @@ func (s *TracingSuite) TestOpentelemetryBasic_gRPC(c *check.C) { }) defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/basic", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) contains := []map[string]string{ { @@ -166,51 +169,47 @@ func (s *TracingSuite) TestOpentelemetryBasic_gRPC(c *check.C) { }, } - checkTraceContent(c, s.tempoIP, contains) + s.checkTraceContent(contains) } -func (s *TracingSuite) TestOpentelemetryRateLimit(c *check.C) { - file := s.adaptFile(c, "fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ +func (s *TracingSuite) TestOpentelemetryRateLimit() { + file := s.adaptFile("fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ WhoamiIP: s.whoamiIP, WhoamiPort: s.whoamiPort, IP: s.otelCollectorIP, }) defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusTooManyRequests)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // sleep for 4 seconds to be certain the configured time period has elapsed // then test another request and verify a 200 status code time.Sleep(4 * time.Second) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) // continue requests at 3 second intervals to test the other rate limit time period time.Sleep(3 * time.Second) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) time.Sleep(3 * time.Second) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusTooManyRequests)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) contains := []map[string]string{ { @@ -289,29 +288,25 @@ func (s *TracingSuite) TestOpentelemetryRateLimit(c *check.C) { }, } - checkTraceContent(c, s.tempoIP, contains) + s.checkTraceContent(contains) } -func (s *TracingSuite) TestOpentelemetryRetry(c *check.C) { - file := s.adaptFile(c, "fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ +func (s *TracingSuite) TestOpentelemetryRetry() { + file := s.adaptFile("fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ WhoamiIP: s.whoamiIP, WhoamiPort: 81, IP: s.otelCollectorIP, }) defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/retry", 500*time.Millisecond, try.StatusCodeIs(http.StatusBadGateway)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) contains := []map[string]string{ { @@ -374,29 +369,25 @@ func (s *TracingSuite) TestOpentelemetryRetry(c *check.C) { }, } - checkTraceContent(c, s.tempoIP, contains) + s.checkTraceContent(contains) } -func (s *TracingSuite) TestOpentelemetryAuth(c *check.C) { - file := s.adaptFile(c, "fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ +func (s *TracingSuite) TestOpentelemetryAuth() { + file := s.adaptFile("fixtures/tracing/simple-opentelemetry.toml", TracingTemplate{ WhoamiIP: s.whoamiIP, WhoamiPort: s.whoamiPort, IP: s.otelCollectorIP, }) defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8000/auth", 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) contains := []map[string]string{ { @@ -420,12 +411,14 @@ func (s *TracingSuite) TestOpentelemetryAuth(c *check.C) { }, } - checkTraceContent(c, s.tempoIP, contains) + s.checkTraceContent(contains) } -func checkTraceContent(c *check.C, tempoIP string, expectedJSON []map[string]string) { - baseURL, err := url.Parse("http://" + tempoIP + ":3200/api/search") - c.Assert(err, checker.IsNil) +func (s *TracingSuite) checkTraceContent(expectedJSON []map[string]string) { + s.T().Helper() + + baseURL, err := url.Parse("http://" + s.tempoIP + ":3200/api/search") + require.NoError(s.T(), err) req := &http.Request{ Method: http.MethodGet, @@ -434,22 +427,20 @@ func checkTraceContent(c *check.C, tempoIP string, expectedJSON []map[string]str // Wait for traces to be available. time.Sleep(10 * time.Second) resp, err := try.Response(req, 5*time.Second) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) out := &TraceResponse{} content, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = json.Unmarshal(content, &out) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) - if len(out.Traces) == 0 { - c.Fatalf("expected at least one trace, got %d (%s)", len(out.Traces), string(content)) - } + s.NotEmptyf(len(out.Traces), "expected at least one trace") var contents []string for _, t := range out.Traces { - baseURL, err := url.Parse("http://" + tempoIP + ":3200/api/traces/" + t.TraceID) - c.Assert(err, checker.IsNil) + baseURL, err := url.Parse("http://" + s.tempoIP + ":3200/api/traces/" + t.TraceID) + require.NoError(s.T(), err) req := &http.Request{ Method: http.MethodGet, @@ -457,20 +448,20 @@ func checkTraceContent(c *check.C, tempoIP string, expectedJSON []map[string]str } resp, err := try.Response(req, 5*time.Second) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) content, err := io.ReadAll(resp.Body) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) contents = append(contents, string(content)) } for _, expected := range expectedJSON { - containsAll(c, expected, contents) + containsAll(expected, contents) } } -func containsAll(c *check.C, expectedJSON map[string]string, contents []string) { +func containsAll(expectedJSON map[string]string, contents []string) { for k, v := range expectedJSON { found := false for _, content := range contents { @@ -481,8 +472,8 @@ func containsAll(c *check.C, expectedJSON map[string]string, contents []string) } if !found { - c.Log("[" + strings.Join(contents, ",") + "]") - c.Errorf("missing element: \nKey: %q\nValue: %q ", k, v) + log.Info().Msgf("[" + strings.Join(contents, ",") + "]") + log.Error().Msgf("missing element: \nKey: %q\nValue: %q ", k, v) } } } diff --git a/integration/udp_test.go b/integration/udp_test.go index 3493af17e..30753a7f5 100644 --- a/integration/udp_test.go +++ b/integration/udp_test.go @@ -3,20 +3,32 @@ package integration import ( "net" "net/http" - "os" "strings" + "testing" "time" - "github.com/go-check/check" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" ) type UDPSuite struct{ BaseSuite } -func (s *UDPSuite) SetUpSuite(c *check.C) { - s.createComposeProject(c, "udp") - s.composeUp(c) +func TestUDPSuite(t *testing.T) { + suite.Run(t, new(UDPSuite)) +} + +func (s *UDPSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("udp") + s.composeUp() +} + +func (s *UDPSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() } func guessWhoUDP(addr string) (string, error) { @@ -46,39 +58,33 @@ func guessWhoUDP(addr string) (string, error) { return string(out[:n]), nil } -func (s *UDPSuite) TestWRR(c *check.C) { - file := s.adaptFile(c, "fixtures/udp/wrr.toml", struct { +func (s *UDPSuite) TestWRR() { + file := s.adaptFile("fixtures/udp/wrr.toml", struct { WhoamiAIP string WhoamiBIP string WhoamiCIP string WhoamiDIP string }{ - WhoamiAIP: s.getComposeServiceIP(c, "whoami-a"), - WhoamiBIP: s.getComposeServiceIP(c, "whoami-b"), - WhoamiCIP: s.getComposeServiceIP(c, "whoami-c"), - WhoamiDIP: s.getComposeServiceIP(c, "whoami-d"), + WhoamiAIP: s.getComposeServiceIP("whoami-a"), + WhoamiBIP: s.getComposeServiceIP("whoami-b"), + WhoamiCIP: s.getComposeServiceIP("whoami-c"), + WhoamiDIP: s.getComposeServiceIP("whoami-d"), }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) + s.traefikCmd(withConfigFile(file)) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) - - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("whoami-a")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.StatusCodeIs(http.StatusOK), try.BodyContains("whoami-a")) + require.NoError(s.T(), err) err = try.GetRequest("http://127.0.0.1:8093/who", 5*time.Second, try.StatusCodeIs(http.StatusOK)) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) stop := make(chan struct{}) go func() { call := map[string]int{} for i := 0; i < 8; i++ { out, err := guessWhoUDP("127.0.0.1:8093") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) switch { case strings.Contains(out, "whoami-a"): call["whoami-a"]++ @@ -90,13 +96,13 @@ func (s *UDPSuite) TestWRR(c *check.C) { call["unknown"]++ } } - c.Assert(call, checker.DeepEquals, map[string]int{"whoami-a": 3, "whoami-b": 2, "whoami-c": 3}) + assert.EqualValues(s.T(), call, map[string]int{"whoami-a": 3, "whoami-b": 2, "whoami-c": 3}) close(stop) }() select { case <-stop: case <-time.Tick(5 * time.Second): - c.Error("Timeout") + log.Info().Msg("Timeout") } } diff --git a/integration/websocket_test.go b/integration/websocket_test.go index c343c1b78..508bb9573 100644 --- a/integration/websocket_test.go +++ b/integration/websocket_test.go @@ -8,19 +8,25 @@ import ( "net/http" "net/http/httptest" "os" + "testing" "time" - "github.com/go-check/check" gorillawebsocket "github.com/gorilla/websocket" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" - checker "github.com/vdemeester/shakers" "golang.org/x/net/websocket" ) // WebsocketSuite tests suite. type WebsocketSuite struct{ BaseSuite } -func (s *WebsocketSuite) TestBase(c *check.C) { +func TestWebsocketSuite(t *testing.T) { + suite.Run(t, new(WebsocketSuite)) +} + +func (s *WebsocketSuite) TestBase() { upgrader := gorillawebsocket.Upgrader{} // use default options srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -41,36 +47,30 @@ func (s *WebsocketSuite) TestBase(c *check.C) { } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) conn, _, err := gorillawebsocket.DefaultDialer.Dial("ws://127.0.0.1:8000/ws", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = conn.WriteMessage(gorillawebsocket.TextMessage, []byte("OK")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, msg, err := conn.ReadMessage() - c.Assert(err, checker.IsNil) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestWrongOrigin(c *check.C) { +func (s *WebsocketSuite) TestWrongOrigin() { upgrader := gorillawebsocket.Upgrader{} // use default options srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -91,35 +91,28 @@ func (s *WebsocketSuite) TestWrongOrigin(c *check.C) { } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) config, err := websocket.NewConfig("ws://127.0.0.1:8000/ws", "ws://127.0.0.1:800") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) conn, err := net.DialTimeout("tcp", "127.0.0.1:8000", time.Second) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, err = websocket.NewClient(config, conn) - c.Assert(err, checker.NotNil) - c.Assert(err, checker.ErrorMatches, "bad status") + assert.ErrorContains(s.T(), err, "bad status") } -func (s *WebsocketSuite) TestOrigin(c *check.C) { +func (s *WebsocketSuite) TestOrigin() { // use default options upgrader := gorillawebsocket.Upgrader{} @@ -141,44 +134,38 @@ func (s *WebsocketSuite) TestOrigin(c *check.C) { } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) config, err := websocket.NewConfig("ws://127.0.0.1:8000/ws", "ws://127.0.0.1:8000") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) conn, err := net.DialTimeout("tcp", "127.0.0.1:8000", time.Second) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) client, err := websocket.NewClient(config, conn) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) n, err := client.Write([]byte("OK")) - c.Assert(err, checker.IsNil) - c.Assert(n, checker.Equals, 2) + require.NoError(s.T(), err) + assert.Equal(s.T(), 2, n) msg := make([]byte, 2) n, err = client.Read(msg) - c.Assert(err, checker.IsNil) - c.Assert(n, checker.Equals, 2) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), 2, n) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestWrongOriginIgnoredByServer(c *check.C) { +func (s *WebsocketSuite) TestWrongOriginIgnoredByServer() { upgrader := gorillawebsocket.Upgrader{CheckOrigin: func(r *http.Request) bool { return true }} @@ -201,44 +188,38 @@ func (s *WebsocketSuite) TestWrongOriginIgnoredByServer(c *check.C) { } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) config, err := websocket.NewConfig("ws://127.0.0.1:8000/ws", "ws://127.0.0.1:80") - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) conn, err := net.DialTimeout("tcp", "127.0.0.1:8000", time.Second) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) client, err := websocket.NewClient(config, conn) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) n, err := client.Write([]byte("OK")) - c.Assert(err, checker.IsNil) - c.Assert(n, checker.Equals, 2) + require.NoError(s.T(), err) + assert.Equal(s.T(), 2, n) msg := make([]byte, 2) n, err = client.Read(msg) - c.Assert(err, checker.IsNil) - c.Assert(n, checker.Equals, 2) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), 2, n) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestSSLTermination(c *check.C) { +func (s *WebsocketSuite) TestSSLTermination() { upgrader := gorillawebsocket.Upgrader{} // use default options srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -258,44 +239,38 @@ func (s *WebsocketSuite) TestSSLTermination(c *check.C) { } } })) - file := s.adaptFile(c, "fixtures/websocket/config_https.toml", struct { + file := s.adaptFile("fixtures/websocket/config_https.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) // Add client self-signed cert roots := x509.NewCertPool() certContent, err := os.ReadFile("./resources/tls/local.cert") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) roots.AppendCertsFromPEM(certContent) gorillawebsocket.DefaultDialer.TLSClientConfig = &tls.Config{ RootCAs: roots, } conn, _, err := gorillawebsocket.DefaultDialer.Dial("wss://127.0.0.1:8000/ws", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = conn.WriteMessage(gorillawebsocket.TextMessage, []byte("OK")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, msg, err := conn.ReadMessage() - c.Assert(err, checker.IsNil) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestBasicAuth(c *check.C) { +func (s *WebsocketSuite) TestBasicAuth() { upgrader := gorillawebsocket.Upgrader{} // use default options srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -306,8 +281,8 @@ func (s *WebsocketSuite) TestBasicAuth(c *check.C) { defer conn.Close() user, password, _ := r.BasicAuth() - c.Assert(user, check.Equals, "traefiker") - c.Assert(password, check.Equals, "secret") + assert.Equal(s.T(), "traefiker", user) + assert.Equal(s.T(), "secret", password) for { mt, message, err := conn.ReadMessage() @@ -320,78 +295,66 @@ func (s *WebsocketSuite) TestBasicAuth(c *check.C) { } } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) config, err := websocket.NewConfig("ws://127.0.0.1:8000/ws", "ws://127.0.0.1:8000") auth := "traefiker:secret" config.Header.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(auth))) - c.Assert(err, check.IsNil) + assert.NoError(s.T(), err) conn, err := net.DialTimeout("tcp", "127.0.0.1:8000", time.Second) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) client, err := websocket.NewClient(config, conn) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) n, err := client.Write([]byte("OK")) - c.Assert(err, checker.IsNil) - c.Assert(n, checker.Equals, 2) + require.NoError(s.T(), err) + assert.Equal(s.T(), 2, n) msg := make([]byte, 2) n, err = client.Read(msg) - c.Assert(err, checker.IsNil) - c.Assert(n, checker.Equals, 2) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), 2, n) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestSpecificResponseFromBackend(c *check.C) { +func (s *WebsocketSuite) TestSpecificResponseFromBackend() { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusUnauthorized) })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) _, resp, err := gorillawebsocket.DefaultDialer.Dial("ws://127.0.0.1:8000/ws", nil) - c.Assert(err, checker.NotNil) - c.Assert(resp.StatusCode, check.Equals, http.StatusUnauthorized) + assert.Error(s.T(), err) + assert.Equal(s.T(), http.StatusUnauthorized, resp.StatusCode) } -func (s *WebsocketSuite) TestURLWithURLEncodedChar(c *check.C) { +func (s *WebsocketSuite) TestURLWithURLEncodedChar() { upgrader := gorillawebsocket.Upgrader{} // use default options srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - c.Assert(r.URL.EscapedPath(), check.Equals, "/ws/http%3A%2F%2Ftest") + assert.Equal(s.T(), "/ws/http%3A%2F%2Ftest", r.URL.EscapedPath()) conn, err := upgrader.Upgrade(w, r, nil) if err != nil { return @@ -409,36 +372,30 @@ func (s *WebsocketSuite) TestURLWithURLEncodedChar(c *check.C) { } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) conn, _, err := gorillawebsocket.DefaultDialer.Dial("ws://127.0.0.1:8000/ws/http%3A%2F%2Ftest", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = conn.WriteMessage(gorillawebsocket.TextMessage, []byte("OK")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, msg, err := conn.ReadMessage() - c.Assert(err, checker.IsNil) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestSSLhttp2(c *check.C) { +func (s *WebsocketSuite) TestSSLhttp2() { upgrader := gorillawebsocket.Upgrader{} // use default options ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -463,48 +420,42 @@ func (s *WebsocketSuite) TestSSLhttp2(c *check.C) { ts.TLS.NextProtos = append(ts.TLS.NextProtos, `h2`, `http/1.1`) ts.StartTLS() - file := s.adaptFile(c, "fixtures/websocket/config_https.toml", struct { + file := s.adaptFile("fixtures/websocket/config_https.toml", struct { WebsocketServer string }{ WebsocketServer: ts.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG", "--accesslog") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG", "--accesslog") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) // Add client self-signed cert roots := x509.NewCertPool() certContent, err := os.ReadFile("./resources/tls/local.cert") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) roots.AppendCertsFromPEM(certContent) gorillawebsocket.DefaultDialer.TLSClientConfig = &tls.Config{ RootCAs: roots, } conn, _, err := gorillawebsocket.DefaultDialer.Dial("wss://127.0.0.1:8000/echo", nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = conn.WriteMessage(gorillawebsocket.TextMessage, []byte("OK")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, msg, err := conn.ReadMessage() - c.Assert(err, checker.IsNil) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), "OK", string(msg)) } -func (s *WebsocketSuite) TestHeaderAreForwarded(c *check.C) { +func (s *WebsocketSuite) TestHeaderAreForwarded() { upgrader := gorillawebsocket.Upgrader{} // use default options srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - c.Assert(r.Header.Get("X-Token"), check.Equals, "my-token") + assert.Equal(s.T(), "my-token", r.Header.Get("X-Token")) c, err := upgrader.Upgrade(w, r, nil) if err != nil { return @@ -522,33 +473,27 @@ func (s *WebsocketSuite) TestHeaderAreForwarded(c *check.C) { } })) - file := s.adaptFile(c, "fixtures/websocket/config.toml", struct { + file := s.adaptFile("fixtures/websocket/config.toml", struct { WebsocketServer string }{ WebsocketServer: srv.URL, }) - defer os.Remove(file) - cmd, display := s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") - defer display(c) - - err := cmd.Start() - c.Assert(err, check.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file), "--log.level=DEBUG") // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) - c.Assert(err, checker.IsNil) + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 10*time.Second, try.BodyContains("127.0.0.1")) + require.NoError(s.T(), err) headers := http.Header{} headers.Add("X-Token", "my-token") conn, _, err := gorillawebsocket.DefaultDialer.Dial("ws://127.0.0.1:8000/ws", headers) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) err = conn.WriteMessage(gorillawebsocket.TextMessage, []byte("OK")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) _, msg, err := conn.ReadMessage() - c.Assert(err, checker.IsNil) - c.Assert(string(msg), checker.Equals, "OK") + require.NoError(s.T(), err) + assert.Equal(s.T(), "OK", string(msg)) } diff --git a/integration/zk_test.go b/integration/zk_test.go index 1e5820cc5..f971ca79c 100644 --- a/integration/zk_test.go +++ b/integration/zk_test.go @@ -8,16 +8,18 @@ import ( "net/http" "os" "path/filepath" + "testing" "time" - "github.com/go-check/check" "github.com/kvtools/valkeyrie" "github.com/kvtools/valkeyrie/store" "github.com/kvtools/zookeeper" "github.com/pmezard/go-difflib/difflib" + "github.com/rs/zerolog/log" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/traefik/traefik/v3/integration/try" "github.com/traefik/traefik/v3/pkg/api" - checker "github.com/vdemeester/shakers" ) // Zk test suites. @@ -27,11 +29,17 @@ type ZookeeperSuite struct { zookeeperAddr string } -func (s *ZookeeperSuite) setupStore(c *check.C) { - s.createComposeProject(c, "zookeeper") - s.composeUp(c) +func TestZookeeperSuite(t *testing.T) { + suite.Run(t, new(ZookeeperSuite)) +} - s.zookeeperAddr = net.JoinHostPort(s.getComposeServiceIP(c, "zookeeper"), "2181") +func (s *ZookeeperSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + + s.createComposeProject("zookeeper") + s.composeUp() + + s.zookeeperAddr = net.JoinHostPort(s.getComposeServiceIP("zookeeper"), "2181") var err error s.kvClient, err = valkeyrie.NewStore( @@ -42,20 +50,19 @@ func (s *ZookeeperSuite) setupStore(c *check.C) { ConnectionTimeout: 10 * time.Second, }, ) - if err != nil { - c.Fatal("Cannot create store zookeeper") - } + require.NoError(s.T(), err, "Cannot create store zookeeper") // wait for zk err = try.Do(60*time.Second, try.KVExists(s.kvClient, "test")) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } -func (s *ZookeeperSuite) TestSimpleConfiguration(c *check.C) { - s.setupStore(c) +func (s *ZookeeperSuite) TearDownSuite() { + s.BaseSuite.TearDownSuite() +} - file := s.adaptFile(c, "fixtures/zookeeper/simple.toml", struct{ ZkAddress string }{s.zookeeperAddr}) - defer os.Remove(file) +func (s *ZookeeperSuite) TestSimpleConfiguration() { + file := s.adaptFile("fixtures/zookeeper/simple.toml", struct{ ZkAddress string }{s.zookeeperAddr}) data := map[string]string{ "traefik/http/routers/Router0/entryPoints/0": "web", @@ -104,39 +111,35 @@ func (s *ZookeeperSuite) TestSimpleConfiguration(c *check.C) { for k, v := range data { err := s.kvClient.Put(context.Background(), k, []byte(v), nil) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } - cmd, display := s.traefikCmd(withConfigFile(file)) - defer display(c) - err := cmd.Start() - c.Assert(err, checker.IsNil) - defer s.killCmd(cmd) + s.traefikCmd(withConfigFile(file)) // wait for traefik - err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", 2*time.Second, + err := try.GetRequest("http://127.0.0.1:8080/api/rawdata", 5*time.Second, try.BodyContains(`"striper@zookeeper":`, `"compressor@zookeeper":`, `"srvcA@zookeeper":`, `"srvcB@zookeeper":`), ) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) resp, err := http.Get("http://127.0.0.1:8080/api/rawdata") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) var obtained api.RunTimeRepresentation err = json.NewDecoder(resp.Body).Decode(&obtained) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) got, err := json.MarshalIndent(obtained, "", " ") - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) expectedJSON := filepath.FromSlash("testdata/rawdata-zk.json") if *updateExpected { err = os.WriteFile(expectedJSON, got, 0o666) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) } expected, err := os.ReadFile(expectedJSON) - c.Assert(err, checker.IsNil) + require.NoError(s.T(), err) if !bytes.Equal(expected, got) { diff := difflib.UnifiedDiff{ @@ -148,7 +151,7 @@ func (s *ZookeeperSuite) TestSimpleConfiguration(c *check.C) { } text, err := difflib.GetUnifiedDiffString(diff) - c.Assert(err, checker.IsNil) - c.Error(text) + require.NoError(s.T(), err) + log.Info().Msg(text) } } diff --git a/pkg/config/dynamic/http_config.go b/pkg/config/dynamic/http_config.go index 162ebc3d4..0c31c8871 100644 --- a/pkg/config/dynamic/http_config.go +++ b/pkg/config/dynamic/http_config.go @@ -265,15 +265,15 @@ type HealthCheck struct{} // ServersTransport options to configure communication between Traefik and the servers. type ServersTransport struct { - ServerName string `description:"Defines the serverName used to contact the server." json:"serverName,omitempty" toml:"serverName,omitempty" yaml:"serverName,omitempty"` - InsecureSkipVerify bool `description:"Disables SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` - RootCAs []traefiktls.FileOrContent `description:"Defines a list of CA secret used to validate self-signed certificate" json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` - Certificates traefiktls.Certificates `description:"Defines a list of secret storing client certificates for mTLS." json:"certificates,omitempty" toml:"certificates,omitempty" yaml:"certificates,omitempty" export:"true"` - MaxIdleConnsPerHost int `description:"If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used" json:"maxIdleConnsPerHost,omitempty" toml:"maxIdleConnsPerHost,omitempty" yaml:"maxIdleConnsPerHost,omitempty" export:"true"` - ForwardingTimeouts *ForwardingTimeouts `description:"Defines the timeouts for requests forwarded to the backend servers." json:"forwardingTimeouts,omitempty" toml:"forwardingTimeouts,omitempty" yaml:"forwardingTimeouts,omitempty" export:"true"` - DisableHTTP2 bool `description:"Disables HTTP/2 for connections with backend servers." json:"disableHTTP2,omitempty" toml:"disableHTTP2,omitempty" yaml:"disableHTTP2,omitempty" export:"true"` - PeerCertURI string `description:"Defines the URI used to match against SAN URI during the peer certificate verification." json:"peerCertURI,omitempty" toml:"peerCertURI,omitempty" yaml:"peerCertURI,omitempty" export:"true"` - Spiffe *Spiffe `description:"Defines the SPIFFE configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + ServerName string `description:"Defines the serverName used to contact the server." json:"serverName,omitempty" toml:"serverName,omitempty" yaml:"serverName,omitempty"` + InsecureSkipVerify bool `description:"Disables SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` + RootCAs []types.FileOrContent `description:"Defines a list of CA secret used to validate self-signed certificate" json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` + Certificates traefiktls.Certificates `description:"Defines a list of secret storing client certificates for mTLS." json:"certificates,omitempty" toml:"certificates,omitempty" yaml:"certificates,omitempty" export:"true"` + MaxIdleConnsPerHost int `description:"If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used" json:"maxIdleConnsPerHost,omitempty" toml:"maxIdleConnsPerHost,omitempty" yaml:"maxIdleConnsPerHost,omitempty" export:"true"` + ForwardingTimeouts *ForwardingTimeouts `description:"Defines the timeouts for requests forwarded to the backend servers." json:"forwardingTimeouts,omitempty" toml:"forwardingTimeouts,omitempty" yaml:"forwardingTimeouts,omitempty" export:"true"` + DisableHTTP2 bool `description:"Disables HTTP/2 for connections with backend servers." json:"disableHTTP2,omitempty" toml:"disableHTTP2,omitempty" yaml:"disableHTTP2,omitempty" export:"true"` + PeerCertURI string `description:"Defines the URI used to match against SAN URI during the peer certificate verification." json:"peerCertURI,omitempty" toml:"peerCertURI,omitempty" yaml:"peerCertURI,omitempty" export:"true"` + Spiffe *Spiffe `description:"Defines the SPIFFE configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` } // +k8s:deepcopy-gen=true diff --git a/pkg/config/dynamic/middlewares.go b/pkg/config/dynamic/middlewares.go index a73881a2a..dcb884337 100644 --- a/pkg/config/dynamic/middlewares.go +++ b/pkg/config/dynamic/middlewares.go @@ -12,12 +12,14 @@ import ( // Middleware holds the Middleware configuration. type Middleware struct { - AddPrefix *AddPrefix `json:"addPrefix,omitempty" toml:"addPrefix,omitempty" yaml:"addPrefix,omitempty" export:"true"` - StripPrefix *StripPrefix `json:"stripPrefix,omitempty" toml:"stripPrefix,omitempty" yaml:"stripPrefix,omitempty" export:"true"` - StripPrefixRegex *StripPrefixRegex `json:"stripPrefixRegex,omitempty" toml:"stripPrefixRegex,omitempty" yaml:"stripPrefixRegex,omitempty" export:"true"` - ReplacePath *ReplacePath `json:"replacePath,omitempty" toml:"replacePath,omitempty" yaml:"replacePath,omitempty" export:"true"` - ReplacePathRegex *ReplacePathRegex `json:"replacePathRegex,omitempty" toml:"replacePathRegex,omitempty" yaml:"replacePathRegex,omitempty" export:"true"` - Chain *Chain `json:"chain,omitempty" toml:"chain,omitempty" yaml:"chain,omitempty" export:"true"` + AddPrefix *AddPrefix `json:"addPrefix,omitempty" toml:"addPrefix,omitempty" yaml:"addPrefix,omitempty" export:"true"` + StripPrefix *StripPrefix `json:"stripPrefix,omitempty" toml:"stripPrefix,omitempty" yaml:"stripPrefix,omitempty" export:"true"` + StripPrefixRegex *StripPrefixRegex `json:"stripPrefixRegex,omitempty" toml:"stripPrefixRegex,omitempty" yaml:"stripPrefixRegex,omitempty" export:"true"` + ReplacePath *ReplacePath `json:"replacePath,omitempty" toml:"replacePath,omitempty" yaml:"replacePath,omitempty" export:"true"` + ReplacePathRegex *ReplacePathRegex `json:"replacePathRegex,omitempty" toml:"replacePathRegex,omitempty" yaml:"replacePathRegex,omitempty" export:"true"` + Chain *Chain `json:"chain,omitempty" toml:"chain,omitempty" yaml:"chain,omitempty" export:"true"` + // Deprecated: please use IPAllowList instead. + IPWhiteList *IPWhiteList `json:"ipWhiteList,omitempty" toml:"ipWhiteList,omitempty" yaml:"ipWhiteList,omitempty" export:"true"` IPAllowList *IPAllowList `json:"ipAllowList,omitempty" toml:"ipAllowList,omitempty" yaml:"ipAllowList,omitempty" export:"true"` Headers *Headers `json:"headers,omitempty" toml:"headers,omitempty" yaml:"headers,omitempty" export:"true"` Errors *ErrorPage `json:"errors,omitempty" toml:"errors,omitempty" yaml:"errors,omitempty" export:"true"` @@ -376,6 +378,18 @@ func (s *IPStrategy) Get() (ip.Strategy, error) { // +k8s:deepcopy-gen=true +// IPWhiteList holds the IP whitelist middleware configuration. +// This middleware accepts / refuses requests based on the client IP. +// More info: https://doc.traefik.io/traefik/v3.0/middlewares/http/ipwhitelist/ +// Deprecated: please use IPAllowList instead. +type IPWhiteList struct { + // SourceRange defines the set of allowed IPs (or ranges of allowed IPs by using CIDR notation). + 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" kv:"allowEmpty" export:"true"` +} + +// +k8s:deepcopy-gen=true + // IPAllowList holds the IP allowlist middleware configuration. // This middleware accepts / refuses requests based on the client IP. // More info: https://doc.traefik.io/traefik/v3.0/middlewares/http/ipallowlist/ diff --git a/pkg/config/dynamic/tcp_config.go b/pkg/config/dynamic/tcp_config.go index 7789c5169..adedd0882 100644 --- a/pkg/config/dynamic/tcp_config.go +++ b/pkg/config/dynamic/tcp_config.go @@ -138,12 +138,12 @@ type TCPServersTransport struct { // TLSClientConfig options to configure TLS communication between Traefik and the servers. type TLSClientConfig struct { - ServerName string `description:"Defines the serverName used to contact the server." json:"serverName,omitempty" toml:"serverName,omitempty" yaml:"serverName,omitempty"` - InsecureSkipVerify bool `description:"Disables SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` - RootCAs []traefiktls.FileOrContent `description:"Defines a list of CA secret used to validate self-signed certificate" json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` - Certificates traefiktls.Certificates `description:"Defines a list of secret storing client certificates for mTLS." json:"certificates,omitempty" toml:"certificates,omitempty" yaml:"certificates,omitempty" export:"true"` - PeerCertURI string `description:"Defines the URI used to match against SAN URI during the peer certificate verification." json:"peerCertURI,omitempty" toml:"peerCertURI,omitempty" yaml:"peerCertURI,omitempty" export:"true"` - Spiffe *Spiffe `description:"Defines the SPIFFE TLS configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + ServerName string `description:"Defines the serverName used to contact the server." json:"serverName,omitempty" toml:"serverName,omitempty" yaml:"serverName,omitempty"` + InsecureSkipVerify bool `description:"Disables SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` + RootCAs []types.FileOrContent `description:"Defines a list of CA secret used to validate self-signed certificate" json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` + Certificates traefiktls.Certificates `description:"Defines a list of secret storing client certificates for mTLS." json:"certificates,omitempty" toml:"certificates,omitempty" yaml:"certificates,omitempty" export:"true"` + PeerCertURI string `description:"Defines the URI used to match against SAN URI during the peer certificate verification." json:"peerCertURI,omitempty" toml:"peerCertURI,omitempty" yaml:"peerCertURI,omitempty" export:"true"` + Spiffe *Spiffe `description:"Defines the SPIFFE TLS configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` } // SetDefaults sets the default values for a TCPServersTransport. diff --git a/pkg/config/dynamic/tcp_middlewares.go b/pkg/config/dynamic/tcp_middlewares.go index 018ae65f7..4368dc334 100644 --- a/pkg/config/dynamic/tcp_middlewares.go +++ b/pkg/config/dynamic/tcp_middlewares.go @@ -5,7 +5,9 @@ package dynamic // TCPMiddleware holds the TCPMiddleware configuration. type TCPMiddleware struct { InFlightConn *TCPInFlightConn `json:"inFlightConn,omitempty" toml:"inFlightConn,omitempty" yaml:"inFlightConn,omitempty" export:"true"` - IPAllowList *TCPIPAllowList `json:"ipAllowList,omitempty" toml:"ipAllowList,omitempty" yaml:"ipAllowList,omitempty" export:"true"` + // Deprecated: please use IPAllowList instead. + IPWhiteList *TCPIPWhiteList `json:"ipWhiteList,omitempty" toml:"ipWhiteList,omitempty" yaml:"ipWhiteList,omitempty" export:"true"` + IPAllowList *TCPIPAllowList `json:"ipAllowList,omitempty" toml:"ipAllowList,omitempty" yaml:"ipAllowList,omitempty" export:"true"` } // +k8s:deepcopy-gen=true @@ -22,6 +24,15 @@ type TCPInFlightConn struct { // +k8s:deepcopy-gen=true +// TCPIPWhiteList holds the TCP IPWhiteList middleware configuration. +// Deprecated: please use IPAllowList instead. +type TCPIPWhiteList struct { + // SourceRange defines the allowed IPs (or ranges of allowed IPs by using CIDR notation). + SourceRange []string `json:"sourceRange,omitempty" toml:"sourceRange,omitempty" yaml:"sourceRange,omitempty"` +} + +// +k8s:deepcopy-gen=true + // TCPIPAllowList holds the TCP IPAllowList middleware configuration. type TCPIPAllowList struct { // SourceRange defines the allowed IPs (or ranges of allowed IPs by using CIDR notation). diff --git a/pkg/config/dynamic/zz_generated.deepcopy.go b/pkg/config/dynamic/zz_generated.deepcopy.go index dabedc2d5..62f468c11 100644 --- a/pkg/config/dynamic/zz_generated.deepcopy.go +++ b/pkg/config/dynamic/zz_generated.deepcopy.go @@ -600,6 +600,32 @@ func (in *IPStrategy) DeepCopy() *IPStrategy { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPWhiteList) DeepCopyInto(out *IPWhiteList) { + *out = *in + if in.SourceRange != nil { + in, out := &in.SourceRange, &out.SourceRange + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IPStrategy != nil { + in, out := &in.IPStrategy, &out.IPStrategy + *out = new(IPStrategy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPWhiteList. +func (in *IPWhiteList) DeepCopy() *IPWhiteList { + if in == nil { + return nil + } + out := new(IPWhiteList) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InFlightReq) DeepCopyInto(out *InFlightReq) { *out = *in @@ -675,6 +701,11 @@ func (in *Middleware) DeepCopyInto(out *Middleware) { *out = new(Chain) (*in).DeepCopyInto(*out) } + if in.IPWhiteList != nil { + in, out := &in.IPWhiteList, &out.IPWhiteList + *out = new(IPWhiteList) + (*in).DeepCopyInto(*out) + } if in.IPAllowList != nil { in, out := &in.IPAllowList, &out.IPAllowList *out = new(IPAllowList) @@ -1174,7 +1205,7 @@ func (in *ServersTransport) DeepCopyInto(out *ServersTransport) { *out = *in if in.RootCAs != nil { in, out := &in.RootCAs, &out.RootCAs - *out = make([]tls.FileOrContent, len(*in)) + *out = make([]types.FileOrContent, len(*in)) copy(*out, *in) } if in.Certificates != nil { @@ -1445,6 +1476,27 @@ func (in *TCPIPAllowList) DeepCopy() *TCPIPAllowList { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TCPIPWhiteList) DeepCopyInto(out *TCPIPWhiteList) { + *out = *in + if in.SourceRange != nil { + in, out := &in.SourceRange, &out.SourceRange + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPIPWhiteList. +func (in *TCPIPWhiteList) DeepCopy() *TCPIPWhiteList { + if in == nil { + return nil + } + out := new(TCPIPWhiteList) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TCPInFlightConn) DeepCopyInto(out *TCPInFlightConn) { *out = *in @@ -1469,6 +1521,11 @@ func (in *TCPMiddleware) DeepCopyInto(out *TCPMiddleware) { *out = new(TCPInFlightConn) **out = **in } + if in.IPWhiteList != nil { + in, out := &in.IPWhiteList, &out.IPWhiteList + *out = new(TCPIPWhiteList) + (*in).DeepCopyInto(*out) + } if in.IPAllowList != nil { in, out := &in.IPAllowList, &out.IPAllowList *out = new(TCPIPAllowList) @@ -1714,7 +1771,7 @@ func (in *TLSClientConfig) DeepCopyInto(out *TLSClientConfig) { *out = *in if in.RootCAs != nil { in, out := &in.RootCAs, &out.RootCAs - *out = make([]tls.FileOrContent, len(*in)) + *out = make([]types.FileOrContent, len(*in)) copy(*out, *in) } if in.Certificates != nil { diff --git a/pkg/config/static/static_config.go b/pkg/config/static/static_config.go index 1c141a5a8..9f0ce294f 100644 --- a/pkg/config/static/static_config.go +++ b/pkg/config/static/static_config.go @@ -27,7 +27,6 @@ import ( "github.com/traefik/traefik/v3/pkg/provider/kv/zk" "github.com/traefik/traefik/v3/pkg/provider/nomad" "github.com/traefik/traefik/v3/pkg/provider/rest" - "github.com/traefik/traefik/v3/pkg/tls" "github.com/traefik/traefik/v3/pkg/tracing/opentelemetry" "github.com/traefik/traefik/v3/pkg/types" ) @@ -96,11 +95,11 @@ type Global struct { // ServersTransport options to configure communication between Traefik and the servers. type ServersTransport struct { - InsecureSkipVerify bool `description:"Disable SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` - RootCAs []tls.FileOrContent `description:"Add cert file for self-signed certificate." json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` - MaxIdleConnsPerHost int `description:"If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used" json:"maxIdleConnsPerHost,omitempty" toml:"maxIdleConnsPerHost,omitempty" yaml:"maxIdleConnsPerHost,omitempty" export:"true"` - ForwardingTimeouts *ForwardingTimeouts `description:"Timeouts for requests forwarded to the backend servers." json:"forwardingTimeouts,omitempty" toml:"forwardingTimeouts,omitempty" yaml:"forwardingTimeouts,omitempty" export:"true"` - Spiffe *Spiffe `description:"Defines the SPIFFE configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + InsecureSkipVerify bool `description:"Disable SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` + RootCAs []types.FileOrContent `description:"Add cert file for self-signed certificate." json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` + MaxIdleConnsPerHost int `description:"If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used" json:"maxIdleConnsPerHost,omitempty" toml:"maxIdleConnsPerHost,omitempty" yaml:"maxIdleConnsPerHost,omitempty" export:"true"` + ForwardingTimeouts *ForwardingTimeouts `description:"Timeouts for requests forwarded to the backend servers." json:"forwardingTimeouts,omitempty" toml:"forwardingTimeouts,omitempty" yaml:"forwardingTimeouts,omitempty" export:"true"` + Spiffe *Spiffe `description:"Defines the SPIFFE configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` } // Spiffe holds the SPIFFE configuration. @@ -124,9 +123,9 @@ type TCPServersTransport struct { // TLSClientConfig options to configure TLS communication between Traefik and the servers. type TLSClientConfig struct { - InsecureSkipVerify bool `description:"Disables SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` - RootCAs []tls.FileOrContent `description:"Defines a list of CA secret used to validate self-signed certificate" json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` - Spiffe *Spiffe `description:"Defines the SPIFFE TLS configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` + InsecureSkipVerify bool `description:"Disables SSL certificate verification." json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"` + RootCAs []types.FileOrContent `description:"Defines a list of CA secret used to validate self-signed certificate" json:"rootCAs,omitempty" toml:"rootCAs,omitempty" yaml:"rootCAs,omitempty"` + Spiffe *Spiffe `description:"Defines the SPIFFE TLS configuration." json:"spiffe,omitempty" toml:"spiffe,omitempty" yaml:"spiffe,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"` } // API holds the API configuration. diff --git a/pkg/middlewares/ipwhitelist/ip_whitelist.go b/pkg/middlewares/ipwhitelist/ip_whitelist.go new file mode 100644 index 000000000..937bde420 --- /dev/null +++ b/pkg/middlewares/ipwhitelist/ip_whitelist.go @@ -0,0 +1,88 @@ +package ipwhitelist + +import ( + "context" + "errors" + "fmt" + "net/http" + + "github.com/rs/zerolog/log" + "github.com/traefik/traefik/v3/pkg/config/dynamic" + "github.com/traefik/traefik/v3/pkg/ip" + "github.com/traefik/traefik/v3/pkg/middlewares" + "github.com/traefik/traefik/v3/pkg/tracing" + "go.opentelemetry.io/otel/trace" +) + +const ( + typeName = "IPWhiteLister" +) + +// ipWhiteLister is a middleware that provides Checks of the Requesting IP against a set of Whitelists. +type ipWhiteLister struct { + next http.Handler + whiteLister *ip.Checker + strategy ip.Strategy + name string +} + +// New builds a new IPWhiteLister given a list of CIDR-Strings to whitelist. +func New(ctx context.Context, next http.Handler, config dynamic.IPWhiteList, name string) (http.Handler, error) { + logger := middlewares.GetLogger(ctx, name, typeName) + logger.Debug().Msg("Creating middleware") + + if len(config.SourceRange) == 0 { + return nil, errors.New("sourceRange is empty, IPWhiteLister not created") + } + + checker, err := ip.NewChecker(config.SourceRange) + if err != nil { + return nil, fmt.Errorf("cannot parse CIDR whitelist %s: %w", config.SourceRange, err) + } + + strategy, err := config.IPStrategy.Get() + if err != nil { + return nil, err + } + + logger.Debug().Msgf("Setting up IPWhiteLister with sourceRange: %s", config.SourceRange) + + return &ipWhiteLister{ + strategy: strategy, + whiteLister: checker, + next: next, + name: name, + }, nil +} + +func (wl *ipWhiteLister) GetTracingInformation() (string, string, trace.SpanKind) { + return wl.name, typeName, trace.SpanKindInternal +} + +func (wl *ipWhiteLister) ServeHTTP(rw http.ResponseWriter, req *http.Request) { + logger := middlewares.GetLogger(req.Context(), wl.name, typeName) + ctx := logger.WithContext(req.Context()) + + clientIP := wl.strategy.GetIP(req) + err := wl.whiteLister.IsAuthorized(clientIP) + if err != nil { + msg := fmt.Sprintf("Rejecting IP %s: %v", clientIP, err) + logger.Debug().Msg(msg) + tracing.SetStatusErrorf(req.Context(), msg) + reject(ctx, rw) + return + } + logger.Debug().Msgf("Accepting IP %s", clientIP) + + wl.next.ServeHTTP(rw, req) +} + +func reject(ctx context.Context, rw http.ResponseWriter) { + statusCode := http.StatusForbidden + + rw.WriteHeader(statusCode) + _, err := rw.Write([]byte(http.StatusText(statusCode))) + if err != nil { + log.Ctx(ctx).Error().Err(err).Send() + } +} diff --git a/pkg/middlewares/ipwhitelist/ip_whitelist_test.go b/pkg/middlewares/ipwhitelist/ip_whitelist_test.go new file mode 100644 index 000000000..5e040016a --- /dev/null +++ b/pkg/middlewares/ipwhitelist/ip_whitelist_test.go @@ -0,0 +1,100 @@ +package ipwhitelist + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/traefik/traefik/v3/pkg/config/dynamic" +) + +func TestNewIPWhiteLister(t *testing.T) { + testCases := []struct { + desc string + whiteList dynamic.IPWhiteList + expectedError bool + }{ + { + desc: "invalid IP", + whiteList: dynamic.IPWhiteList{ + SourceRange: []string{"foo"}, + }, + expectedError: true, + }, + { + desc: "valid IP", + whiteList: dynamic.IPWhiteList{ + SourceRange: []string{"10.10.10.10"}, + }, + }, + } + + for _, test := range testCases { + test := test + t.Run(test.desc, func(t *testing.T) { + t.Parallel() + + next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}) + whiteLister, err := New(context.Background(), next, test.whiteList, "traefikTest") + + if test.expectedError { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.NotNil(t, whiteLister) + } + }) + } +} + +func TestIPWhiteLister_ServeHTTP(t *testing.T) { + testCases := []struct { + desc string + whiteList dynamic.IPWhiteList + remoteAddr string + expected int + }{ + { + desc: "authorized with remote address", + whiteList: dynamic.IPWhiteList{ + SourceRange: []string{"20.20.20.20"}, + }, + remoteAddr: "20.20.20.20:1234", + expected: 200, + }, + { + desc: "non authorized with remote address", + whiteList: dynamic.IPWhiteList{ + SourceRange: []string{"20.20.20.20"}, + }, + remoteAddr: "20.20.20.21:1234", + expected: 403, + }, + } + + for _, test := range testCases { + test := test + t.Run(test.desc, func(t *testing.T) { + t.Parallel() + + next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}) + whiteLister, err := New(context.Background(), next, test.whiteList, "traefikTest") + require.NoError(t, err) + + recorder := httptest.NewRecorder() + + req := httptest.NewRequest(http.MethodGet, "http://10.10.10.10", nil) + + if len(test.remoteAddr) > 0 { + req.RemoteAddr = test.remoteAddr + } + + whiteLister.ServeHTTP(recorder, req) + + assert.Equal(t, test.expected, recorder.Code) + }) + } +} diff --git a/pkg/middlewares/tcp/ipwhitelist/ip_whitelist.go b/pkg/middlewares/tcp/ipwhitelist/ip_whitelist.go new file mode 100644 index 000000000..86f3b6ac0 --- /dev/null +++ b/pkg/middlewares/tcp/ipwhitelist/ip_whitelist.go @@ -0,0 +1,63 @@ +package ipwhitelist + +import ( + "context" + "errors" + "fmt" + + "github.com/traefik/traefik/v3/pkg/config/dynamic" + "github.com/traefik/traefik/v3/pkg/ip" + "github.com/traefik/traefik/v3/pkg/middlewares" + "github.com/traefik/traefik/v3/pkg/tcp" +) + +const ( + typeName = "IPWhiteListerTCP" +) + +// ipWhiteLister is a middleware that provides Checks of the Requesting IP against a set of Whitelists. +type ipWhiteLister struct { + next tcp.Handler + whiteLister *ip.Checker + name string +} + +// New builds a new TCP IPWhiteLister given a list of CIDR-Strings to whitelist. +func New(ctx context.Context, next tcp.Handler, config dynamic.TCPIPWhiteList, name string) (tcp.Handler, error) { + logger := middlewares.GetLogger(ctx, name, typeName) + logger.Debug().Msg("Creating middleware") + + if len(config.SourceRange) == 0 { + return nil, errors.New("sourceRange is empty, IPWhiteLister not created") + } + + checker, err := ip.NewChecker(config.SourceRange) + if err != nil { + return nil, fmt.Errorf("cannot parse CIDR whitelist %s: %w", config.SourceRange, err) + } + + logger.Debug().Msgf("Setting up IPWhiteLister with sourceRange: %s", config.SourceRange) + + return &ipWhiteLister{ + whiteLister: checker, + next: next, + name: name, + }, nil +} + +func (wl *ipWhiteLister) ServeTCP(conn tcp.WriteCloser) { + logger := middlewares.GetLogger(context.Background(), wl.name, typeName) + + addr := conn.RemoteAddr().String() + + err := wl.whiteLister.IsAuthorized(addr) + if err != nil { + logger.Error().Err(err).Msgf("Connection from %s rejected", addr) + conn.Close() + return + } + + logger.Debug().Msgf("Connection from %s accepted", addr) + + wl.next.ServeTCP(conn) +} diff --git a/pkg/middlewares/tcp/ipwhitelist/ip_whitelist_test.go b/pkg/middlewares/tcp/ipwhitelist/ip_whitelist_test.go new file mode 100644 index 000000000..72fa33d0c --- /dev/null +++ b/pkg/middlewares/tcp/ipwhitelist/ip_whitelist_test.go @@ -0,0 +1,139 @@ +package ipwhitelist + +import ( + "context" + "io" + "net" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/traefik/traefik/v3/pkg/config/dynamic" + "github.com/traefik/traefik/v3/pkg/tcp" +) + +func TestNewIPWhiteLister(t *testing.T) { + testCases := []struct { + desc string + whiteList dynamic.TCPIPWhiteList + expectedError bool + }{ + { + desc: "Empty config", + whiteList: dynamic.TCPIPWhiteList{}, + expectedError: true, + }, + { + desc: "invalid IP", + whiteList: dynamic.TCPIPWhiteList{ + SourceRange: []string{"foo"}, + }, + expectedError: true, + }, + { + desc: "valid IP", + whiteList: dynamic.TCPIPWhiteList{ + SourceRange: []string{"10.10.10.10"}, + }, + }, + } + + for _, test := range testCases { + test := test + t.Run(test.desc, func(t *testing.T) { + t.Parallel() + + next := tcp.HandlerFunc(func(conn tcp.WriteCloser) {}) + whiteLister, err := New(context.Background(), next, test.whiteList, "traefikTest") + + if test.expectedError { + assert.Error(t, err) + } else { + require.NoError(t, err) + assert.NotNil(t, whiteLister) + } + }) + } +} + +func TestIPWhiteLister_ServeHTTP(t *testing.T) { + testCases := []struct { + desc string + whiteList dynamic.TCPIPWhiteList + remoteAddr string + expected string + }{ + { + desc: "authorized with remote address", + whiteList: dynamic.TCPIPWhiteList{ + SourceRange: []string{"20.20.20.20"}, + }, + remoteAddr: "20.20.20.20:1234", + expected: "OK", + }, + { + desc: "non authorized with remote address", + whiteList: dynamic.TCPIPWhiteList{ + SourceRange: []string{"20.20.20.20"}, + }, + remoteAddr: "20.20.20.21:1234", + }, + } + + for _, test := range testCases { + test := test + t.Run(test.desc, func(t *testing.T) { + t.Parallel() + + next := tcp.HandlerFunc(func(conn tcp.WriteCloser) { + write, err := conn.Write([]byte("OK")) + require.NoError(t, err) + assert.Equal(t, 2, write) + + err = conn.Close() + require.NoError(t, err) + }) + + whiteLister, err := New(context.Background(), next, test.whiteList, "traefikTest") + require.NoError(t, err) + + server, client := net.Pipe() + + go func() { + whiteLister.ServeTCP(&contextWriteCloser{client, addr{test.remoteAddr}}) + }() + + read, err := io.ReadAll(server) + require.NoError(t, err) + + assert.Equal(t, test.expected, string(read)) + }) + } +} + +type contextWriteCloser struct { + net.Conn + addr +} + +type addr struct { + remoteAddr string +} + +func (a addr) Network() string { + panic("implement me") +} + +func (a addr) String() string { + return a.remoteAddr +} + +func (c contextWriteCloser) CloseWrite() error { + panic("implement me") +} + +func (c contextWriteCloser) RemoteAddr() net.Addr { return c.addr } + +func (c contextWriteCloser) Context() context.Context { + return context.Background() +} diff --git a/pkg/provider/acme/challenge_tls.go b/pkg/provider/acme/challenge_tls.go index 3b8f201d4..f196e8952 100644 --- a/pkg/provider/acme/challenge_tls.go +++ b/pkg/provider/acme/challenge_tls.go @@ -152,8 +152,8 @@ func createMessage(certs map[string]*Certificate) dynamic.Message { for _, cert := range certs { certConf := &traefiktls.CertAndStores{ Certificate: traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent(cert.Certificate), - KeyFile: traefiktls.FileOrContent(cert.Key), + CertFile: types.FileOrContent(cert.Certificate), + KeyFile: types.FileOrContent(cert.Key), OCSP: traefiktls.OCSPConfig{ DisableStapling: true, }, diff --git a/pkg/provider/acme/provider.go b/pkg/provider/acme/provider.go index 2032e8af4..12d5a0b6d 100644 --- a/pkg/provider/acme/provider.go +++ b/pkg/provider/acme/provider.go @@ -783,8 +783,8 @@ func (p *Provider) buildMessage() dynamic.Message { for _, cert := range p.certificates { certConf := &traefiktls.CertAndStores{ Certificate: traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent(cert.Certificate.Certificate), - KeyFile: traefiktls.FileOrContent(cert.Key), + CertFile: types.FileOrContent(cert.Certificate.Certificate), + KeyFile: types.FileOrContent(cert.Key), }, Stores: []string{cert.Store}, } diff --git a/pkg/provider/consulcatalog/config_test.go b/pkg/provider/consulcatalog/config_test.go index c15908d96..5370a75ca 100644 --- a/pkg/provider/consulcatalog/config_test.go +++ b/pkg/provider/consulcatalog/config_test.go @@ -12,6 +12,7 @@ import ( 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 Int(v int) *int { return &v } @@ -428,7 +429,7 @@ func Test_buildConfiguration(t *testing.T) { "tls-ns-dc1-dev-Test": { ServerName: "ns-dc1-dev/Test", InsecureSkipVerify: true, - RootCAs: []tls.FileOrContent{ + RootCAs: []types.FileOrContent{ "root", }, Certificates: []tls.Certificate{ @@ -519,7 +520,7 @@ func Test_buildConfiguration(t *testing.T) { "tls-ns-dc1-dev-Test": { ServerName: "ns-dc1-dev/Test", InsecureSkipVerify: true, - RootCAs: []tls.FileOrContent{ + RootCAs: []types.FileOrContent{ "root", }, Certificates: []tls.Certificate{ @@ -2280,7 +2281,7 @@ func Test_buildConfiguration(t *testing.T) { TLS: &dynamic.TLSClientConfig{ ServerName: "ns-dc1-Test", InsecureSkipVerify: true, - RootCAs: []tls.FileOrContent{ + RootCAs: []types.FileOrContent{ "root", }, Certificates: []tls.Certificate{ @@ -2899,7 +2900,7 @@ func Test_buildConfiguration(t *testing.T) { "tls-ns-dc1-Test": { ServerName: "ns-dc1-Test", InsecureSkipVerify: true, - RootCAs: []tls.FileOrContent{ + RootCAs: []types.FileOrContent{ "root", }, Certificates: []tls.Certificate{ diff --git a/pkg/provider/consulcatalog/connect_tls.go b/pkg/provider/consulcatalog/connect_tls.go index 55e49fd06..b73acb1a1 100644 --- a/pkg/provider/consulcatalog/connect_tls.go +++ b/pkg/provider/consulcatalog/connect_tls.go @@ -5,6 +5,7 @@ import ( "github.com/traefik/traefik/v3/pkg/config/dynamic" traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) // connectCert holds our certificates as a client of the Consul Connect protocol. @@ -13,18 +14,18 @@ type connectCert struct { leaf keyPair } -func (c *connectCert) getRoot() []traefiktls.FileOrContent { - var result []traefiktls.FileOrContent +func (c *connectCert) getRoot() []types.FileOrContent { + var result []types.FileOrContent for _, r := range c.root { - result = append(result, traefiktls.FileOrContent(r)) + result = append(result, types.FileOrContent(r)) } return result } func (c *connectCert) getLeaf() traefiktls.Certificate { return traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent(c.leaf.cert), - KeyFile: traefiktls.FileOrContent(c.leaf.key), + CertFile: types.FileOrContent(c.leaf.cert), + KeyFile: types.FileOrContent(c.leaf.key), } } diff --git a/pkg/provider/file/file.go b/pkg/provider/file/file.go index 7ba814c88..ad19f573e 100644 --- a/pkg/provider/file/file.go +++ b/pkg/provider/file/file.go @@ -19,6 +19,7 @@ import ( "github.com/traefik/traefik/v3/pkg/provider" "github.com/traefik/traefik/v3/pkg/safe" "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) const providerName = "file" @@ -180,7 +181,7 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem // TLS Options if configuration.TLS.Options != nil { for name, options := range configuration.TLS.Options { - var caCerts []tls.FileOrContent + var caCerts []types.FileOrContent for _, caFile := range options.ClientAuth.CAFiles { content, err := caFile.Read() @@ -189,7 +190,7 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem continue } - caCerts = append(caCerts, tls.FileOrContent(content)) + caCerts = append(caCerts, types.FileOrContent(content)) } options.ClientAuth.CAFiles = caCerts @@ -209,14 +210,14 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem log.Ctx(ctx).Error().Err(err).Send() continue } - store.DefaultCertificate.CertFile = tls.FileOrContent(content) + store.DefaultCertificate.CertFile = types.FileOrContent(content) content, err = store.DefaultCertificate.KeyFile.Read() if err != nil { log.Ctx(ctx).Error().Err(err).Send() continue } - store.DefaultCertificate.KeyFile = tls.FileOrContent(content) + store.DefaultCertificate.KeyFile = types.FileOrContent(content) configuration.TLS.Stores[name] = store } @@ -233,21 +234,21 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem log.Ctx(ctx).Error().Err(err).Send() continue } - cert.CertFile = tls.FileOrContent(content) + cert.CertFile = types.FileOrContent(content) content, err = cert.KeyFile.Read() if err != nil { log.Ctx(ctx).Error().Err(err).Send() continue } - cert.KeyFile = tls.FileOrContent(content) + cert.KeyFile = types.FileOrContent(content) certificates = append(certificates, cert) } configuration.HTTP.ServersTransports[name].Certificates = certificates - var rootCAs []tls.FileOrContent + var rootCAs []types.FileOrContent for _, rootCA := range st.RootCAs { content, err := rootCA.Read() if err != nil { @@ -255,7 +256,7 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem continue } - rootCAs = append(rootCAs, tls.FileOrContent(content)) + rootCAs = append(rootCAs, types.FileOrContent(content)) } st.RootCAs = rootCAs @@ -275,21 +276,21 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem log.Ctx(ctx).Error().Err(err).Send() continue } - cert.CertFile = tls.FileOrContent(content) + cert.CertFile = types.FileOrContent(content) content, err = cert.KeyFile.Read() if err != nil { log.Ctx(ctx).Error().Err(err).Send() continue } - cert.KeyFile = tls.FileOrContent(content) + cert.KeyFile = types.FileOrContent(content) certificates = append(certificates, cert) } configuration.TCP.ServersTransports[name].TLS.Certificates = certificates - var rootCAs []tls.FileOrContent + var rootCAs []types.FileOrContent for _, rootCA := range st.TLS.RootCAs { content, err := rootCA.Read() if err != nil { @@ -297,7 +298,7 @@ func (p *Provider) loadFileConfig(ctx context.Context, filename string, parseTem continue } - rootCAs = append(rootCAs, tls.FileOrContent(content)) + rootCAs = append(rootCAs, types.FileOrContent(content)) } st.TLS.RootCAs = rootCAs @@ -315,14 +316,14 @@ func flattenCertificates(ctx context.Context, tlsConfig *dynamic.TLSConfiguratio log.Ctx(ctx).Error().Err(err).Send() continue } - cert.Certificate.CertFile = tls.FileOrContent(string(content)) + cert.Certificate.CertFile = types.FileOrContent(string(content)) content, err = cert.Certificate.KeyFile.Read() if err != nil { log.Ctx(ctx).Error().Err(err).Send() continue } - cert.Certificate.KeyFile = tls.FileOrContent(string(content)) + cert.Certificate.KeyFile = types.FileOrContent(string(content)) certs = append(certs, cert) } diff --git a/pkg/provider/kubernetes/crd/client.go b/pkg/provider/kubernetes/crd/client.go index d52588536..83c4834ba 100644 --- a/pkg/provider/kubernetes/crd/client.go +++ b/pkg/provider/kubernetes/crd/client.go @@ -13,6 +13,7 @@ import ( traefikinformers "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/informers/externalversions" traefikv1alpha1 "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1" "github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s" + "github.com/traefik/traefik/v3/pkg/types" "github.com/traefik/traefik/v3/pkg/version" corev1 "k8s.io/api/core/v1" kerror "k8s.io/apimachinery/pkg/api/errors" @@ -120,14 +121,19 @@ func newExternalClusterClientFromFile(file string) (*clientWrapper, error) { // newExternalClusterClient returns a new Provider client that may run outside // of the cluster. // The endpoint parameter must not be empty. -func newExternalClusterClient(endpoint, token, caFilePath string) (*clientWrapper, error) { +func newExternalClusterClient(endpoint, caFilePath string, token types.FileOrContent) (*clientWrapper, error) { if endpoint == "" { return nil, errors.New("endpoint missing for external cluster client") } + tokenData, err := token.Read() + if err != nil { + return nil, fmt.Errorf("read token: %w", err) + } + config := &rest.Config{ Host: endpoint, - BearerToken: token, + BearerToken: string(tokenData), } if caFilePath != "" { diff --git a/pkg/provider/kubernetes/crd/kubernetes.go b/pkg/provider/kubernetes/crd/kubernetes.go index 5a0828d13..5023cf6c5 100644 --- a/pkg/provider/kubernetes/crd/kubernetes.go +++ b/pkg/provider/kubernetes/crd/kubernetes.go @@ -48,16 +48,16 @@ const ( // Provider holds configurations of the provider. type Provider struct { - Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` - CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"` - Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"` - AllowCrossNamespace bool `description:"Allow cross namespace resource reference." json:"allowCrossNamespace,omitempty" toml:"allowCrossNamespace,omitempty" yaml:"allowCrossNamespace,omitempty" export:"true"` - AllowExternalNameServices bool `description:"Allow ExternalName services." json:"allowExternalNameServices,omitempty" toml:"allowExternalNameServices,omitempty" yaml:"allowExternalNameServices,omitempty" export:"true"` - LabelSelector string `description:"Kubernetes label selector to use." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"` - IngressClass string `description:"Value of kubernetes.io/ingress.class annotation to watch for." json:"ingressClass,omitempty" toml:"ingressClass,omitempty" yaml:"ingressClass,omitempty" export:"true"` - ThrottleDuration ptypes.Duration `description:"Ingress refresh throttle duration" json:"throttleDuration,omitempty" toml:"throttleDuration,omitempty" yaml:"throttleDuration,omitempty" export:"true"` - AllowEmptyServices bool `description:"Allow the creation of services without endpoints." json:"allowEmptyServices,omitempty" toml:"allowEmptyServices,omitempty" yaml:"allowEmptyServices,omitempty" export:"true"` + Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"` + Token types.FileOrContent `description:"Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` + CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"` + Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"` + AllowCrossNamespace bool `description:"Allow cross namespace resource reference." json:"allowCrossNamespace,omitempty" toml:"allowCrossNamespace,omitempty" yaml:"allowCrossNamespace,omitempty" export:"true"` + AllowExternalNameServices bool `description:"Allow ExternalName services." json:"allowExternalNameServices,omitempty" toml:"allowExternalNameServices,omitempty" yaml:"allowExternalNameServices,omitempty" export:"true"` + LabelSelector string `description:"Kubernetes label selector to use." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"` + IngressClass string `description:"Value of kubernetes.io/ingress.class annotation to watch for." json:"ingressClass,omitempty" toml:"ingressClass,omitempty" yaml:"ingressClass,omitempty" export:"true"` + ThrottleDuration ptypes.Duration `description:"Ingress refresh throttle duration" json:"throttleDuration,omitempty" toml:"throttleDuration,omitempty" yaml:"throttleDuration,omitempty" export:"true"` + AllowEmptyServices bool `description:"Allow the creation of services without endpoints." json:"allowEmptyServices,omitempty" toml:"allowEmptyServices,omitempty" yaml:"allowEmptyServices,omitempty" export:"true"` lastConfiguration safe.Safe @@ -101,7 +101,7 @@ func (p *Provider) newK8sClient(ctx context.Context) (*clientWrapper, error) { client, err = newExternalClusterClientFromFile(os.Getenv("KUBECONFIG")) default: log.Ctx(ctx).Info().Msgf("Creating cluster-external Provider client%s", withEndpoint) - client, err = newExternalClusterClient(p.Endpoint, p.Token, p.CertAuthFilePath) + client, err = newExternalClusterClient(p.Endpoint, p.CertAuthFilePath, p.Token) } if err != nil { @@ -288,6 +288,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) ReplacePath: middleware.Spec.ReplacePath, ReplacePathRegex: middleware.Spec.ReplacePathRegex, Chain: createChainMiddleware(ctxMid, middleware.Namespace, middleware.Spec.Chain), + IPWhiteList: middleware.Spec.IPWhiteList, IPAllowList: middleware.Spec.IPAllowList, Headers: middleware.Spec.Headers, Errors: errorPage, @@ -314,6 +315,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) conf.TCP.Middlewares[id] = &dynamic.TCPMiddleware{ InFlightConn: middlewareTCP.Spec.InFlightConn, + IPWhiteList: middlewareTCP.Spec.IPWhiteList, IPAllowList: middlewareTCP.Spec.IPAllowList, } } @@ -337,7 +339,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) for _, serversTransport := range client.GetServersTransports() { logger := log.Ctx(ctx).With().Str(logs.ServersTransportName, serversTransport.Name).Logger() - var rootCAs []tls.FileOrContent + var rootCAs []types.FileOrContent for _, secret := range serversTransport.Spec.RootCAsSecrets { caSecret, err := loadCASecret(serversTransport.Namespace, secret, client) if err != nil { @@ -345,7 +347,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) continue } - rootCAs = append(rootCAs, tls.FileOrContent(caSecret)) + rootCAs = append(rootCAs, types.FileOrContent(caSecret)) } var certs tls.Certificates @@ -357,8 +359,8 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) } certs = append(certs, tls.Certificate{ - CertFile: tls.FileOrContent(tlsSecret), - KeyFile: tls.FileOrContent(tlsKey), + CertFile: types.FileOrContent(tlsSecret), + KeyFile: types.FileOrContent(tlsKey), OCSP: tls.OCSPConfig{ DisableStapling: false, }, @@ -447,7 +449,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) } if serversTransportTCP.Spec.TLS != nil { - var rootCAs []tls.FileOrContent + var rootCAs []types.FileOrContent for _, secret := range serversTransportTCP.Spec.TLS.RootCAsSecrets { caSecret, err := loadCASecret(serversTransportTCP.Namespace, secret, client) if err != nil { @@ -458,7 +460,7 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) continue } - rootCAs = append(rootCAs, tls.FileOrContent(caSecret)) + rootCAs = append(rootCAs, types.FileOrContent(caSecret)) } var certs tls.Certificates @@ -473,8 +475,8 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) } certs = append(certs, tls.Certificate{ - CertFile: tls.FileOrContent(tlsCert), - KeyFile: tls.FileOrContent(tlsKey), + CertFile: types.FileOrContent(tlsCert), + KeyFile: types.FileOrContent(tlsKey), }) } @@ -964,7 +966,7 @@ func buildTLSOptions(ctx context.Context, client Client) map[string]tls.Options for _, tlsOption := range tlsOptionsCRD { logger := log.Ctx(ctx).With().Str("tlsOption", tlsOption.Name).Str("namespace", tlsOption.Namespace).Logger() - var clientCAs []tls.FileOrContent + var clientCAs []types.FileOrContent for _, secretName := range tlsOption.Spec.ClientAuth.SecretNames { secret, exists, err := client.GetSecret(tlsOption.Namespace, secretName) @@ -984,7 +986,7 @@ func buildTLSOptions(ctx context.Context, client Client) map[string]tls.Options continue } - clientCAs = append(clientCAs, tls.FileOrContent(cert)) + clientCAs = append(clientCAs, types.FileOrContent(cert)) } id := makeID(tlsOption.Namespace, tlsOption.Name) @@ -1064,8 +1066,8 @@ func buildTLSStores(ctx context.Context, client Client) (map[string]tls.Store, m } tlsStore.DefaultCertificate = &tls.Certificate{ - CertFile: tls.FileOrContent(cert), - KeyFile: tls.FileOrContent(key), + CertFile: types.FileOrContent(cert), + KeyFile: types.FileOrContent(key), } } @@ -1150,8 +1152,8 @@ func getTLS(k8sClient Client, secretName, namespace string) (*tls.CertAndStores, return &tls.CertAndStores{ Certificate: tls.Certificate{ - CertFile: tls.FileOrContent(cert), - KeyFile: tls.FileOrContent(key), + CertFile: types.FileOrContent(cert), + KeyFile: types.FileOrContent(key), }, }, nil } diff --git a/pkg/provider/kubernetes/crd/kubernetes_test.go b/pkg/provider/kubernetes/crd/kubernetes_test.go index ca833c2ee..a6d2c64ca 100644 --- a/pkg/provider/kubernetes/crd/kubernetes_test.go +++ b/pkg/provider/kubernetes/crd/kubernetes_test.go @@ -571,8 +571,8 @@ func TestLoadIngressRouteTCPs(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -673,9 +673,9 @@ func TestLoadIngressRouteTCPs(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -741,9 +741,9 @@ func TestLoadIngressRouteTCPs(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -809,8 +809,8 @@ func TestLoadIngressRouteTCPs(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -1064,8 +1064,8 @@ func TestLoadIngressRouteTCPs(t *testing.T) { Stores: map[string]tls.Store{ "default": { DefaultCertificate: &tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -1405,7 +1405,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) { TLS: &dynamic.TLSClientConfig{ ServerName: "test", InsecureSkipVerify: true, - RootCAs: []tls.FileOrContent{"TESTROOTCAS0", "TESTROOTCAS1", "TESTROOTCAS2", "TESTROOTCAS3", "TESTROOTCAS5", "TESTALLCERTS"}, + RootCAs: []types.FileOrContent{"TESTROOTCAS0", "TESTROOTCAS1", "TESTROOTCAS2", "TESTROOTCAS3", "TESTROOTCAS5", "TESTALLCERTS"}, Certificates: tls.Certificates{ {CertFile: "TESTCERT1", KeyFile: "TESTKEY1"}, {CertFile: "TESTCERT2", KeyFile: "TESTKEY2"}, @@ -2917,8 +2917,8 @@ func TestLoadIngressRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -2979,9 +2979,9 @@ func TestLoadIngressRoutes(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -3100,9 +3100,9 @@ func TestLoadIngressRoutes(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -3178,9 +3178,9 @@ func TestLoadIngressRoutes(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -3251,8 +3251,8 @@ func TestLoadIngressRoutes(t *testing.T) { "TLS_RSA_WITH_AES_256_GCM_SHA384", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), }, ClientAuthType: "VerifyClientCertIfGiven", }, @@ -3881,8 +3881,8 @@ func TestLoadIngressRoutes(t *testing.T) { Stores: map[string]tls.Store{ "default": { DefaultCertificate: &tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -3938,8 +3938,8 @@ func TestLoadIngressRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, Stores: []string{"default"}, }, @@ -4215,7 +4215,7 @@ func TestLoadIngressRoutes(t *testing.T) { "foo-test": { ServerName: "test", InsecureSkipVerify: true, - RootCAs: []tls.FileOrContent{"TESTROOTCAS0", "TESTROOTCAS1", "TESTROOTCAS2", "TESTROOTCAS3", "TESTROOTCAS5", "TESTALLCERTS"}, + RootCAs: []types.FileOrContent{"TESTROOTCAS0", "TESTROOTCAS1", "TESTROOTCAS2", "TESTROOTCAS3", "TESTROOTCAS5", "TESTALLCERTS"}, Certificates: tls.Certificates{ {CertFile: "TESTCERT1", KeyFile: "TESTKEY1"}, {CertFile: "TESTCERT2", KeyFile: "TESTKEY2"}, diff --git a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middleware.go b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middleware.go index 51078f856..c86d51d3a 100644 --- a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middleware.go +++ b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middleware.go @@ -26,12 +26,14 @@ type Middleware struct { // MiddlewareSpec defines the desired state of a Middleware. type MiddlewareSpec struct { - AddPrefix *dynamic.AddPrefix `json:"addPrefix,omitempty"` - StripPrefix *dynamic.StripPrefix `json:"stripPrefix,omitempty"` - StripPrefixRegex *dynamic.StripPrefixRegex `json:"stripPrefixRegex,omitempty"` - ReplacePath *dynamic.ReplacePath `json:"replacePath,omitempty"` - ReplacePathRegex *dynamic.ReplacePathRegex `json:"replacePathRegex,omitempty"` - Chain *Chain `json:"chain,omitempty"` + AddPrefix *dynamic.AddPrefix `json:"addPrefix,omitempty"` + StripPrefix *dynamic.StripPrefix `json:"stripPrefix,omitempty"` + StripPrefixRegex *dynamic.StripPrefixRegex `json:"stripPrefixRegex,omitempty"` + ReplacePath *dynamic.ReplacePath `json:"replacePath,omitempty"` + ReplacePathRegex *dynamic.ReplacePathRegex `json:"replacePathRegex,omitempty"` + Chain *Chain `json:"chain,omitempty"` + // Deprecated: please use IPAllowList instead. + IPWhiteList *dynamic.IPWhiteList `json:"ipWhiteList,omitempty"` IPAllowList *dynamic.IPAllowList `json:"ipAllowList,omitempty"` Headers *dynamic.Headers `json:"headers,omitempty"` Errors *ErrorPage `json:"errors,omitempty"` diff --git a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middlewaretcp.go b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middlewaretcp.go index 10799f295..d15402a26 100644 --- a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middlewaretcp.go +++ b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/middlewaretcp.go @@ -25,6 +25,9 @@ type MiddlewareTCP struct { type MiddlewareTCPSpec struct { // InFlightConn defines the InFlightConn middleware configuration. InFlightConn *dynamic.TCPInFlightConn `json:"inFlightConn,omitempty"` + // IPWhiteList defines the IPWhiteList middleware configuration. + // Deprecated: please use IPAllowList instead. + IPWhiteList *dynamic.TCPIPWhiteList `json:"ipWhiteList,omitempty"` // IPAllowList defines the IPAllowList middleware configuration. IPAllowList *dynamic.TCPIPAllowList `json:"ipAllowList,omitempty"` } diff --git a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/zz_generated.deepcopy.go b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/zz_generated.deepcopy.go index 200969b3d..b08d2f7c4 100644 --- a/pkg/provider/kubernetes/crd/traefikio/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/provider/kubernetes/crd/traefikio/v1alpha1/zz_generated.deepcopy.go @@ -689,6 +689,11 @@ func (in *MiddlewareSpec) DeepCopyInto(out *MiddlewareSpec) { *out = new(Chain) (*in).DeepCopyInto(*out) } + if in.IPWhiteList != nil { + in, out := &in.IPWhiteList, &out.IPWhiteList + *out = new(dynamic.IPWhiteList) + (*in).DeepCopyInto(*out) + } if in.IPAllowList != nil { in, out := &in.IPAllowList, &out.IPAllowList *out = new(dynamic.IPAllowList) @@ -862,6 +867,11 @@ func (in *MiddlewareTCPSpec) DeepCopyInto(out *MiddlewareTCPSpec) { *out = new(dynamic.TCPInFlightConn) **out = **in } + if in.IPWhiteList != nil { + in, out := &in.IPWhiteList, &out.IPWhiteList + *out = new(dynamic.TCPIPWhiteList) + (*in).DeepCopyInto(*out) + } if in.IPAllowList != nil { in, out := &in.IPAllowList, &out.IPAllowList *out = new(dynamic.TCPIPAllowList) diff --git a/pkg/provider/kubernetes/gateway/client.go b/pkg/provider/kubernetes/gateway/client.go index ce4e02588..709be079d 100644 --- a/pkg/provider/kubernetes/gateway/client.go +++ b/pkg/provider/kubernetes/gateway/client.go @@ -8,6 +8,7 @@ import ( "time" "github.com/rs/zerolog/log" + "github.com/traefik/traefik/v3/pkg/types" corev1 "k8s.io/api/core/v1" kerror "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -129,14 +130,19 @@ func newExternalClusterClientFromFile(file string) (*clientWrapper, error) { // newExternalClusterClient returns a new Provider client that may run outside of the cluster. // The endpoint parameter must not be empty. -func newExternalClusterClient(endpoint, token, caFilePath string) (*clientWrapper, error) { +func newExternalClusterClient(endpoint, caFilePath string, token types.FileOrContent) (*clientWrapper, error) { if endpoint == "" { return nil, errors.New("endpoint missing for external cluster client") } + tokenData, err := token.Read() + if err != nil { + return nil, fmt.Errorf("read token: %w", err) + } + config := &rest.Config{ Host: endpoint, - BearerToken: token, + BearerToken: string(tokenData), } if caFilePath != "" { diff --git a/pkg/provider/kubernetes/gateway/kubernetes.go b/pkg/provider/kubernetes/gateway/kubernetes.go index 2379b2cfa..c86467b0f 100644 --- a/pkg/provider/kubernetes/gateway/kubernetes.go +++ b/pkg/provider/kubernetes/gateway/kubernetes.go @@ -27,6 +27,7 @@ import ( "github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s" "github.com/traefik/traefik/v3/pkg/safe" "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -48,7 +49,7 @@ const ( // Provider holds configurations of the provider. type Provider struct { Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` + Token types.FileOrContent `description:"Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"` Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"` LabelSelector string `description:"Kubernetes label selector to select specific GatewayClasses." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"` @@ -101,7 +102,7 @@ func (p *Provider) newK8sClient(ctx context.Context) (*clientWrapper, error) { client, err = newExternalClusterClientFromFile(os.Getenv("KUBECONFIG")) default: logger.Info().Str("endpoint", p.Endpoint).Msg("Creating cluster-external Provider client") - client, err = newExternalClusterClient(p.Endpoint, p.Token, p.CertAuthFilePath) + client, err = newExternalClusterClient(p.Endpoint, p.CertAuthFilePath, p.Token) } if err != nil { @@ -1428,8 +1429,8 @@ func getTLS(k8sClient Client, secretName gatev1.ObjectName, namespace string) (* return &tls.CertAndStores{ Certificate: tls.Certificate{ - CertFile: tls.FileOrContent(cert), - KeyFile: tls.FileOrContent(key), + CertFile: types.FileOrContent(cert), + KeyFile: types.FileOrContent(key), }, }, nil } diff --git a/pkg/provider/kubernetes/gateway/kubernetes_test.go b/pkg/provider/kubernetes/gateway/kubernetes_test.go index 1238576d2..7c747a270 100644 --- a/pkg/provider/kubernetes/gateway/kubernetes_test.go +++ b/pkg/provider/kubernetes/gateway/kubernetes_test.go @@ -11,6 +11,7 @@ import ( "github.com/traefik/traefik/v3/pkg/config/dynamic" "github.com/traefik/traefik/v3/pkg/provider" "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" gatev1 "sigs.k8s.io/gateway-api/apis/v1" @@ -492,8 +493,8 @@ func TestLoadHTTPRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -741,8 +742,8 @@ func TestLoadHTTPRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -1176,8 +1177,8 @@ func TestLoadHTTPRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -1265,8 +1266,8 @@ func TestLoadHTTPRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -2240,8 +2241,8 @@ func TestLoadTCPRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -2735,8 +2736,8 @@ func TestLoadTLSRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -2947,8 +2948,8 @@ func TestLoadTLSRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -3016,8 +3017,8 @@ func TestLoadTLSRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -3823,8 +3824,8 @@ func TestLoadMixedRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -4002,8 +4003,8 @@ func TestLoadMixedRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -4243,8 +4244,8 @@ func TestLoadMixedRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -4394,8 +4395,8 @@ func TestLoadMixedRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -4526,8 +4527,8 @@ func TestLoadMixedRoutes(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, diff --git a/pkg/provider/kubernetes/ingress/client.go b/pkg/provider/kubernetes/ingress/client.go index 8bbdbc637..c29f3c6b3 100644 --- a/pkg/provider/kubernetes/ingress/client.go +++ b/pkg/provider/kubernetes/ingress/client.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/go-version" "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/core/v1" netv1 "k8s.io/api/networking/v1" @@ -81,14 +82,19 @@ func newExternalClusterClientFromFile(file string) (*clientWrapper, error) { // newExternalClusterClient returns a new Provider client that may run outside // of the cluster. // The endpoint parameter must not be empty. -func newExternalClusterClient(endpoint, token, caFilePath string) (*clientWrapper, error) { +func newExternalClusterClient(endpoint, caFilePath string, token types.FileOrContent) (*clientWrapper, error) { if endpoint == "" { return nil, errors.New("endpoint missing for external cluster client") } + tokenData, err := token.Read() + if err != nil { + return nil, fmt.Errorf("read token: %w", err) + } + config := &rest.Config{ Host: endpoint, - BearerToken: token, + BearerToken: string(tokenData), } if caFilePath != "" { diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go index 9bd582feb..8ccbf4f58 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes.go +++ b/pkg/provider/kubernetes/ingress/kubernetes.go @@ -25,6 +25,7 @@ import ( "github.com/traefik/traefik/v3/pkg/provider/kubernetes/k8s" "github.com/traefik/traefik/v3/pkg/safe" "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" corev1 "k8s.io/api/core/v1" netv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/labels" @@ -39,17 +40,17 @@ const ( // Provider holds configurations of the provider. type Provider struct { - Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"` - Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` - CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"` - Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"` - LabelSelector string `description:"Kubernetes Ingress label selector to use." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"` - IngressClass string `description:"Value of kubernetes.io/ingress.class annotation or IngressClass name to watch for." json:"ingressClass,omitempty" toml:"ingressClass,omitempty" yaml:"ingressClass,omitempty" export:"true"` - IngressEndpoint *EndpointIngress `description:"Kubernetes Ingress Endpoint." json:"ingressEndpoint,omitempty" toml:"ingressEndpoint,omitempty" yaml:"ingressEndpoint,omitempty" export:"true"` - ThrottleDuration ptypes.Duration `description:"Ingress refresh throttle duration" json:"throttleDuration,omitempty" toml:"throttleDuration,omitempty" yaml:"throttleDuration,omitempty" export:"true"` - AllowEmptyServices bool `description:"Allow creation of services without endpoints." json:"allowEmptyServices,omitempty" toml:"allowEmptyServices,omitempty" yaml:"allowEmptyServices,omitempty" export:"true"` - AllowExternalNameServices bool `description:"Allow ExternalName services." json:"allowExternalNameServices,omitempty" toml:"allowExternalNameServices,omitempty" yaml:"allowExternalNameServices,omitempty" export:"true"` - DisableIngressClassLookup bool `description:"Disables the lookup of IngressClasses." json:"disableIngressClassLookup,omitempty" toml:"disableIngressClassLookup,omitempty" yaml:"disableIngressClassLookup,omitempty" export:"true"` + Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"` + Token types.FileOrContent `description:"Kubernetes bearer token (not needed for in-cluster client). It accepts either a token value or a file path to the token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"` + CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"` + Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"` + LabelSelector string `description:"Kubernetes Ingress label selector to use." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"` + IngressClass string `description:"Value of kubernetes.io/ingress.class annotation or IngressClass name to watch for." json:"ingressClass,omitempty" toml:"ingressClass,omitempty" yaml:"ingressClass,omitempty" export:"true"` + IngressEndpoint *EndpointIngress `description:"Kubernetes Ingress Endpoint." json:"ingressEndpoint,omitempty" toml:"ingressEndpoint,omitempty" yaml:"ingressEndpoint,omitempty" export:"true"` + ThrottleDuration ptypes.Duration `description:"Ingress refresh throttle duration" json:"throttleDuration,omitempty" toml:"throttleDuration,omitempty" yaml:"throttleDuration,omitempty" export:"true"` + AllowEmptyServices bool `description:"Allow creation of services without endpoints." json:"allowEmptyServices,omitempty" toml:"allowEmptyServices,omitempty" yaml:"allowEmptyServices,omitempty" export:"true"` + AllowExternalNameServices bool `description:"Allow ExternalName services." json:"allowExternalNameServices,omitempty" toml:"allowExternalNameServices,omitempty" yaml:"allowExternalNameServices,omitempty" export:"true"` + DisableIngressClassLookup bool `description:"Disables the lookup of IngressClasses." json:"disableIngressClassLookup,omitempty" toml:"disableIngressClassLookup,omitempty" yaml:"disableIngressClassLookup,omitempty" export:"true"` lastConfiguration safe.Safe @@ -103,7 +104,7 @@ func (p *Provider) newK8sClient(ctx context.Context) (*clientWrapper, error) { cl, err = newExternalClusterClientFromFile(os.Getenv("KUBECONFIG")) default: logger.Info().Msgf("Creating cluster-external Provider client%s", withEndpoint) - cl, err = newExternalClusterClient(p.Endpoint, p.Token, p.CertAuthFilePath) + cl, err = newExternalClusterClient(p.Endpoint, p.CertAuthFilePath, p.Token) } if err != nil { @@ -463,8 +464,8 @@ func getCertificates(ctx context.Context, ingress *netv1.Ingress, k8sClient Clie tlsConfigs[configKey] = &tls.CertAndStores{ Certificate: tls.Certificate{ - CertFile: tls.FileOrContent(cert), - KeyFile: tls.FileOrContent(key), + CertFile: types.FileOrContent(cert), + KeyFile: types.FileOrContent(key), }, } } diff --git a/pkg/provider/kubernetes/ingress/kubernetes_test.go b/pkg/provider/kubernetes/ingress/kubernetes_test.go index e044cf577..cffccbbcb 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes_test.go +++ b/pkg/provider/kubernetes/ingress/kubernetes_test.go @@ -877,8 +877,8 @@ func TestLoadConfigurationFromIngresses(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), - KeyFile: tls.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), + CertFile: types.FileOrContent("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"), + KeyFile: types.FileOrContent("-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----"), }, }, }, @@ -1834,14 +1834,14 @@ func TestGetCertificates(t *testing.T) { result: map[string]*tls.CertAndStores{ "testing-test-secret": { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("tls-crt"), - KeyFile: tls.FileOrContent("tls-key"), + CertFile: types.FileOrContent("tls-crt"), + KeyFile: types.FileOrContent("tls-key"), }, }, "testing-test-secret2": { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("tls-crt"), - KeyFile: tls.FileOrContent("tls-key"), + CertFile: types.FileOrContent("tls-crt"), + KeyFile: types.FileOrContent("tls-key"), }, }, }, diff --git a/pkg/provider/kv/kv_test.go b/pkg/provider/kv/kv_test.go index 2497bfcab..43308fdf9 100644 --- a/pkg/provider/kv/kv_test.go +++ b/pkg/provider/kv/kv_test.go @@ -811,8 +811,8 @@ func Test_buildConfiguration(t *testing.T) { Certificates: []*tls.CertAndStores{ { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("foobar"), - KeyFile: tls.FileOrContent("foobar"), + CertFile: types.FileOrContent("foobar"), + KeyFile: types.FileOrContent("foobar"), OCSP: tls.OCSPConfig{ DisableStapling: false, }, @@ -824,8 +824,8 @@ func Test_buildConfiguration(t *testing.T) { }, { Certificate: tls.Certificate{ - CertFile: tls.FileOrContent("foobar"), - KeyFile: tls.FileOrContent("foobar"), + CertFile: types.FileOrContent("foobar"), + KeyFile: types.FileOrContent("foobar"), OCSP: tls.OCSPConfig{ DisableStapling: false, }, @@ -849,9 +849,9 @@ func Test_buildConfiguration(t *testing.T) { "foobar", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("foobar"), - tls.FileOrContent("foobar"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("foobar"), + types.FileOrContent("foobar"), }, ClientAuthType: "foobar", }, @@ -874,9 +874,9 @@ func Test_buildConfiguration(t *testing.T) { "foobar", }, ClientAuth: tls.ClientAuth{ - CAFiles: []tls.FileOrContent{ - tls.FileOrContent("foobar"), - tls.FileOrContent("foobar"), + CAFiles: []types.FileOrContent{ + types.FileOrContent("foobar"), + types.FileOrContent("foobar"), }, ClientAuthType: "foobar", }, @@ -891,8 +891,8 @@ func Test_buildConfiguration(t *testing.T) { Stores: map[string]tls.Store{ "Store0": { DefaultCertificate: &tls.Certificate{ - CertFile: tls.FileOrContent("foobar"), - KeyFile: tls.FileOrContent("foobar"), + CertFile: types.FileOrContent("foobar"), + KeyFile: types.FileOrContent("foobar"), OCSP: tls.OCSPConfig{ DisableStapling: false, }, @@ -900,8 +900,8 @@ func Test_buildConfiguration(t *testing.T) { }, "Store1": { DefaultCertificate: &tls.Certificate{ - CertFile: tls.FileOrContent("foobar"), - KeyFile: tls.FileOrContent("foobar"), + CertFile: types.FileOrContent("foobar"), + KeyFile: types.FileOrContent("foobar"), OCSP: tls.OCSPConfig{ DisableStapling: false, }, diff --git a/pkg/provider/tailscale/provider.go b/pkg/provider/tailscale/provider.go index b0b439b86..8e795e5be 100644 --- a/pkg/provider/tailscale/provider.go +++ b/pkg/provider/tailscale/provider.go @@ -17,6 +17,7 @@ import ( "github.com/traefik/traefik/v3/pkg/muxer/tcp" "github.com/traefik/traefik/v3/pkg/safe" traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) // Provider is the Tailscale certificates provider implementation. It receives @@ -254,8 +255,8 @@ func (p *Provider) fetchCerts(ctx context.Context, domains []string) { p.certByDomainMu.Lock() p.certByDomain[domain] = traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent(cert), - KeyFile: traefiktls.FileOrContent(key), + CertFile: types.FileOrContent(cert), + KeyFile: types.FileOrContent(key), } p.certByDomainMu.Unlock() } diff --git a/pkg/redactor/redactor.go b/pkg/redactor/redactor.go index 45be897a1..6761d9eb9 100644 --- a/pkg/redactor/redactor.go +++ b/pkg/redactor/redactor.go @@ -7,7 +7,7 @@ import ( "github.com/mitchellh/copystructure" "github.com/traefik/traefik/v3/pkg/config/dynamic" - "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" "mvdan.cc/xurls/v2" ) @@ -164,8 +164,8 @@ func reset(field reflect.Value, name string) error { } case reflect.String: if field.String() != "" { - if field.Type().AssignableTo(reflect.TypeOf(tls.FileOrContent(""))) { - field.Set(reflect.ValueOf(tls.FileOrContent(maskShort))) + if field.Type().AssignableTo(reflect.TypeOf(types.FileOrContent(""))) { + field.Set(reflect.ValueOf(types.FileOrContent(maskShort))) } else { field.Set(reflect.ValueOf(maskShort)) } diff --git a/pkg/redactor/redactor_config_test.go b/pkg/redactor/redactor_config_test.go index 0a6b174e9..c3ef9ef9d 100644 --- a/pkg/redactor/redactor_config_test.go +++ b/pkg/redactor/redactor_config_test.go @@ -130,7 +130,7 @@ func init() { "foo": { ServerName: "foo", InsecureSkipVerify: true, - RootCAs: []traefiktls.FileOrContent{"rootca.pem"}, + RootCAs: []types.FileOrContent{"rootca.pem"}, Certificates: []traefiktls.Certificate{ { CertFile: "cert.pem", @@ -390,7 +390,7 @@ func init() { TLS: &dynamic.TLSClientConfig{ ServerName: "foo", InsecureSkipVerify: true, - RootCAs: []traefiktls.FileOrContent{"rootca.pem"}, + RootCAs: []types.FileOrContent{"rootca.pem"}, Certificates: []traefiktls.Certificate{ { CertFile: "cert.pem", @@ -441,7 +441,7 @@ func init() { CipherSuites: []string{"foo"}, CurvePreferences: []string{"foo"}, ClientAuth: traefiktls.ClientAuth{ - CAFiles: []traefiktls.FileOrContent{"ca.pem"}, + CAFiles: []types.FileOrContent{"ca.pem"}, ClientAuthType: "RequireAndVerifyClientCert", }, SniStrict: true, @@ -560,7 +560,7 @@ func TestDo_staticConfiguration(t *testing.T) { config.ServersTransport = &static.ServersTransport{ InsecureSkipVerify: true, - RootCAs: []traefiktls.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"}, + RootCAs: []types.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"}, MaxIdleConnsPerHost: 111, ForwardingTimeouts: &static.ForwardingTimeouts{ DialTimeout: ptypes.Duration(111 * time.Second), @@ -574,7 +574,7 @@ func TestDo_staticConfiguration(t *testing.T) { DialKeepAlive: ptypes.Duration(111 * time.Second), TLS: &static.TLSClientConfig{ InsecureSkipVerify: true, - RootCAs: []traefiktls.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"}, + RootCAs: []types.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"}, }, } diff --git a/pkg/server/configurationwatcher.go b/pkg/server/configurationwatcher.go index da2d66f17..5071f2498 100644 --- a/pkg/server/configurationwatcher.go +++ b/pkg/server/configurationwatcher.go @@ -12,6 +12,7 @@ import ( "github.com/traefik/traefik/v3/pkg/provider" "github.com/traefik/traefik/v3/pkg/safe" "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) // ConfigurationWatcher watches configuration changes. @@ -188,7 +189,7 @@ func logConfiguration(logger zerolog.Logger, configMsg dynamic.Message) { if copyConf.TLS.Options != nil { cleanedOptions := make(map[string]tls.Options, len(copyConf.TLS.Options)) for name, option := range copyConf.TLS.Options { - option.ClientAuth.CAFiles = []tls.FileOrContent{} + option.ClientAuth.CAFiles = []types.FileOrContent{} cleanedOptions[name] = option } @@ -205,7 +206,7 @@ func logConfiguration(logger zerolog.Logger, configMsg dynamic.Message) { if copyConf.HTTP != nil { for _, transport := range copyConf.HTTP.ServersTransports { transport.Certificates = tls.Certificates{} - transport.RootCAs = []tls.FileOrContent{} + transport.RootCAs = []types.FileOrContent{} } } @@ -213,7 +214,7 @@ func logConfiguration(logger zerolog.Logger, configMsg dynamic.Message) { for _, transport := range copyConf.TCP.ServersTransports { if transport.TLS != nil { transport.TLS.Certificates = tls.Certificates{} - transport.TLS.RootCAs = []tls.FileOrContent{} + transport.TLS.RootCAs = []types.FileOrContent{} } } } diff --git a/pkg/server/middleware/middlewares.go b/pkg/server/middleware/middlewares.go index fe2fd23a9..72da39663 100644 --- a/pkg/server/middleware/middlewares.go +++ b/pkg/server/middleware/middlewares.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/containous/alice" + "github.com/rs/zerolog/log" "github.com/traefik/traefik/v3/pkg/config/runtime" "github.com/traefik/traefik/v3/pkg/middlewares/addprefix" "github.com/traefik/traefik/v3/pkg/middlewares/auth" @@ -22,6 +23,7 @@ import ( "github.com/traefik/traefik/v3/pkg/middlewares/headers" "github.com/traefik/traefik/v3/pkg/middlewares/inflightreq" "github.com/traefik/traefik/v3/pkg/middlewares/ipallowlist" + "github.com/traefik/traefik/v3/pkg/middlewares/ipwhitelist" "github.com/traefik/traefik/v3/pkg/middlewares/passtlsclientcert" "github.com/traefik/traefik/v3/pkg/middlewares/ratelimiter" "github.com/traefik/traefik/v3/pkg/middlewares/redirect" @@ -236,6 +238,18 @@ func (b *Builder) buildConstructor(ctx context.Context, middlewareName string) ( } } + // IPWhiteList + if config.IPWhiteList != nil { + log.Warn().Msg("IPWhiteList is deprecated, please use IPAllowList instead.") + + if middleware != nil { + return nil, badConf + } + middleware = func(next http.Handler) (http.Handler, error) { + return ipwhitelist.New(ctx, next, *config.IPWhiteList, middlewareName) + } + } + // IPAllowList if config.IPAllowList != nil { if middleware != nil { diff --git a/pkg/server/middleware/tcp/middlewares.go b/pkg/server/middleware/tcp/middlewares.go index e03a4fb84..0a5d30bc8 100644 --- a/pkg/server/middleware/tcp/middlewares.go +++ b/pkg/server/middleware/tcp/middlewares.go @@ -5,9 +5,11 @@ import ( "fmt" "strings" + "github.com/rs/zerolog/log" "github.com/traefik/traefik/v3/pkg/config/runtime" "github.com/traefik/traefik/v3/pkg/middlewares/tcp/inflightconn" "github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipallowlist" + "github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipwhitelist" "github.com/traefik/traefik/v3/pkg/server/provider" "github.com/traefik/traefik/v3/pkg/tcp" ) @@ -94,6 +96,15 @@ func (b *Builder) buildConstructor(ctx context.Context, middlewareName string) ( } } + // IPWhiteList + if config.IPWhiteList != nil { + log.Warn().Msg("IPWhiteList is deprecated, please use IPAllowList instead.") + + middleware = func(next tcp.Handler) (tcp.Handler, error) { + return ipwhitelist.New(ctx, next, *config.IPWhiteList, middlewareName) + } + } + // IPAllowList if config.IPAllowList != nil { middleware = func(next tcp.Handler) (tcp.Handler, error) { diff --git a/pkg/server/server_entrypoint_tcp_http3_test.go b/pkg/server/server_entrypoint_tcp_http3_test.go index 9b440be4b..66aa48ce4 100644 --- a/pkg/server/server_entrypoint_tcp_http3_test.go +++ b/pkg/server/server_entrypoint_tcp_http3_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/traefik/traefik/v3/pkg/config/static" tcprouter "github.com/traefik/traefik/v3/pkg/server/router/tcp" - traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) // LocalhostCert is a PEM-encoded TLS cert with SAN IPs @@ -20,7 +20,7 @@ import ( // generated from src/crypto/tls: // go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h var ( - localhostCert = traefiktls.FileOrContent(`-----BEGIN CERTIFICATE----- + localhostCert = types.FileOrContent(`-----BEGIN CERTIFICATE----- MIIDOTCCAiGgAwIBAgIQSRJrEpBGFc7tNb1fb5pKFzANBgkqhkiG9w0BAQsFADAS MRAwDgYDVQQKEwdBY21lIENvMCAXDTcwMDEwMTAwMDAwMFoYDzIwODQwMTI5MTYw MDAwWjASMRAwDgYDVQQKEwdBY21lIENvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A @@ -42,7 +42,7 @@ WkBKOclmOV2xlTVuPw== -----END CERTIFICATE-----`) // LocalhostKey is the private key for localhostCert. - localhostKey = traefiktls.FileOrContent(`-----BEGIN RSA PRIVATE KEY----- + localhostKey = types.FileOrContent(`-----BEGIN RSA PRIVATE KEY----- MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDoZtrm0dXV0Aqi 4Bpc7f95sNRTiu/AJSD8I1onY9PnEsPg3VVxvytsVJbYdcqr4w99V3AgpH/UNzMS gAZ/8lZBNbsSDOVesJ3euVqMRfYPvd9pYl6QPRRpSDPm+2tNdn3QFAvta9EgJ3sW diff --git a/pkg/server/service/roundtripper.go b/pkg/server/service/roundtripper.go index d7ab54c7a..7b7786a07 100644 --- a/pkg/server/service/roundtripper.go +++ b/pkg/server/service/roundtripper.go @@ -18,6 +18,7 @@ import ( "github.com/spiffe/go-spiffe/v2/svid/x509svid" "github.com/traefik/traefik/v3/pkg/config/dynamic" traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" "golang.org/x/net/http2" ) @@ -185,7 +186,7 @@ func (r *RoundTripperManager) createRoundTripper(cfg *dynamic.ServersTransport) return newSmartRoundTripper(transport, cfg.ForwardingTimeouts) } -func createRootCACertPool(rootCAs []traefiktls.FileOrContent) *x509.CertPool { +func createRootCACertPool(rootCAs []types.FileOrContent) *x509.CertPool { if len(rootCAs) == 0 { return nil } diff --git a/pkg/server/service/roundtripper_test.go b/pkg/server/service/roundtripper_test.go index c9af07a17..2d7763888 100644 --- a/pkg/server/service/roundtripper_test.go +++ b/pkg/server/service/roundtripper_test.go @@ -23,6 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/traefik/traefik/v3/pkg/config/dynamic" traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) func Int32(i int32) *int32 { @@ -144,7 +145,7 @@ func TestKeepConnectionWhenSameConfiguration(t *testing.T) { dynamicConf := map[string]*dynamic.ServersTransport{ "test": { ServerName: "example.com", - RootCAs: []traefiktls.FileOrContent{traefiktls.FileOrContent(LocalhostCert)}, + RootCAs: []types.FileOrContent{types.FileOrContent(LocalhostCert)}, }, } @@ -167,7 +168,7 @@ func TestKeepConnectionWhenSameConfiguration(t *testing.T) { dynamicConf = map[string]*dynamic.ServersTransport{ "test": { ServerName: "www.example.com", - RootCAs: []traefiktls.FileOrContent{traefiktls.FileOrContent(LocalhostCert)}, + RootCAs: []types.FileOrContent{types.FileOrContent(LocalhostCert)}, }, } @@ -213,13 +214,13 @@ func TestMTLS(t *testing.T) { "test": { ServerName: "example.com", // For TLS - RootCAs: []traefiktls.FileOrContent{traefiktls.FileOrContent(LocalhostCert)}, + RootCAs: []types.FileOrContent{types.FileOrContent(LocalhostCert)}, // For mTLS Certificates: traefiktls.Certificates{ traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent(mTLSCert), - KeyFile: traefiktls.FileOrContent(mTLSKey), + CertFile: types.FileOrContent(mTLSCert), + KeyFile: types.FileOrContent(mTLSKey), }, }, }, diff --git a/pkg/tcp/dialer.go b/pkg/tcp/dialer.go index 267d1b05b..ca08f7d2e 100644 --- a/pkg/tcp/dialer.go +++ b/pkg/tcp/dialer.go @@ -16,6 +16,7 @@ import ( "github.com/spiffe/go-spiffe/v2/svid/x509svid" "github.com/traefik/traefik/v3/pkg/config/dynamic" traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" "golang.org/x/net/proxy" ) @@ -156,7 +157,7 @@ func (d *DialerManager) createDialers(name string, cfg *dynamic.TCPServersTransp return nil } -func createRootCACertPool(rootCAs []traefiktls.FileOrContent) *x509.CertPool { +func createRootCACertPool(rootCAs []types.FileOrContent) *x509.CertPool { if len(rootCAs) == 0 { return nil } diff --git a/pkg/tcp/dialer_test.go b/pkg/tcp/dialer_test.go index 603f012b5..2dad7bf38 100644 --- a/pkg/tcp/dialer_test.go +++ b/pkg/tcp/dialer_test.go @@ -22,6 +22,7 @@ import ( "github.com/stretchr/testify/require" "github.com/traefik/traefik/v3/pkg/config/dynamic" traefiktls "github.com/traefik/traefik/v3/pkg/tls" + "github.com/traefik/traefik/v3/pkg/types" ) // LocalhostCert is a PEM-encoded TLS cert @@ -196,7 +197,7 @@ func TestTLS(t *testing.T) { "test": { TLS: &dynamic.TLSClientConfig{ ServerName: "example.com", - RootCAs: []traefiktls.FileOrContent{traefiktls.FileOrContent(LocalhostCert)}, + RootCAs: []types.FileOrContent{types.FileOrContent(LocalhostCert)}, }, }, } @@ -246,7 +247,7 @@ func TestTLSWithInsecureSkipVerify(t *testing.T) { "test": { TLS: &dynamic.TLSClientConfig{ ServerName: "bad-domain.com", - RootCAs: []traefiktls.FileOrContent{traefiktls.FileOrContent(LocalhostCert)}, + RootCAs: []types.FileOrContent{types.FileOrContent(LocalhostCert)}, InsecureSkipVerify: true, }, }, @@ -308,13 +309,13 @@ func TestMTLS(t *testing.T) { TLS: &dynamic.TLSClientConfig{ ServerName: "example.com", // For TLS - RootCAs: []traefiktls.FileOrContent{traefiktls.FileOrContent(LocalhostCert)}, + RootCAs: []types.FileOrContent{types.FileOrContent(LocalhostCert)}, // For mTLS Certificates: traefiktls.Certificates{ traefiktls.Certificate{ - CertFile: traefiktls.FileOrContent(mTLSCert), - KeyFile: traefiktls.FileOrContent(mTLSKey), + CertFile: types.FileOrContent(mTLSCert), + KeyFile: types.FileOrContent(mTLSKey), }, }, }, diff --git a/pkg/tls/certificate.go b/pkg/tls/certificate.go index be8cbc388..a8eab90d0 100644 --- a/pkg/tls/certificate.go +++ b/pkg/tls/certificate.go @@ -6,10 +6,9 @@ import ( "errors" "fmt" "net/url" - "os" "strings" - "github.com/rs/zerolog/log" + "github.com/traefik/traefik/v3/pkg/types" ) var ( @@ -56,8 +55,8 @@ type OCSPConfig struct { // Certificate holds a SSL cert/key pair // CertificateCollection and Key could be either a file path, or the file content itself. type Certificate struct { - CertFile FileOrContent `json:"certFile,omitempty" toml:"certFile,omitempty" yaml:"certFile,omitempty"` - KeyFile FileOrContent `json:"keyFile,omitempty" toml:"keyFile,omitempty" yaml:"keyFile,omitempty" loggable:"false"` + CertFile types.FileOrContent `json:"certFile,omitempty" toml:"certFile,omitempty" yaml:"certFile,omitempty"` + KeyFile types.FileOrContent `json:"keyFile,omitempty" toml:"keyFile,omitempty" yaml:"keyFile,omitempty" loggable:"false"` OCSP OCSPConfig `json:"ocsp,omitempty" toml:"ocsp,omitempty" yaml:"ocsp,omitempty" label:"allowEmpty" file:"allowEmpty"` SANs []string `json:"-" toml:"-" yaml:"-"` } @@ -83,33 +82,6 @@ func (c Certificates) GetCertificates() []tls.Certificate { return certs } -// FileOrContent hold a file path or content. -type FileOrContent string - -func (f FileOrContent) String() string { - return string(f) -} - -// IsPath returns true if the FileOrContent is a file path, otherwise returns false. -func (f FileOrContent) IsPath() bool { - _, err := os.Stat(f.String()) - return err == nil -} - -func (f FileOrContent) Read() ([]byte, error) { - var content []byte - if f.IsPath() { - var err error - content, err = os.ReadFile(f.String()) - if err != nil { - return nil, err - } - } else { - content = []byte(f) - } - return content, nil -} - // GetCertificate returns a tls.Certificate matching the configured CertFile and KeyFile. func (c *Certificate) GetCertificate() (tls.Certificate, error) { certContent, err := c.CertFile.Read() diff --git a/pkg/tls/certificate_data.go b/pkg/tls/certificate_data.go index 467c8aa8d..66a21ed27 100644 --- a/pkg/tls/certificate_data.go +++ b/pkg/tls/certificate_data.go @@ -11,9 +11,9 @@ import ( "sort" "strings" "time" - "github.com/rs/zerolog/log" "golang.org/x/crypto/ocsp" + "github.com/traefik/traefik/v3/pkg/types" ) // CertificateData holds runtime data for runtime TLS certificate handling. @@ -196,8 +196,8 @@ func (c *CertificateCollection) Set(value string) error { } *c = append(*c, CertificateData{ config: &Certificate{ - CertFile: FileOrContent(files[0]), - KeyFile: FileOrContent(files[1]), + CertFile: types.FileOrContent(files[0]), + KeyFile: types.FileOrContent(files[1]), OCSP: OCSPConfig{ DisableStapling: false, }, diff --git a/pkg/tls/tls.go b/pkg/tls/tls.go index 93a9cab36..fa12cbc85 100644 --- a/pkg/tls/tls.go +++ b/pkg/tls/tls.go @@ -8,7 +8,7 @@ const certificateHeader = "-----BEGIN CERTIFICATE-----\n" // ClientAuth defines the parameters of the client authentication part of the TLS connection, if any. type ClientAuth struct { - CAFiles []FileOrContent `json:"caFiles,omitempty" toml:"caFiles,omitempty" yaml:"caFiles,omitempty"` + CAFiles []types.FileOrContent `json:"caFiles,omitempty" toml:"caFiles,omitempty" yaml:"caFiles,omitempty"` // ClientAuthType defines the client authentication type to apply. // The available values are: "NoClientCert", "RequestClientCert", "VerifyClientCertIfGiven" and "RequireAndVerifyClientCert". ClientAuthType string `json:"clientAuthType,omitempty" toml:"clientAuthType,omitempty" yaml:"clientAuthType,omitempty" export:"true"` diff --git a/pkg/tls/tlsmanager_test.go b/pkg/tls/tlsmanager_test.go index 64079c99c..56c92b401 100644 --- a/pkg/tls/tlsmanager_test.go +++ b/pkg/tls/tlsmanager_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/traefik/traefik/v3/pkg/types" ) // LocalhostCert is a PEM-encoded TLS cert with SAN IPs @@ -16,7 +17,7 @@ import ( // generated from src/crypto/tls: // go run generate_cert.go --rsa-bits 1024 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h var ( - localhostCert = FileOrContent(`-----BEGIN CERTIFICATE----- + localhostCert = types.FileOrContent(`-----BEGIN CERTIFICATE----- MIIDOTCCAiGgAwIBAgIQSRJrEpBGFc7tNb1fb5pKFzANBgkqhkiG9w0BAQsFADAS MRAwDgYDVQQKEwdBY21lIENvMCAXDTcwMDEwMTAwMDAwMFoYDzIwODQwMTI5MTYw MDAwWjASMRAwDgYDVQQKEwdBY21lIENvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A @@ -38,7 +39,7 @@ WkBKOclmOV2xlTVuPw== -----END CERTIFICATE-----`) // LocalhostKey is the private key for localhostCert. - localhostKey = FileOrContent(`-----BEGIN RSA PRIVATE KEY----- + localhostKey = types.FileOrContent(`-----BEGIN RSA PRIVATE KEY----- MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDoZtrm0dXV0Aqi 4Bpc7f95sNRTiu/AJSD8I1onY9PnEsPg3VVxvytsVJbYdcqr4w99V3AgpH/UNzMS gAZ/8lZBNbsSDOVesJ3euVqMRfYPvd9pYl6QPRRpSDPm+2tNdn3QFAvta9EgJ3sW @@ -197,7 +198,7 @@ func TestClientAuth(t *testing.T) { }, "vccig": { ClientAuth: ClientAuth{ - CAFiles: []FileOrContent{localhostCert}, + CAFiles: []types.FileOrContent{localhostCert}, ClientAuthType: "VerifyClientCertIfGiven", }, }, @@ -209,13 +210,13 @@ func TestClientAuth(t *testing.T) { }, "ravccwca": { ClientAuth: ClientAuth{ - CAFiles: []FileOrContent{localhostCert}, + CAFiles: []types.FileOrContent{localhostCert}, ClientAuthType: "RequireAndVerifyClientCert", }, }, "ravccwbca": { ClientAuth: ClientAuth{ - CAFiles: []FileOrContent{"Bad content"}, + CAFiles: []types.FileOrContent{"Bad content"}, ClientAuthType: "RequireAndVerifyClientCert", }, }, diff --git a/pkg/tls/zz_generated.deepcopy.go b/pkg/tls/zz_generated.deepcopy.go index d4da72a31..5ea3d0b7b 100644 --- a/pkg/tls/zz_generated.deepcopy.go +++ b/pkg/tls/zz_generated.deepcopy.go @@ -82,7 +82,7 @@ func (in *ClientAuth) DeepCopyInto(out *ClientAuth) { *out = *in if in.CAFiles != nil { in, out := &in.CAFiles, &out.CAFiles - *out = make([]FileOrContent, len(*in)) + *out = make([]types.FileOrContent, len(*in)) copy(*out, *in) } return diff --git a/pkg/types/file_or_content.go b/pkg/types/file_or_content.go new file mode 100644 index 000000000..7b1f679bc --- /dev/null +++ b/pkg/types/file_or_content.go @@ -0,0 +1,32 @@ +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 FileOrContent) IsPath() bool { + _, err := os.Stat(f.String()) + return err == nil +} + +// Read returns the content after reading the FileOrContent variable. +func (f FileOrContent) Read() ([]byte, error) { + var content []byte + if f.IsPath() { + var err error + content, err = os.ReadFile(f.String()) + if err != nil { + return nil, err + } + } else { + content = []byte(f) + } + return content, nil +} diff --git a/script/code-gen.sh b/script/code-gen.sh index 91507478f..0d1f309c2 100755 --- a/script/code-gen.sh +++ b/script/code-gen.sh @@ -5,7 +5,7 @@ set -e -o pipefail source /go/src/k8s.io/code-generator/kube_codegen.sh -git config --global --add safe.directory /go/src/${PROJECT_MODULE} +git config --global --add safe.directory "/go/src/${PROJECT_MODULE}" rm -rf "/go/src/${PROJECT_MODULE}/${MODULE_VERSION}" mkdir -p "/go/src/${PROJECT_MODULE}/${MODULE_VERSION}/" diff --git a/script/test-integration b/script/test-integration index 13a4ab342..a6afba7d1 100755 --- a/script/test-integration +++ b/script/test-integration @@ -3,18 +3,9 @@ set -e export DEST=. -TESTFLAGS+=("-test.timeout=20m" -check.v) - -if [ -n "${VERBOSE}" ]; then - TESTFLAGS+=(-v) -elif [ -n "${VERBOSE_INTEGRATION}" ]; then - TESTFLAGS+=(-v) -fi - -cd integration echo "Testing against..." docker version # shellcheck disable=SC2086 # shellcheck disable=SC2048 -CGO_ENABLED=0 go test -integration ${TESTFLAGS[*]} +go test ./integration -test.timeout=20m -failfast -v ${TESTFLAGS[*]} diff --git a/script/validate-lint b/script/validate-lint index 22d339634..937f7f13b 100755 --- a/script/validate-lint +++ b/script/validate-lint @@ -1,3 +1,3 @@ #!/usr/bin/env bash -golangci-lint run \ No newline at end of file +golangci-lint run