From e1f5f363b215eff335fb9d1c02fc24c644a59bac Mon Sep 17 00:00:00 2001 From: Dhia Ayachi Date: Wed, 28 Aug 2024 15:01:59 +0000 Subject: [PATCH] backport of commit 223002e6a5e6828b08131c9298bda4f76cdb7aab --- .changelog/172.txt | 3 - .changelog/521.txt | 3 - .changelog/533.txt | 3 - .changelog/540.txt | 3 + .changelog/565.txt | 3 - .changelog/571.txt | 9 - .changelog/{578.txt => 581.txt} | 2 +- .changelog/595.txt | 7 - .github/workflows/build.yml | 8 +- .github/workflows/jira-issues.yaml | 2 + .github/workflows/jira-pr.yaml | 2 + .github/workflows/security-scan.yml | 5 +- CHANGELOG.md | 105 +-------- Dockerfile | 4 +- Makefile | 1 - cmd/consul-dataplane/config.go | 3 - cmd/consul-dataplane/config_test.go | 10 - cmd/consul-dataplane/main.go | 24 +-- go.mod | 15 +- go.sum | 40 ++-- integration-tests/go.mod | 28 ++- integration-tests/go.sum | 101 +++++---- .../mocks/pbdnsmock/dns_service_client.go | 6 +- .../mocks/pbdnsmock/dns_service_server.go | 6 +- .../is_cloning_dns_service_client.go | 6 +- .../pbdnsmock/unsafe_dns_service_server.go | 2 +- .../is_cloning_resource_service_client.go | 6 +- .../pbresourcemock/is_watch_event__event.go | 29 --- .../resource_service__watch_list_client.go | 30 +-- .../resource_service__watch_list_server.go | 26 +-- .../pbresourcemock/resource_service_client.go | 34 +-- .../pbresourcemock/resource_service_server.go | 34 +-- .../mocks/pbresourcemock/server_stream.go | 30 +-- .../unsafe_resource_service_server.go | 2 +- pkg/consuldp/bootstrap.go | 64 +++--- pkg/consuldp/bootstrap_test.go | 170 +++++++++------ pkg/consuldp/config.go | 17 +- pkg/consuldp/consul_dataplane.go | 76 ++----- pkg/consuldp/consul_dataplane_test.go | 200 ++---------------- .../non-default_tenancy.golden | 166 --------------- pkg/consuldp/xds.go | 2 +- pkg/dns/dns.go | 30 --- pkg/dns/dns_test.go | 36 +--- pkg/version/version.go | 2 +- 44 files changed, 350 insertions(+), 1005 deletions(-) delete mode 100644 .changelog/172.txt delete mode 100644 .changelog/521.txt delete mode 100644 .changelog/533.txt create mode 100644 .changelog/540.txt delete mode 100644 .changelog/565.txt delete mode 100644 .changelog/571.txt rename .changelog/{578.txt => 581.txt} (57%) delete mode 100644 .changelog/595.txt delete mode 100644 internal/mocks/pbresourcemock/is_watch_event__event.go delete mode 100644 pkg/consuldp/testdata/TestBootstrapConfig/non-default_tenancy.golden diff --git a/.changelog/172.txt b/.changelog/172.txt deleted file mode 100644 index c4aaed59..00000000 --- a/.changelog/172.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:improvement -dns: queries proxied by consul-dataplane now assume the same namespace/partition/ACL token as the service registered to the dataplane instance. -``` \ No newline at end of file diff --git a/.changelog/521.txt b/.changelog/521.txt deleted file mode 100644 index 0e84b11e..00000000 --- a/.changelog/521.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:improvement -Upgrade to support Envoy `1.29.4`. -``` diff --git a/.changelog/533.txt b/.changelog/533.txt deleted file mode 100644 index cbf8814d..00000000 --- a/.changelog/533.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:improvement -Upgrade to support Envoy `1.29.5`. -``` \ No newline at end of file diff --git a/.changelog/540.txt b/.changelog/540.txt new file mode 100644 index 00000000..236ad5d6 --- /dev/null +++ b/.changelog/540.txt @@ -0,0 +1,3 @@ +```release-note:security +Upgrade to support Envoy `1.28.4`. +``` \ No newline at end of file diff --git a/.changelog/565.txt b/.changelog/565.txt deleted file mode 100644 index 48a1e3db..00000000 --- a/.changelog/565.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:feature -Removes the dependence on the v2 catalog and "resource-apis" experiment. -``` diff --git a/.changelog/571.txt b/.changelog/571.txt deleted file mode 100644 index 34ec25f5..00000000 --- a/.changelog/571.txt +++ /dev/null @@ -1,9 +0,0 @@ -```release-note:feature -Added the ability to set the `-mode` flag. Options available are `sidecar` and `dns-proxy`. The system defaults to `sidecar`. -When set to `sidecar`: -- DNS Server, xDS Server, and Envoy are enabled. -- The system validates that `-consul-dns-bind-addr` and equivalent environment variable must be set to the loopback address. -When set to `dns-proxy`: -- Only DNS Server is enabled. xDS Server and Envoy are disabled. -- `consul-dns-bind-addr` and equivalent environment variable can be set to other values besides the loopback address. -``` \ No newline at end of file diff --git a/.changelog/578.txt b/.changelog/581.txt similarity index 57% rename from .changelog/578.txt rename to .changelog/581.txt index df886c24..1089c4f5 100644 --- a/.changelog/578.txt +++ b/.changelog/581.txt @@ -1,3 +1,3 @@ ```release-note:security -Upgrade envoy version to 1.29.7 to address [CVE-2024-39305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-39305) +Upgrade envoy version to 1.28.5 to address [CVE-2024-39305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-39305) ``` \ No newline at end of file diff --git a/.changelog/595.txt b/.changelog/595.txt deleted file mode 100644 index 677ff862..00000000 --- a/.changelog/595.txt +++ /dev/null @@ -1,7 +0,0 @@ -```release-note:enhancement -Update `github.com/hashicorp/consul-server-connection-manager` to v0.1.9. -``` - -```release-note:enhancement -Update `github.com/hashicorp/go-hclog` to v1.5.0. -``` \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42b38b49..01240284 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -335,12 +335,12 @@ jobs: server: - version: v1.15.0-dev image: hashicorppreview/consul:1.15-dev + - version: v1.16.0-dev + image: hashicorppreview/consul:1.16-dev + - version: v1.17.0-dev + image: hashicorppreview/consul:1.17-dev - version: v1.18.0-dev image: hashicorppreview/consul:1.18-dev - - version: v1.19.0-dev - image: hashicorppreview/consul:1.19-dev - - version: v1.20.0-dev - image: hashicorppreview/consul:1.20-dev dataplane: - image_suffix: "" docker_target: "release-default" diff --git a/.github/workflows/jira-issues.yaml b/.github/workflows/jira-issues.yaml index 1047bb61..9bba702c 100644 --- a/.github/workflows/jira-issues.yaml +++ b/.github/workflows/jira-issues.yaml @@ -46,6 +46,8 @@ jobs: # customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve) extraFields: '{ "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}", "customfield_10371": { "value": "GitHub" }, + "customfield_10535": [{ "value": "Service Mesh" }], + "components": [{ "name": "${{ github.event.repository.name }}" }], "labels": ${{ steps.set-ticket-labels.outputs.LABELS }} }' env: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} diff --git a/.github/workflows/jira-pr.yaml b/.github/workflows/jira-pr.yaml index 4d9b7608..8af54cdc 100644 --- a/.github/workflows/jira-pr.yaml +++ b/.github/workflows/jira-pr.yaml @@ -59,6 +59,8 @@ jobs: # customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve) extraFields: '{ "customfield_10089": "${{ github.event.pull_request.html_url }}", "customfield_10371": { "value": "GitHub" }, + "customfield_10535": [{ "value": "Service Mesh" }], + "components": [{ "name": "${{ github.event.repository.name }}" }], "labels": ${{ steps.set-ticket-labels.outputs.LABELS }} }' env: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index bb1da12c..6bacdfd5 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -46,7 +46,8 @@ jobs: uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: repository: hashicorp/security-scanner - token: ${{ secrets.HASHIBOT_PRODSEC_GITHUB_TOKEN }} + #TODO: replace w/ HASHIBOT_PRODSEC_GITHUB_TOKEN once provisioned + token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} path: security-scanner ref: main @@ -65,4 +66,4 @@ jobs: - name: Upload SARIF file uses: github/codeql-action/upload-sarif@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1 with: - sarif_file: results.sarif + sarif_file: results.sarif \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e15868..22a0a7d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ -## 1.5.0 (June 12, 2024) +## 1.4.3 (July 15, 2024) + +SECURITY: + +* Upgrade envoy version to 1.28.5 to address [CVE-2024-39305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-39305) [[GH-581](https://github.com/hashicorp/consul-dataplane/pull/581)] +* Upgrade go version to address [CVE-2024-24791](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24791) [[GH-573](https://github.com/hashicorp/consul-dataplane/pull/573)] +* Upgrade to support Envoy `1.28.4`. [[GH-540](https://github.com/hashicorp/consul-dataplane/pull/540)] IMPROVEMENTS: * Upgrade Go to use 1.22.4. [[GH-529](https://github.com/hashicorp/consul-dataplane/pull/529)] -* Upgrade to support Envoy `1.29.5`. [[GH-533](https://github.com/hashicorp/consul-dataplane/pull/533)] -* dns: queries proxied by consul-dataplane now assume the same namespace/partition/ACL token as the service registered to the dataplane instance. [[GH-172](https://github.com/hashicorp/consul-dataplane/pull/172)] ## 1.4.2 (May 21, 2024) @@ -26,63 +30,6 @@ IMPROVEMENTS: * Upgrade Go to use 1.22.3. [[GH-501](https://github.com/hashicorp/consul-dataplane/pull/501)] -## 1.3.5 (May 24, 2024) -SECURITY: - -* Upgrade Go to use 1.21.10. This addresses CVEs -[CVE-2024-24787](https://nvd.nist.gov/vuln/detail/CVE-2024-24787) and -[CVE-2024-24788](https://nvd.nist.gov/vuln/detail/CVE-2024-24788) [[GH-487](https://github.com/hashicorp/consul-dataplane/pull/487)] -* Upgrade to support Envoy `1.27.4`. This resolves CVE -[CVE-2024-27919](https://nvd.nist.gov/vuln/detail/CVE-2024-27919) (`http2`). [[GH-477](https://github.com/hashicorp/consul-dataplane/pull/477)] -* Upgrade to support Envoy `1.27.5`. This resolves CVE -[CVE-2024-32475](https://nvd.nist.gov/vuln/detail/CVE-2024-32475). [[GH-497](https://github.com/hashicorp/consul-dataplane/pull/497)] -* Upgrade to use Go `1.21.9`. This resolves CVE -[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`http2`). [[GH-477](https://github.com/hashicorp/consul-dataplane/pull/477)] -* Upgrade to use golang.org/x/net `v0.24.0`. This resolves CVE -[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`x/net`). [[GH-477](https://github.com/hashicorp/consul-dataplane/pull/477)] - -IMPROVEMENTS: - -* Upgrade Go to use 1.22.3. [[GH-501](https://github.com/hashicorp/consul-dataplane/pull/501)] - -## 1.2.8 (May 24, 2024) -SECURITY: - -* Upgrade Go to use 1.21.10. This addresses CVEs -[CVE-2024-24787](https://nvd.nist.gov/vuln/detail/CVE-2024-24787) and -[CVE-2024-24788](https://nvd.nist.gov/vuln/detail/CVE-2024-24788) [[GH-487](https://github.com/hashicorp/consul-dataplane/pull/487)] -* Upgrade to support Envoy `1.26.8`. This resolves CVE -[CVE-2024-27919](https://nvd.nist.gov/vuln/detail/CVE-2024-27919) (`http2`). [[GH-476](https://github.com/hashicorp/consul-dataplane/pull/476)] -* Upgrade to support Envoy `1.27.5`. This resolves CVE -[CVE-2024-32475](https://nvd.nist.gov/vuln/detail/CVE-2024-32475). [[GH-498](https://github.com/hashicorp/consul-dataplane/pull/498)] -* Upgrade to use Go `1.21.9`. This resolves CVE -[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`http2`). [[GH-476](https://github.com/hashicorp/consul-dataplane/pull/476)] -* Upgrade to use golang.org/x/net `v0.24.0`. This resolves CVE -[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`x/net`). [[GH-476](https://github.com/hashicorp/consul-dataplane/pull/476)] - -IMPROVEMENTS: - -* Upgrade Go to use 1.22.3. [[GH-501](https://github.com/hashicorp/consul-dataplane/pull/501)] - -## 1.1.11 (May 20, 2024) -SECURITY: - -* Upgrade Go to use 1.21.10. This addresses CVEs -[CVE-2024-24787](https://nvd.nist.gov/vuln/detail/CVE-2024-24787) and -[CVE-2024-24788](https://nvd.nist.gov/vuln/detail/CVE-2024-24788) [[GH-487](https://github.com/hashicorp/consul-dataplane/pull/487)] -* Upgrade to support Envoy `1.26.8`. This resolves CVE -[CVE-2024-27919](https://nvd.nist.gov/vuln/detail/CVE-2024-27919) (`http2`). [[GH-475](https://github.com/hashicorp/consul-dataplane/pull/475)] -* Upgrade to support Envoy `1.27.5`. This resolves CVE -[CVE-2024-32475](https://nvd.nist.gov/vuln/detail/CVE-2024-32475). [[GH-499](https://github.com/hashicorp/consul-dataplane/pull/499)] -* Upgrade to use Go `1.21.9`. This resolves CVE -[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`http2`). [[GH-475](https://github.com/hashicorp/consul-dataplane/pull/475)] -* Upgrade to use golang.org/x/net `v0.24.0`. This resolves CVE -[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`x/net`). [[GH-475](https://github.com/hashicorp/consul-dataplane/pull/475)] - -IMPROVEMENTS: - -* Upgrade Go to use 1.22.3. [[GH-501](https://github.com/hashicorp/consul-dataplane/pull/501)] - ## 1.4.1 (March 28, 2024) SECURITY: @@ -95,44 +42,6 @@ SECURITY: [CVE-2024-24785](https://nvd.nist.gov/vuln/detail/CVE-2024-24785) (`html/template`). [CVE-2024-24784](https://nvd.nist.gov/vuln/detail/CVE-2024-24784) (`net/mail`). [[GH-465](https://github.com/hashicorp/consul-dataplane/pull/465)] -## 1.3.4 (March 28, 2024) - -SECURITY: - -* Update `google.golang.org/protobuf` to v1.33.0 to address [CVE-2024-24786](https://nvd.nist.gov/vuln/detail/CVE-2024-24786). [[GH-460](https://github.com/hashicorp/consul-dataplane/pull/460)] -* Upgrade `consul-dataplane-fips` OpenShift container image to use `ubi9-minimal:9.3` as the base image. [[GH-434](https://github.com/hashicorp/consul-dataplane/pull/434)] -* Upgrade to use Go `1.21.8`. This resolves CVEs - [CVE-2024-24783](https://nvd.nist.gov/vuln/detail/CVE-2024-24783) (`crypto/x509`). - [CVE-2023-45290](https://nvd.nist.gov/vuln/detail/CVE-2023-45290) (`net/http`). - [CVE-2023-45289](https://nvd.nist.gov/vuln/detail/CVE-2023-45289) (`net/http`, `net/http/cookiejar`). - [CVE-2024-24785](https://nvd.nist.gov/vuln/detail/CVE-2024-24785) (`html/template`). - [CVE-2024-24784](https://nvd.nist.gov/vuln/detail/CVE-2024-24784) (`net/mail`). [[GH-465](https://github.com/hashicorp/consul-dataplane/pull/465)] - -## 1.2.7 (March 28, 2024) - -SECURITY: - -* Update `google.golang.org/protobuf` to v1.33.0 to address [CVE-2024-24786](https://nvd.nist.gov/vuln/detail/CVE-2024-24786). [[GH-460](https://github.com/hashicorp/consul-dataplane/pull/460)] -* Upgrade `consul-dataplane-fips` OpenShift container image to use `ubi9-minimal:9.3` as the base image. [[GH-434](https://github.com/hashicorp/consul-dataplane/pull/434)] -* Upgrade to use Go `1.21.8`. This resolves CVEs - [CVE-2024-24783](https://nvd.nist.gov/vuln/detail/CVE-2024-24783) (`crypto/x509`). - [CVE-2023-45290](https://nvd.nist.gov/vuln/detail/CVE-2023-45290) (`net/http`). - [CVE-2023-45289](https://nvd.nist.gov/vuln/detail/CVE-2023-45289) (`net/http`, `net/http/cookiejar`). - [CVE-2024-24785](https://nvd.nist.gov/vuln/detail/CVE-2024-24785) (`html/template`). - [CVE-2024-24784](https://nvd.nist.gov/vuln/detail/CVE-2024-24784) (`net/mail`). [[GH-465](https://github.com/hashicorp/consul-dataplane/pull/465)] - -## 1.1.10 (March 28, 2024) - -SECURITY: - -* Update `google.golang.org/protobuf` to v1.33.0 to address [CVE-2024-24786](https://nvd.nist.gov/vuln/detail/CVE-2024-24786). [[GH-460](https://github.com/hashicorp/consul-dataplane/pull/460)] -* Upgrade to use Go `1.21.8`. This resolves CVEs -[CVE-2024-24783](https://nvd.nist.gov/vuln/detail/CVE-2024-24783) (`crypto/x509`). -[CVE-2023-45290](https://nvd.nist.gov/vuln/detail/CVE-2023-45290) (`net/http`). -[CVE-2023-45289](https://nvd.nist.gov/vuln/detail/CVE-2023-45289) (`net/http`, `net/http/cookiejar`). -[CVE-2024-24785](https://nvd.nist.gov/vuln/detail/CVE-2024-24785) (`html/template`). -[CVE-2024-24784](https://nvd.nist.gov/vuln/detail/CVE-2024-24784) (`net/mail`). [[GH-465](https://github.com/hashicorp/consul-dataplane/pull/465)] - ## 1.4.0 (February 28, 2024) SECURITY: diff --git a/Dockerfile b/Dockerfile index c548f2e9..c34f2517 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ # prebuilt binaries in any other form. # ARG GOLANG_VERSION -FROM envoyproxy/envoy-distroless:v1.29.7 as envoy-binary +FROM envoyproxy/envoy-distroless:v1.28.5 as envoy-binary # Modify the envoy binary to be able to bind to privileged ports (< 1024). FROM debian:bullseye-slim AS setcap-envoy-binary @@ -27,7 +27,7 @@ RUN apt-get update && apt install -y libcap2-bin RUN setcap CAP_NET_BIND_SERVICE=+ep /usr/local/bin/envoy RUN setcap CAP_NET_BIND_SERVICE=+ep /usr/local/bin/$BIN_NAME -FROM hashicorp/envoy-fips:1.29.7-fips1402 as envoy-fips-binary +FROM hashicorp/envoy-fips:1.28.5-fips1402 as envoy-fips-binary # Modify the envoy-fips binary to be able to bind to privileged ports (< 1024). FROM debian:bullseye-slim AS setcap-envoy-fips-binary diff --git a/Makefile b/Makefile index 0bb2e2bc..ada7c187 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,6 @@ docker-run: docker ## run the image of $(TAG) .PHONY: dev-docker dev-docker: docker ## build docker image and tag the image to local - echo '$(ARCH)' docker tag '$(PRODUCT_NAME):$(VERSION)' '$(PRODUCT_NAME):local' ##@ Testing diff --git a/cmd/consul-dataplane/config.go b/cmd/consul-dataplane/config.go index 3db53e3c..1823ddd4 100644 --- a/cmd/consul-dataplane/config.go +++ b/cmd/consul-dataplane/config.go @@ -21,7 +21,6 @@ type FlagOpts struct { } type DataplaneConfigFlags struct { - Mode *string `json:"mode,omitempty"` Consul ConsulFlags `json:"consul,omitempty"` Service ServiceFlags `json:"service,omitempty"` Proxy ProxyFlags `json:"proxy,omitempty"` @@ -210,7 +209,6 @@ func (f *FlagOpts) buildConfigFromFile() (DataplaneConfigFlags, error) { func buildDefaultConsulDPFlags() (DataplaneConfigFlags, error) { data := ` { - "mode": "sidecar", "consul": { "grpcPort": 8502, "serverWatchDisabled": false, @@ -318,7 +316,6 @@ func constructRuntimeConfig(cfg DataplaneConfigFlags, extraArgs []string) (*cons InsecureSkipVerify: boolVal(cfg.Consul.TLS.InsecureSkipVerify), }, }, - Mode: consuldp.ModeType(stringVal(cfg.Mode)), Proxy: &proxyCfg, Logging: &consuldp.LoggingConfig{ Name: DefaultLogName, diff --git a/cmd/consul-dataplane/config_test.go b/cmd/consul-dataplane/config_test.go index 01553f67..25859065 100644 --- a/cmd/consul-dataplane/config_test.go +++ b/cmd/consul-dataplane/config_test.go @@ -33,7 +33,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeSidecar, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), @@ -112,7 +111,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeSidecar, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), @@ -191,7 +189,6 @@ func TestConfigGeneration(t *testing.T) { if err != nil { return nil, err } - opts.dataplaneConfig.Mode = strReference("dns-proxy") opts.dataplaneConfig.Consul.Credentials.Login.BearerTokenPath = strReference("/consul/bearertokenpath/") opts.dataplaneConfig.Consul.Credentials.Login.Datacenter = strReference("dc100") opts.dataplaneConfig.Consul.Credentials.Login.Meta = map[string]string{ @@ -209,7 +206,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeDNSProxy, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), @@ -314,7 +310,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeSidecar, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), @@ -413,7 +408,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeSidecar, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), @@ -527,7 +521,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeSidecar, Consul: &consuldp.ConsulConfig{ Addresses: "consul_server.dc1", GRPCPort: 8502, @@ -634,7 +627,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeSidecar, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), @@ -714,7 +706,6 @@ func TestConfigGeneration(t *testing.T) { desc: "test whether CLI flag values override the file values with proxy flags", flagOpts: func() (*FlagOpts, error) { opts, err := generateFlagOptsWithProxyFlags() - opts.dataplaneConfig.Mode = strReference("dns-proxy") if err != nil { return nil, err } @@ -763,7 +754,6 @@ func TestConfigGeneration(t *testing.T) { }, makeExpectedCfg: func(flagOpts *FlagOpts) *consuldp.Config { return &consuldp.Config{ - Mode: consuldp.ModeTypeDNSProxy, Consul: &consuldp.ConsulConfig{ Addresses: stringVal(flagOpts.dataplaneConfig.Consul.Addresses), GRPCPort: intVal(flagOpts.dataplaneConfig.Consul.GRPCPort), diff --git a/cmd/consul-dataplane/main.go b/cmd/consul-dataplane/main.go index 9afac615..ca74a195 100644 --- a/cmd/consul-dataplane/main.go +++ b/cmd/consul-dataplane/main.go @@ -27,10 +27,6 @@ func init() { flagOpts = &FlagOpts{} flags.BoolVar(&flagOpts.printVersion, "version", false, "Prints the current version of consul-dataplane.") - StringVar(flags, &flagOpts.dataplaneConfig.Mode, "mode", "DP_MODE", "dataplane mode. Value can be:\n"+ - "1. sidecar - used when running as a sidecar to Consul services with xDS Server, Envoy, and DNS Server running; OR\n"+ - "2. dns-proxy - used when running as a standalone application where DNS Server runs, but Envoy and xDS Server are enabled.\n") - StringVar(flags, &flagOpts.dataplaneConfig.Consul.Addresses, "addresses", "DP_CONSUL_ADDRESSES", "Consul server gRPC addresses. Value can be:\n"+ "1. A DNS name that resolves to server addresses or the DNS name of a load balancer in front of the Consul servers; OR\n"+ "2. An executable command in the format, 'exec='. The executable\n"+ @@ -61,17 +57,21 @@ func init() { "[Deprecated; use -proxy-partition instead] The Consul Enterprise partition in which the proxy service instance is registered.") StringVar(flags, &flagOpts.dataplaneConfig.Proxy.NodeName, "proxy-node-name", "DP_PROXY_NODE_NAME", - "The name of the Consul node to which the proxy service instance is registered.") + "The name of the Consul node to which the proxy service instance is registered."+ + "In Consul's V2 Catalog API, this value is ignored.") StringVar(flags, &flagOpts.dataplaneConfig.Proxy.NodeID, "proxy-node-id", "DP_PROXY_NODE_ID", - "The ID of the Consul node to which the proxy service instance is registered.") + "The ID of the Consul node to which the proxy service instance is registered."+ + "In Consul's V2 Catalog API, this value is ignored.") StringVar(flags, &flagOpts.dataplaneConfig.Proxy.ID, "proxy-id", "DP_PROXY_ID", - "In Consul's V1 Catalog API, the proxy service instance's ID.") + "In Consul's V1 Catalog API, the proxy service instance's ID."+ + "In Consul's V2 Catalog API, the workload ID associated with the proxy.") StringVar(flags, &flagOpts.dataplaneConfig.Proxy.IDPath, "proxy-id-path", "DP_PROXY_ID_PATH", - "In Consul's V1 Catalog API, the path to a file containing the proxy service instance's ID.") + "In Consul's V1 Catalog API, the path to a file containing the proxy service instance's ID."+ + "In Consul's V2 Catalog API, the path to a file containing the workload ID associated with the proxy.") StringVar(flags, &flagOpts.dataplaneConfig.Proxy.Namespace, "proxy-namespace", "DP_PROXY_NAMESPACE", - "The Consul Enterprise namespace in which the proxy service instance is registered.") + "The Consul Enterprise namespace in which the proxy service instance (V1 API) or workload (V2 API) is registered.") StringVar(flags, &flagOpts.dataplaneConfig.Proxy.Partition, "proxy-partition", "DP_PROXY_PARTITION", - "The Consul Enterprise partition in which the proxy service instance is registered.") + "The Consul Enterprise partition in which the proxy service instance (V1 API) or workload (V2 API) is registered.") StringVar(flags, &flagOpts.dataplaneConfig.Consul.Credentials.Type, "credential-type", "DP_CREDENTIAL_TYPE", "The type of credentials, either static or login, used to authenticate with Consul servers.") StringVar(flags, &flagOpts.dataplaneConfig.Consul.Credentials.Static.Token, "static-token", "DP_CREDENTIAL_STATIC_TOKEN", "The ACL token used to authenticate requests to Consul servers when -credential-type is set to static.") @@ -111,8 +111,8 @@ func init() { StringVar(flags, &flagOpts.dataplaneConfig.Consul.TLS.ServerName, "tls-server-name", "DP_TLS_SERVER_NAME", "The hostname to expect in the server certificate's subject. This is required if -addresses is not a DNS name.") BoolVar(flags, &flagOpts.dataplaneConfig.Consul.TLS.InsecureSkipVerify, "tls-insecure-skip-verify", "DP_TLS_INSECURE_SKIP_VERIFY", "Do not verify the server's certificate. Useful for testing, but not recommended for production.") - StringVar(flags, &flagOpts.dataplaneConfig.DNSServer.BindAddr, "consul-dns-bind-addr", "DP_CONSUL_DNS_BIND_ADDR", "The address that will be bound to the consul dns listener.") - IntVar(flags, &flagOpts.dataplaneConfig.DNSServer.BindPort, "consul-dns-bind-port", "DP_CONSUL_DNS_BIND_PORT", "The port the consul dns listener will listen on. By default -1 disables the dns listener.") + StringVar(flags, &flagOpts.dataplaneConfig.DNSServer.BindAddr, "consul-dns-bind-addr", "DP_CONSUL_DNS_BIND_ADDR", "The address that will be bound to the consul dns proxy.") + IntVar(flags, &flagOpts.dataplaneConfig.DNSServer.BindPort, "consul-dns-bind-port", "DP_CONSUL_DNS_BIND_PORT", "The port the consul dns proxy will listen on. By default -1 disables the dns proxy") // Default is false because it will generally be configured appropriately by Helm // configuration or pod annotation. diff --git a/go.mod b/go.mod index c2e3bdea..c1902546 100644 --- a/go.mod +++ b/go.mod @@ -6,14 +6,14 @@ require ( dario.cat/mergo v1.0.0 github.com/armon/go-metrics v0.4.1 github.com/hashi-derek/grpc-proxy v0.0.0-20231207191910-191266484d75 - github.com/hashicorp/consul-server-connection-manager v0.1.9 + github.com/hashicorp/consul-server-connection-manager v0.1.6 github.com/hashicorp/consul/proto-public v0.6.2 - github.com/hashicorp/go-hclog v1.5.0 + github.com/hashicorp/go-hclog v1.2.2 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-rootcerts v1.0.2 github.com/mitchellh/mapstructure v1.5.0 github.com/prometheus/client_golang v1.13.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.8.4 google.golang.org/grpc v1.56.3 google.golang.org/protobuf v1.33.0 ) @@ -24,21 +24,22 @@ require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fatih/color v1.16.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-immutable-radix v1.0.0 // indirect github.com/hashicorp/go-netaddrs v0.1.0 // indirect + github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.1 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect - github.com/stretchr/objx v0.5.2 // indirect + github.com/stretchr/objx v0.5.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.3.0 // indirect diff --git a/go.sum b/go.sum index e5f4e6ec..2893bab1 100644 --- a/go.sum +++ b/go.sum @@ -72,9 +72,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= 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= @@ -146,17 +145,19 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashi-derek/grpc-proxy v0.0.0-20231207191910-191266484d75 h1:V5Uqf7VoWMd6UhNf/5EMA8LMPUm95GYvk2YF5SzT24o= github.com/hashi-derek/grpc-proxy v0.0.0-20231207191910-191266484d75/go.mod h1:5eEnHfK72jOkp4gC1dI/Q/E9MFNOM/ewE/vql5ijV3g= -github.com/hashicorp/consul-server-connection-manager v0.1.9 h1:jHO10v0Hk/WE05qz1gnUDd9WPQEFf5e2bP1Gs+s56rA= -github.com/hashicorp/consul-server-connection-manager v0.1.9/go.mod h1:rsVRioiTxfyh4yXcEnm1Lb9RrzJl0Lz08+nLgdlZR2I= +github.com/hashicorp/consul-server-connection-manager v0.1.6 h1:ktj8Fi+dRXn9hhM+FXsfEJayhzzgTqfH08Ne5M6Fmug= +github.com/hashicorp/consul-server-connection-manager v0.1.6/go.mod h1:HngMIv57MT+pqCVeRQMa1eTB5dqnyMm8uxjyv+Hn8cs= +github.com/hashicorp/consul/proto-public v0.6.1 h1:+uzH3olCrksXYWAYHKqK782CtK9scfqH+Unlw3UHhCg= +github.com/hashicorp/consul/proto-public v0.6.1/go.mod h1:cXXbOg74KBNGajC+o8RlA502Esf0R9prcoJgiOX/2Tg= github.com/hashicorp/consul/proto-public v0.6.2 h1:+DA/3g/IiKlJZb88NBn0ZgXrxJp2NlvCZdEyl+qxvL0= github.com/hashicorp/consul/proto-public v0.6.2/go.mod h1:cXXbOg74KBNGajC+o8RlA502Esf0R9prcoJgiOX/2Tg= -github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= +github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -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= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= +github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -167,7 +168,8 @@ github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-uuid v1.0.0/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.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= @@ -192,14 +194,11 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 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/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -257,16 +256,19 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 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.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 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= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -420,8 +422,6 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 4c9471ba..bb211514 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -5,11 +5,11 @@ go 1.20 require ( github.com/docker/docker v20.10.20+incompatible github.com/docker/go-connections v0.4.0 - github.com/hashicorp/consul/api v1.29.1 + github.com/hashicorp/consul/api v1.10.1-0.20230111184009-6d2880e89478 github.com/miekg/dns v1.1.50 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.8.1 github.com/testcontainers/testcontainers-go v0.17.0 - golang.org/x/mod v0.12.0 + golang.org/x/mod v0.8.0 gopkg.in/square/go-jose.v2 v2.5.1 ) @@ -19,42 +19,40 @@ require ( github.com/armon/go-metrics v0.4.1 // indirect github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/containerd/containerd v1.6.18 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/fatih/color v1.16.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/google/btree v1.0.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.2.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/klauspost/compress v1.11.13 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/moby/patternmatcher v0.5.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect - github.com/opencontainers/runc v1.1.12 // indirect + github.com/opencontainers/runc v1.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect - golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect + golang.org/x/tools v0.6.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e // indirect google.golang.org/grpc v1.56.3 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 3302dd74..724ac2ac 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1,5 +1,6 @@ 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/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= @@ -21,71 +22,80 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +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= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.6.18 h1:qZbsLvmyu+Vlty0/Ex5xc0z2YtKpIsb5n45mAMI+2Ns= github.com/containerd/containerd v1.6.18/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 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= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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 v20.10.3-0.20221013203545-33ab36d6b304+incompatible h1:ieHXawdo9MXKnRkKuVWEfEN3PDQUqIjz/T8vMfIaHkM= github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+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-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= 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/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +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/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 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.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/consul/api v1.29.1 h1:UEwOjYJrd3lG1x5w7HxDRMGiAUPrb3f103EoeKuuEcc= -github.com/hashicorp/consul/api v1.29.1/go.mod h1:lumfRkY/coLuqMICkI7Fh3ylMG31mQSRZyef2c5YvJI= -github.com/hashicorp/consul/proto-public v0.6.1 h1:+uzH3olCrksXYWAYHKqK782CtK9scfqH+Unlw3UHhCg= -github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= +github.com/hashicorp/consul/api v1.10.1-0.20230111184009-6d2880e89478 h1:eascRLWw8PlLKqPsx05R8DVl8hVlRsvWemIWDvBXpnY= +github.com/hashicorp/consul/api v1.10.1-0.20230111184009-6d2880e89478/go.mod h1:c1u8FzGHcavbEtRW/p1YditvfMgn4QsKNgz2rnCDF7c= +github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= 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= github.com/hashicorp/go-cleanhttp v0.5.0/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-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= +github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= 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-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= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -94,7 +104,7 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/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.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= @@ -115,27 +125,26 @@ github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdY github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 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/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 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= @@ -145,10 +154,11 @@ github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXx github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -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/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= github.com/moby/patternmatcher v0.5.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= 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.0.0-20221128092401-c43b287e0e0f h1:J/7hjLaHLD7epG0m6TBMGmp4NQ+ibBYLfeyJWdAIFLA= @@ -159,13 +169,16 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 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.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= -github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= +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 v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -173,9 +186,8 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE 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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -190,27 +202,39 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 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.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 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.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 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= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/testcontainers/testcontainers-go v0.17.0 h1:UdKSw2DJXinlS6ijbFb4VHpQzD+EfTwcTq1/19a+8PU= github.com/testcontainers/testcontainers-go v0.17.0/go.mod h1:n5trpHrB68IUelEqGNC8VipaCo6jOGusU44kIK11XRs= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/yuin/goldmark v1.1.27/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= @@ -221,13 +245,11 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= 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.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -235,6 +257,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190923162816-aa69164e4478/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-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 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= @@ -247,7 +270,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/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-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -255,9 +278,11 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190606203320-7fc4e5ec1444/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-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-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -270,12 +295,14 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -291,8 +318,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -301,6 +328,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/internal/mocks/pbdnsmock/dns_service_client.go b/internal/mocks/pbdnsmock/dns_service_client.go index cdde7e82..dbdfb3fa 100644 --- a/internal/mocks/pbdnsmock/dns_service_client.go +++ b/internal/mocks/pbdnsmock/dns_service_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbdnsmock @@ -28,10 +28,6 @@ func (_m *DNSServiceClient) Query(ctx context.Context, in *pbdns.QueryRequest, o _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for Query") - } - var r0 *pbdns.QueryResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) (*pbdns.QueryResponse, error)); ok { diff --git a/internal/mocks/pbdnsmock/dns_service_server.go b/internal/mocks/pbdnsmock/dns_service_server.go index c4cb5013..705aaf63 100644 --- a/internal/mocks/pbdnsmock/dns_service_server.go +++ b/internal/mocks/pbdnsmock/dns_service_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbdnsmock @@ -18,10 +18,6 @@ type DNSServiceServer struct { func (_m *DNSServiceServer) Query(_a0 context.Context, _a1 *pbdns.QueryRequest) (*pbdns.QueryResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for Query") - } - var r0 *pbdns.QueryResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest) (*pbdns.QueryResponse, error)); ok { diff --git a/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go b/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go index 6f655bb5..3f817f10 100644 --- a/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go +++ b/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbdnsmock @@ -13,10 +13,6 @@ type IsCloningDNSServiceClient struct { func (_m *IsCloningDNSServiceClient) IsCloningDNSServiceClient() bool { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for IsCloningDNSServiceClient") - } - var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() diff --git a/internal/mocks/pbdnsmock/unsafe_dns_service_server.go b/internal/mocks/pbdnsmock/unsafe_dns_service_server.go index 3592b56b..1c385ee7 100644 --- a/internal/mocks/pbdnsmock/unsafe_dns_service_server.go +++ b/internal/mocks/pbdnsmock/unsafe_dns_service_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbdnsmock diff --git a/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go b/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go index 0cb2619a..65d590f2 100644 --- a/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go +++ b/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock @@ -13,10 +13,6 @@ type IsCloningResourceServiceClient struct { func (_m *IsCloningResourceServiceClient) IsCloningResourceServiceClient() bool { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for IsCloningResourceServiceClient") - } - var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() diff --git a/internal/mocks/pbresourcemock/is_watch_event__event.go b/internal/mocks/pbresourcemock/is_watch_event__event.go deleted file mode 100644 index 91e3a5ec..00000000 --- a/internal/mocks/pbresourcemock/is_watch_event__event.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. - -package pbresourcemock - -import mock "github.com/stretchr/testify/mock" - -// isWatchEvent_Event is an autogenerated mock type for the isWatchEvent_Event type -type isWatchEvent_Event struct { - mock.Mock -} - -// isWatchEvent_Event provides a mock function with given fields: -func (_m *isWatchEvent_Event) isWatchEvent_Event() { - _m.Called() -} - -// newIsWatchEvent_Event creates a new instance of isWatchEvent_Event. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newIsWatchEvent_Event(t interface { - mock.TestingT - Cleanup(func()) -}) *isWatchEvent_Event { - mock := &isWatchEvent_Event{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/resource_service__watch_list_client.go b/internal/mocks/pbresourcemock/resource_service__watch_list_client.go index b2f4e63c..b1b89a9d 100644 --- a/internal/mocks/pbresourcemock/resource_service__watch_list_client.go +++ b/internal/mocks/pbresourcemock/resource_service__watch_list_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock @@ -20,10 +20,6 @@ type ResourceService_WatchListClient struct { func (_m *ResourceService_WatchListClient) CloseSend() error { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for CloseSend") - } - var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -38,10 +34,6 @@ func (_m *ResourceService_WatchListClient) CloseSend() error { func (_m *ResourceService_WatchListClient) Context() context.Context { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Context") - } - var r0 context.Context if rf, ok := ret.Get(0).(func() context.Context); ok { r0 = rf() @@ -58,10 +50,6 @@ func (_m *ResourceService_WatchListClient) Context() context.Context { func (_m *ResourceService_WatchListClient) Header() (metadata.MD, error) { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Header") - } - var r0 metadata.MD var r1 error if rf, ok := ret.Get(0).(func() (metadata.MD, error)); ok { @@ -88,10 +76,6 @@ func (_m *ResourceService_WatchListClient) Header() (metadata.MD, error) { func (_m *ResourceService_WatchListClient) Recv() (*pbresource.WatchEvent, error) { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Recv") - } - var r0 *pbresource.WatchEvent var r1 error if rf, ok := ret.Get(0).(func() (*pbresource.WatchEvent, error)); ok { @@ -118,10 +102,6 @@ func (_m *ResourceService_WatchListClient) Recv() (*pbresource.WatchEvent, error func (_m *ResourceService_WatchListClient) RecvMsg(m interface{}) error { ret := _m.Called(m) - if len(ret) == 0 { - panic("no return value specified for RecvMsg") - } - var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(m) @@ -136,10 +116,6 @@ func (_m *ResourceService_WatchListClient) RecvMsg(m interface{}) error { func (_m *ResourceService_WatchListClient) SendMsg(m interface{}) error { ret := _m.Called(m) - if len(ret) == 0 { - panic("no return value specified for SendMsg") - } - var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(m) @@ -154,10 +130,6 @@ func (_m *ResourceService_WatchListClient) SendMsg(m interface{}) error { func (_m *ResourceService_WatchListClient) Trailer() metadata.MD { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Trailer") - } - var r0 metadata.MD if rf, ok := ret.Get(0).(func() metadata.MD); ok { r0 = rf() diff --git a/internal/mocks/pbresourcemock/resource_service__watch_list_server.go b/internal/mocks/pbresourcemock/resource_service__watch_list_server.go index 2ff3cd3a..661f2e03 100644 --- a/internal/mocks/pbresourcemock/resource_service__watch_list_server.go +++ b/internal/mocks/pbresourcemock/resource_service__watch_list_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock @@ -20,10 +20,6 @@ type ResourceService_WatchListServer struct { func (_m *ResourceService_WatchListServer) Context() context.Context { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Context") - } - var r0 context.Context if rf, ok := ret.Get(0).(func() context.Context); ok { r0 = rf() @@ -40,10 +36,6 @@ func (_m *ResourceService_WatchListServer) Context() context.Context { func (_m *ResourceService_WatchListServer) RecvMsg(m interface{}) error { ret := _m.Called(m) - if len(ret) == 0 { - panic("no return value specified for RecvMsg") - } - var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(m) @@ -58,10 +50,6 @@ func (_m *ResourceService_WatchListServer) RecvMsg(m interface{}) error { func (_m *ResourceService_WatchListServer) Send(_a0 *pbresource.WatchEvent) error { ret := _m.Called(_a0) - if len(ret) == 0 { - panic("no return value specified for Send") - } - var r0 error if rf, ok := ret.Get(0).(func(*pbresource.WatchEvent) error); ok { r0 = rf(_a0) @@ -76,10 +64,6 @@ func (_m *ResourceService_WatchListServer) Send(_a0 *pbresource.WatchEvent) erro func (_m *ResourceService_WatchListServer) SendHeader(_a0 metadata.MD) error { ret := _m.Called(_a0) - if len(ret) == 0 { - panic("no return value specified for SendHeader") - } - var r0 error if rf, ok := ret.Get(0).(func(metadata.MD) error); ok { r0 = rf(_a0) @@ -94,10 +78,6 @@ func (_m *ResourceService_WatchListServer) SendHeader(_a0 metadata.MD) error { func (_m *ResourceService_WatchListServer) SendMsg(m interface{}) error { ret := _m.Called(m) - if len(ret) == 0 { - panic("no return value specified for SendMsg") - } - var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(m) @@ -112,10 +92,6 @@ func (_m *ResourceService_WatchListServer) SendMsg(m interface{}) error { func (_m *ResourceService_WatchListServer) SetHeader(_a0 metadata.MD) error { ret := _m.Called(_a0) - if len(ret) == 0 { - panic("no return value specified for SetHeader") - } - var r0 error if rf, ok := ret.Get(0).(func(metadata.MD) error); ok { r0 = rf(_a0) diff --git a/internal/mocks/pbresourcemock/resource_service_client.go b/internal/mocks/pbresourcemock/resource_service_client.go index f136cbd1..3cbb1c8b 100644 --- a/internal/mocks/pbresourcemock/resource_service_client.go +++ b/internal/mocks/pbresourcemock/resource_service_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock @@ -28,10 +28,6 @@ func (_m *ResourceServiceClient) Delete(ctx context.Context, in *pbresource.Dele _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for Delete") - } - var r0 *pbresource.DeleteResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.DeleteRequest, ...grpc.CallOption) (*pbresource.DeleteResponse, error)); ok { @@ -65,10 +61,6 @@ func (_m *ResourceServiceClient) List(ctx context.Context, in *pbresource.ListRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for List") - } - var r0 *pbresource.ListResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListRequest, ...grpc.CallOption) (*pbresource.ListResponse, error)); ok { @@ -102,10 +94,6 @@ func (_m *ResourceServiceClient) ListByOwner(ctx context.Context, in *pbresource _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for ListByOwner") - } - var r0 *pbresource.ListByOwnerResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListByOwnerRequest, ...grpc.CallOption) (*pbresource.ListByOwnerResponse, error)); ok { @@ -139,10 +127,6 @@ func (_m *ResourceServiceClient) MutateAndValidate(ctx context.Context, in *pbre _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for MutateAndValidate") - } - var r0 *pbresource.MutateAndValidateResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.MutateAndValidateRequest, ...grpc.CallOption) (*pbresource.MutateAndValidateResponse, error)); ok { @@ -176,10 +160,6 @@ func (_m *ResourceServiceClient) Read(ctx context.Context, in *pbresource.ReadRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for Read") - } - var r0 *pbresource.ReadResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ReadRequest, ...grpc.CallOption) (*pbresource.ReadResponse, error)); ok { @@ -213,10 +193,6 @@ func (_m *ResourceServiceClient) WatchList(ctx context.Context, in *pbresource.W _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for WatchList") - } - var r0 pbresource.ResourceService_WatchListClient var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WatchListRequest, ...grpc.CallOption) (pbresource.ResourceService_WatchListClient, error)); ok { @@ -250,10 +226,6 @@ func (_m *ResourceServiceClient) Write(ctx context.Context, in *pbresource.Write _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for Write") - } - var r0 *pbresource.WriteResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteRequest, ...grpc.CallOption) (*pbresource.WriteResponse, error)); ok { @@ -287,10 +259,6 @@ func (_m *ResourceServiceClient) WriteStatus(ctx context.Context, in *pbresource _ca = append(_ca, _va...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for WriteStatus") - } - var r0 *pbresource.WriteStatusResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteStatusRequest, ...grpc.CallOption) (*pbresource.WriteStatusResponse, error)); ok { diff --git a/internal/mocks/pbresourcemock/resource_service_server.go b/internal/mocks/pbresourcemock/resource_service_server.go index 2cbf4c84..f82d9d9c 100644 --- a/internal/mocks/pbresourcemock/resource_service_server.go +++ b/internal/mocks/pbresourcemock/resource_service_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock @@ -18,10 +18,6 @@ type ResourceServiceServer struct { func (_m *ResourceServiceServer) Delete(_a0 context.Context, _a1 *pbresource.DeleteRequest) (*pbresource.DeleteResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for Delete") - } - var r0 *pbresource.DeleteResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.DeleteRequest) (*pbresource.DeleteResponse, error)); ok { @@ -48,10 +44,6 @@ func (_m *ResourceServiceServer) Delete(_a0 context.Context, _a1 *pbresource.Del func (_m *ResourceServiceServer) List(_a0 context.Context, _a1 *pbresource.ListRequest) (*pbresource.ListResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for List") - } - var r0 *pbresource.ListResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListRequest) (*pbresource.ListResponse, error)); ok { @@ -78,10 +70,6 @@ func (_m *ResourceServiceServer) List(_a0 context.Context, _a1 *pbresource.ListR func (_m *ResourceServiceServer) ListByOwner(_a0 context.Context, _a1 *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for ListByOwner") - } - var r0 *pbresource.ListByOwnerResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error)); ok { @@ -108,10 +96,6 @@ func (_m *ResourceServiceServer) ListByOwner(_a0 context.Context, _a1 *pbresourc func (_m *ResourceServiceServer) MutateAndValidate(_a0 context.Context, _a1 *pbresource.MutateAndValidateRequest) (*pbresource.MutateAndValidateResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for MutateAndValidate") - } - var r0 *pbresource.MutateAndValidateResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.MutateAndValidateRequest) (*pbresource.MutateAndValidateResponse, error)); ok { @@ -138,10 +122,6 @@ func (_m *ResourceServiceServer) MutateAndValidate(_a0 context.Context, _a1 *pbr func (_m *ResourceServiceServer) Read(_a0 context.Context, _a1 *pbresource.ReadRequest) (*pbresource.ReadResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for Read") - } - var r0 *pbresource.ReadResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ReadRequest) (*pbresource.ReadResponse, error)); ok { @@ -168,10 +148,6 @@ func (_m *ResourceServiceServer) Read(_a0 context.Context, _a1 *pbresource.ReadR func (_m *ResourceServiceServer) WatchList(_a0 *pbresource.WatchListRequest, _a1 pbresource.ResourceService_WatchListServer) error { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for WatchList") - } - var r0 error if rf, ok := ret.Get(0).(func(*pbresource.WatchListRequest, pbresource.ResourceService_WatchListServer) error); ok { r0 = rf(_a0, _a1) @@ -186,10 +162,6 @@ func (_m *ResourceServiceServer) WatchList(_a0 *pbresource.WatchListRequest, _a1 func (_m *ResourceServiceServer) Write(_a0 context.Context, _a1 *pbresource.WriteRequest) (*pbresource.WriteResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for Write") - } - var r0 *pbresource.WriteResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteRequest) (*pbresource.WriteResponse, error)); ok { @@ -216,10 +188,6 @@ func (_m *ResourceServiceServer) Write(_a0 context.Context, _a1 *pbresource.Writ func (_m *ResourceServiceServer) WriteStatus(_a0 context.Context, _a1 *pbresource.WriteStatusRequest) (*pbresource.WriteStatusResponse, error) { ret := _m.Called(_a0, _a1) - if len(ret) == 0 { - panic("no return value specified for WriteStatus") - } - var r0 *pbresource.WriteStatusResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteStatusRequest) (*pbresource.WriteStatusResponse, error)); ok { diff --git a/internal/mocks/pbresourcemock/server_stream.go b/internal/mocks/pbresourcemock/server_stream.go index a3d576e3..48025fc3 100644 --- a/internal/mocks/pbresourcemock/server_stream.go +++ b/internal/mocks/pbresourcemock/server_stream.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock @@ -20,10 +20,6 @@ type serverStream[T protoreflect.ProtoMessage] struct { func (_m *serverStream[T]) CloseSend() error { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for CloseSend") - } - var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -38,10 +34,6 @@ func (_m *serverStream[T]) CloseSend() error { func (_m *serverStream[T]) Context() context.Context { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Context") - } - var r0 context.Context if rf, ok := ret.Get(0).(func() context.Context); ok { r0 = rf() @@ -58,10 +50,6 @@ func (_m *serverStream[T]) Context() context.Context { func (_m *serverStream[T]) Header() (metadata.MD, error) { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Header") - } - var r0 metadata.MD var r1 error if rf, ok := ret.Get(0).(func() (metadata.MD, error)); ok { @@ -88,10 +76,6 @@ func (_m *serverStream[T]) Header() (metadata.MD, error) { func (_m *serverStream[T]) Recv() (T, error) { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Recv") - } - var r0 T var r1 error if rf, ok := ret.Get(0).(func() (T, error)); ok { @@ -116,10 +100,6 @@ func (_m *serverStream[T]) Recv() (T, error) { func (_m *serverStream[T]) RecvMsg(m interface{}) error { ret := _m.Called(m) - if len(ret) == 0 { - panic("no return value specified for RecvMsg") - } - var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(m) @@ -134,10 +114,6 @@ func (_m *serverStream[T]) RecvMsg(m interface{}) error { func (_m *serverStream[T]) SendMsg(m interface{}) error { ret := _m.Called(m) - if len(ret) == 0 { - panic("no return value specified for SendMsg") - } - var r0 error if rf, ok := ret.Get(0).(func(interface{}) error); ok { r0 = rf(m) @@ -152,10 +128,6 @@ func (_m *serverStream[T]) SendMsg(m interface{}) error { func (_m *serverStream[T]) Trailer() metadata.MD { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Trailer") - } - var r0 metadata.MD if rf, ok := ret.Get(0).(func() metadata.MD); ok { r0 = rf() diff --git a/internal/mocks/pbresourcemock/unsafe_resource_service_server.go b/internal/mocks/pbresourcemock/unsafe_resource_service_server.go index 11c486ee..809a9a73 100644 --- a/internal/mocks/pbresourcemock/unsafe_resource_service_server.go +++ b/internal/mocks/pbresourcemock/unsafe_resource_service_server.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.41.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package pbresourcemock diff --git a/pkg/consuldp/bootstrap.go b/pkg/consuldp/bootstrap.go index 41a1a693..48eeb69e 100644 --- a/pkg/consuldp/bootstrap.go +++ b/pkg/consuldp/bootstrap.go @@ -12,6 +12,7 @@ import ( "strings" "github.com/hashicorp/consul/proto-public/pbdataplane" + pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1" "github.com/mitchellh/mapstructure" "github.com/hashicorp/consul-dataplane/internal/bootstrap" @@ -26,9 +27,10 @@ const ( defaultAdminAccessLogsPath = os.DevNull ) -// getBootstrapParams makes a call using the service client to get the bootstrap params for eventually getting the Envoy bootstrap config. -func (cdp *ConsulDataplane) getBootstrapParams(ctx context.Context) (*pbdataplane.GetEnvoyBootstrapParamsResponse, error) { +// bootstrapConfig generates the Envoy bootstrap config in JSON format. +func (cdp *ConsulDataplane) bootstrapConfig(ctx context.Context) (*bootstrap.BootstrapConfig, []byte, error) { svc := cdp.cfg.Proxy + envoy := cdp.cfg.Envoy req := &pbdataplane.GetEnvoyBootstrapParamsRequest{ ServiceId: svc.ProxyID, @@ -49,18 +51,9 @@ func (cdp *ConsulDataplane) getBootstrapParams(ctx context.Context) (*pbdataplan rsp, err := cdp.dpServiceClient.GetEnvoyBootstrapParams(ctx, req) if err != nil { - return nil, fmt.Errorf("failed to get envoy bootstrap params: %w", err) + return nil, nil, fmt.Errorf("failed to get envoy bootstrap params: %w", err) } - return rsp, nil -} - -// bootstrapConfig generates the Envoy bootstrap config in JSON format. -func (cdp *ConsulDataplane) bootstrapConfig( - bootstrapParams *pbdataplane.GetEnvoyBootstrapParamsResponse) (*bootstrap.BootstrapConfig, []byte, error) { - svc := cdp.cfg.Proxy - envoy := cdp.cfg.Envoy - prom := cdp.cfg.Telemetry.Prometheus args := &bootstrap.BootstrapTplArgs{ GRPC: bootstrap.GRPC{ @@ -68,26 +61,26 @@ func (cdp *ConsulDataplane) bootstrapConfig( AgentPort: strconv.Itoa(cdp.cfg.XDSServer.BindPort), AgentTLS: false, }, - ProxyCluster: bootstrapParams.Service, + ProxyCluster: rsp.Service, ProxyID: svc.ProxyID, - NodeName: bootstrapParams.NodeName, - ProxySourceService: bootstrapParams.Service, - AdminAccessLogConfig: bootstrapParams.AccessLogs, + NodeName: rsp.NodeName, + ProxySourceService: rsp.Service, + AdminAccessLogConfig: rsp.AccessLogs, AdminAccessLogPath: defaultAdminAccessLogsPath, AdminBindAddress: envoy.AdminBindAddress, AdminBindPort: strconv.Itoa(envoy.AdminBindPort), LocalAgentClusterName: localClusterName, - Namespace: bootstrapParams.Namespace, - Partition: bootstrapParams.Partition, - Datacenter: bootstrapParams.Datacenter, + Namespace: rsp.Namespace, + Partition: rsp.Partition, + Datacenter: rsp.Datacenter, PrometheusCertFile: prom.CertFile, PrometheusKeyFile: prom.KeyFile, PrometheusScrapePath: prom.ScrapePath, } - if bootstrapParams.Identity != "" { - args.ProxyCluster = bootstrapParams.Identity - args.ProxySourceService = bootstrapParams.Identity + if rsp.Identity != "" { + args.ProxyCluster = rsp.Identity + args.ProxySourceService = rsp.Identity } if cdp.xdsServer.listenerNetwork == "unix" { @@ -116,8 +109,12 @@ func (cdp *ConsulDataplane) bootstrapConfig( } if cdp.cfg.Telemetry.UseCentralConfig { - if err := mapstructure.WeakDecode(bootstrapParams.Config.AsMap(), &bootstrapConfig); err != nil { - return nil, nil, fmt.Errorf("failed parsing Proxy.Config: %w", err) + if rsp.BootstrapConfig != nil { + bootstrapConfig = bootstrapConfigFromCfg(rsp.BootstrapConfig) + } else { + if err := mapstructure.WeakDecode(rsp.Config.AsMap(), &bootstrapConfig); err != nil { + return nil, nil, fmt.Errorf("failed parsing Proxy.Config: %w", err) + } } // Envoy is configured with a listener that proxies metrics from its @@ -136,3 +133,22 @@ func (cdp *ConsulDataplane) bootstrapConfig( cfg, err := bootstrapConfig.GenerateJSON(args, true) return &bootstrapConfig, cfg, err } + +func bootstrapConfigFromCfg(cfg *pbmesh.BootstrapConfig) bootstrap.BootstrapConfig { + return bootstrap.BootstrapConfig{ + StatsdURL: cfg.StatsdUrl, + DogstatsdURL: cfg.DogstatsdUrl, + StatsTags: cfg.StatsTags, + TelemetryCollectorBindSocketDir: cfg.TelemetryCollectorBindSocketDir, + PrometheusBindAddr: cfg.PrometheusBindAddr, + StatsBindAddr: cfg.StatsBindAddr, + ReadyBindAddr: cfg.ReadyBindAddr, + OverrideJSONTpl: cfg.OverrideJsonTpl, + StaticClustersJSON: cfg.StaticClustersJson, + StaticListenersJSON: cfg.StaticListenersJson, + StatsSinksJSON: cfg.StatsSinksJson, + StatsConfigJSON: cfg.StatsConfigJson, + StatsFlushInterval: cfg.StatsFlushInterval, + TracingConfigJSON: cfg.TracingConfigJson, + } +} diff --git a/pkg/consuldp/bootstrap_test.go b/pkg/consuldp/bootstrap_test.go index b0ec5fd4..760e724f 100644 --- a/pkg/consuldp/bootstrap_test.go +++ b/pkg/consuldp/bootstrap_test.go @@ -15,6 +15,7 @@ import ( "testing" "github.com/hashicorp/consul/proto-public/pbdataplane" + pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1" "github.com/hashicorp/go-hclog" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -40,12 +41,12 @@ func TestBootstrapConfig(t *testing.T) { } testCases := map[string]struct { - cfg *Config - rsp *pbdataplane.GetEnvoyBootstrapParamsResponse - resolvedProxyConfig *ProxyConfig + cfg *Config + rsp *pbdataplane.GetEnvoyBootstrapParamsResponse + rspV2 *pbdataplane.GetEnvoyBootstrapParamsResponse }{ "access-logs": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -59,7 +60,7 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, Config: makeStruct(map[string]any{ @@ -67,9 +68,17 @@ func TestBootstrapConfig(t *testing.T) { }), AccessLogs: []string{"{\"name\":\"Consul Listener Filter Log\",\"typedConfig\":{\"@type\":\"type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog\",\"logFormat\":{\"jsonFormat\":{\"custom_field\":\"%START_TIME%\"}}}}"}, }, + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + NodeName: nodeName, + BootstrapConfig: &pbmesh.BootstrapConfig{ + DogstatsdUrl: "this-should-not-appear-in-generated-config", + }, + AccessLogs: []string{"{\"name\":\"Consul Listener Filter Log\",\"typedConfig\":{\"@type\":\"type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog\",\"logFormat\":{\"jsonFormat\":{\"custom_field\":\"%START_TIME%\"}}}}"}, + }, }, "basic": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -83,16 +92,23 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, Config: makeStruct(map[string]any{ "envoy_dogstatsd_url": "this-should-not-appear-in-generated-config", }), }, + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + NodeName: nodeName, + BootstrapConfig: &pbmesh.BootstrapConfig{ + DogstatsdUrl: "this-should-not-appear-in-generated-config", + }, + }, }, "central-telemetry-config": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -106,13 +122,20 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, Config: makeStruct(map[string]any{ "envoy_dogstatsd_url": "udp://127.0.0.1:9125", }), }, + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + NodeName: nodeName, + BootstrapConfig: &pbmesh.BootstrapConfig{ + DogstatsdUrl: "udp://127.0.0.1:9125", + }, + }, }, "hcp-metrics": { cfg: &Config{ @@ -138,9 +161,17 @@ func TestBootstrapConfig(t *testing.T) { "envoy_telemetry_collector_bind_socket_dir": "/tmp/consul/hcp-metrics", }), }, + rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + Namespace: "default", + NodeName: nodeName, + BootstrapConfig: &pbmesh.BootstrapConfig{ + TelemetryCollectorBindSocketDir: "/tmp/consul/hcp-metrics", + }, + }, }, "custom-prometheus-scrape-path": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -158,16 +189,23 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, Config: makeStruct(map[string]any{ "envoy_prometheus_bind_addr": "0.0.0.0:20200", }), }, + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + NodeName: nodeName, + BootstrapConfig: &pbmesh.BootstrapConfig{ + PrometheusBindAddr: "0.0.0.0:20200", + }, + }, }, "custom-prometheus-scrape-path-with-query": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -186,49 +224,23 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, Config: makeStruct(map[string]any{ "envoy_prometheus_bind_addr": "0.0.0.0:20200", }), }, - }, - "non-default tenancy": { - cfg: &Config{ - Proxy: &ProxyConfig{ - ProxyID: "web-proxy", - NodeName: nodeName, - // No tenancy provided here to make sure it comes from the bootstrap call - }, - Envoy: &EnvoyConfig{ - AdminBindAddress: "127.0.0.1", - AdminBindPort: 19000, - }, - Telemetry: &TelemetryConfig{ - UseCentralConfig: false, - }, - XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, - }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ - Service: "web", + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", NodeName: nodeName, - Config: makeStruct(map[string]any{ - "envoy_dogstatsd_url": "this-should-not-appear-in-generated-config", - }), - Namespace: "test-namespace", - Partition: "test-partition", - }, - // We want to ensure cdp is configured with the resolved tenancy - resolvedProxyConfig: &ProxyConfig{ - NodeName: nodeName, - ProxyID: "web-proxy", - Namespace: "test-namespace", - Partition: "test-partition", + BootstrapConfig: &pbmesh.BootstrapConfig{ + PrometheusBindAddr: "0.0.0.0:20200", + }, }, }, "ready-listener": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -244,13 +256,17 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, }, + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + NodeName: nodeName, + }, }, "unix-socket-xds-server": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -264,17 +280,24 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: fmt.Sprintf("unix://%s", socketPath)}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, Config: makeStruct(map[string]any{ "envoy_dogstatsd_url": "this-should-not-appear-in-generated-config", }), }, + &pbdataplane.GetEnvoyBootstrapParamsResponse{ + Identity: "web", + NodeName: nodeName, + BootstrapConfig: &pbmesh.BootstrapConfig{ + DogstatsdUrl: "this-should-not-appear-in-generated-config", + }, + }, }, } for desc, tc := range testCases { - t.Run(desc, func(t *testing.T) { + t.Run(desc+"-v1", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) @@ -300,24 +323,44 @@ func TestBootstrapConfig(t *testing.T) { dp.xdsServer = &xdsServer{listenerAddress: fmt.Sprintf("127.0.0.1:%d", xdsBindPort)} } - params, err := dp.getBootstrapParams(ctx) - require.NoError(t, err) - - _, bsCfg, err := dp.bootstrapConfig(params) + _, bsCfg, err := dp.bootstrapConfig(ctx) require.NoError(t, err) golden(t, bsCfg) validateBootstrapConfig(t, bsCfg) + }) - if tc.resolvedProxyConfig != nil { - proxyCfg := ProxyConfig{ - NodeName: params.NodeName, - ProxyID: dp.cfg.Proxy.ProxyID, - Namespace: params.Namespace, - Partition: params.Partition, - } - require.Equal(t, *tc.resolvedProxyConfig, proxyCfg) + t.Run(desc+"-v2", func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + + client := NewMockDataplaneServiceClient(t) + client.EXPECT(). + GetEnvoyBootstrapParams(mock.Anything, &pbdataplane.GetEnvoyBootstrapParamsRequest{ + NodeSpec: &pbdataplane.GetEnvoyBootstrapParamsRequest_NodeName{NodeName: tc.cfg.Proxy.NodeName}, + ServiceId: tc.cfg.Proxy.ProxyID, + ProxyId: tc.cfg.Proxy.ProxyID, + Namespace: tc.cfg.Proxy.Namespace, + }).Call. + Return(tc.rspV2, nil) + + dp := &ConsulDataplane{ + cfg: tc.cfg, + dpServiceClient: client, + logger: hclog.NewNullLogger(), + } + + if strings.HasPrefix(tc.cfg.XDSServer.BindAddress, "unix://") { + dp.xdsServer = &xdsServer{listenerAddress: socketPath, listenerNetwork: "unix"} + } else { + dp.xdsServer = &xdsServer{listenerAddress: fmt.Sprintf("127.0.0.1:%d", xdsBindPort)} } + + _, bsCfg, err := dp.bootstrapConfig(ctx) + require.NoError(t, err) + + golden(t, bsCfg) + validateBootstrapConfig(t, bsCfg) }) } } @@ -325,7 +368,10 @@ func TestBootstrapConfig(t *testing.T) { func golden(t *testing.T, actual []byte) { t.Helper() - goldenPath := filepath.Join("testdata", t.Name()+".golden") + fileName := strings.TrimSuffix(t.Name(), "-v1") + fileName = strings.TrimSuffix(fileName, "-v2") + + goldenPath := filepath.Join("testdata", fileName+".golden") if *update { require.NoError(t, os.WriteFile(goldenPath, actual, 0644)) diff --git a/pkg/consuldp/config.go b/pkg/consuldp/config.go index 83b7852e..b3177bfe 100644 --- a/pkg/consuldp/config.go +++ b/pkg/consuldp/config.go @@ -135,18 +135,6 @@ const ( CredentialsTypeLogin CredentialsType = "login" ) -// CredentialsType identifies the type of credentials provided. -type ModeType string - -const ( - // ModeTypeSidecar indicates that consul-dataplane is running in sidecar - // mode where DNS Server, xDS Server, and Envoy are all enabled. - ModeTypeSidecar ModeType = "sidecar" - // ModeTypeDNSProxy indicates that consul-dataplane is running in DNS Proxy - // mode where DNS Server is running but xDSServer and Envoy are disabled. - ModeTypeDNSProxy ModeType = "dns-proxy" -) - // StaticCredentialsConfig contains the static ACL token that will be used to // authenticate requests and streams to the Consul servers. type StaticCredentialsConfig struct { @@ -224,10 +212,10 @@ type LoggingConfig struct { // ProxyConfig contains details of the proxy service instance. type ProxyConfig struct { // NodeName is the name of the node to which the proxy service instance is - // registered. + // registered. Ignored in Consul Catalog V2. NodeName string // NodeName is the ID of the node to which the proxy service instance is - // registered. + // registered. Ignored in Consul Catalog V2. NodeID string // ProxyID is the ID of the proxy service instance or workload. ProxyID string @@ -328,7 +316,6 @@ type XDSServer struct { // Config is the configuration used by consul-dataplane, consolidated // from various sources - CLI flags, env vars, config file settings. type Config struct { - Mode ModeType DNSServer *DNSServerConfig Consul *ConsulConfig Proxy *ProxyConfig diff --git a/pkg/consuldp/consul_dataplane.go b/pkg/consuldp/consul_dataplane.go index 76df0b99..16694bd2 100644 --- a/pkg/consuldp/consul_dataplane.go +++ b/pkg/consuldp/consul_dataplane.go @@ -77,26 +77,24 @@ func validateConfig(cfg *Config) error { return errors.New("consul addresses not specified") case cfg.Consul.GRPCPort == 0: return errors.New("consul server gRPC port not specified") - case cfg.Mode == ModeTypeSidecar && cfg.Proxy == nil: + case cfg.Proxy == nil: return errors.New("proxy details not specified") - case cfg.Mode == ModeTypeSidecar && cfg.Proxy.ProxyID == "": + case cfg.Proxy.ProxyID == "": return errors.New("proxy ID not specified") - case cfg.Mode == ModeTypeSidecar && cfg.Envoy == nil: + case cfg.Envoy == nil: return errors.New("envoy settings not specified") - case cfg.Mode == ModeTypeSidecar && cfg.Envoy.AdminBindAddress == "": + case cfg.Envoy.AdminBindAddress == "": return errors.New("envoy admin bind address not specified") - case cfg.Mode == ModeTypeSidecar && cfg.Envoy.AdminBindPort == 0: + case cfg.Envoy.AdminBindPort == 0: return errors.New("envoy admin bind port not specified") case cfg.Logging == nil: return errors.New("logging settings not specified") - case cfg.Mode == ModeTypeSidecar && cfg.XDSServer.BindAddress == "": + case cfg.XDSServer.BindAddress == "": return errors.New("envoy xDS bind address not specified") - case cfg.Mode == ModeTypeSidecar && !strings.HasPrefix(cfg.XDSServer.BindAddress, "unix://") && !net.ParseIP(cfg.XDSServer.BindAddress).IsLoopback(): + case !strings.HasPrefix(cfg.XDSServer.BindAddress, "unix://") && !net.ParseIP(cfg.XDSServer.BindAddress).IsLoopback(): return errors.New("non-local xDS bind address not allowed") - case cfg.Mode == ModeTypeSidecar && cfg.DNSServer.Port != -1 && !net.ParseIP(cfg.DNSServer.BindAddr).IsLoopback(): - return errors.New("non-local DNS proxy bind address not allowed when running as a sidecar") - case cfg.Mode == ModeTypeDNSProxy && cfg.Proxy != nil && !(cfg.Proxy.Namespace == "" || cfg.Proxy.Namespace == "default"): - return errors.New("namespace must be empty or set to 'default' when running in dns-proxy mode") + case cfg.DNSServer.Port != -1 && !net.ParseIP(cfg.DNSServer.BindAddr).IsLoopback(): + return errors.New("non-local DNS proxy bind address not allowed") } creds := cfg.Consul.Credentials @@ -129,7 +127,6 @@ func validateConfig(cfg *Config) error { func (cdp *ConsulDataplane) Run(ctx context.Context) error { ctx = hclog.WithContext(ctx, cdp.logger) cdp.logger.Info("started consul-dataplane process") - cdp.logger.Info(fmt.Sprintf("consul-dataplane mode: %s", cdp.cfg.Mode)) // At startup we need to cache metrics until we have information from the bootstrap envoy config // that the consumer wants metrics enabled. Until then we will set our own light weight metrics @@ -179,54 +176,24 @@ func (cdp *ConsulDataplane) Run(ctx context.Context) error { cdp.aclToken = state.Token cdp.dpServiceClient = pbdataplane.NewDataplaneServiceClient(state.GRPCConn) - doneCh := make(chan error) - - // if running as DNS PRoxy, xDS Server and Envoy are disabled, so - // return before configuring them. - if cdp.cfg.Mode == ModeTypeDNSProxy { - // start up DNS server with the configuration from the consul-dataplane flags / environment variables since - // envoy bootstrapping is bypassed. - if err = cdp.startDNSProxy(ctx, cdp.cfg.DNSServer, cdp.cfg.Proxy.Namespace, cdp.cfg.Proxy.Partition); err != nil { - cdp.logger.Error("failed to start the dns proxy", "error", err) - return err - } - // Wait for context to be done in a more simplified goroutine dns-proxy mode. - go func() { - <-ctx.Done() - doneCh <- nil - }() - return <-doneCh - } - - // Configure xDS and Envoy configuration continues here when running in sidecar mode. - cdp.logger.Info("configuring xDS and Envoy") err = cdp.setupXDSServer() if err != nil { return err } go cdp.startXDSServer(ctx) - bootstrapParams, err := cdp.getBootstrapParams(ctx) + bootstrapCfg, cfg, err := cdp.bootstrapConfig(ctx) if err != nil { - cdp.logger.Error("failed to get bootstrap params", "error", err) + cdp.logger.Error("failed to get bootstrap config", "error", err) return fmt.Errorf("failed to get bootstrap config: %w", err) } - cdp.logger.Debug("generated envoy bootstrap params", "params", bootstrapParams) + cdp.logger.Debug("generated envoy bootstrap config", "config", string(cfg)) - // start up DNS server with envoy bootstrap params. - if err = cdp.startDNSProxy(ctx, cdp.cfg.DNSServer, bootstrapParams.Namespace, bootstrapParams.Partition); err != nil { + if err = cdp.startDNSProxy(ctx); err != nil { cdp.logger.Error("failed to start the dns proxy", "error", err) return err } - bootstrapCfg, cfg, err := cdp.bootstrapConfig(bootstrapParams) - if err != nil { - cdp.logger.Error("failed to get bootstrap config", "error", err) - return fmt.Errorf("failed to get bootstrap config: %w", err) - } - cdp.logger.Debug("generated envoy bootstrap config", "config", string(cfg)) - - cdp.logger.Info("configuring envoy and xDS") proxy, err := envoy.NewProxy(cdp.envoyProxyConfig(cfg)) if err != nil { cdp.logger.Error("failed to create new proxy", "error", err) @@ -249,6 +216,7 @@ func (cdp *ConsulDataplane) Run(ctx context.Context) error { return err } + doneCh := make(chan error) go func() { select { case <-ctx.Done(): @@ -283,21 +251,17 @@ func (cdp *ConsulDataplane) Run(ctx context.Context) error { return <-doneCh } -func (cdp *ConsulDataplane) startDNSProxy(ctx context.Context, - dnsConfig *DNSServerConfig, namespace, partition string) error { +func (cdp *ConsulDataplane) startDNSProxy(ctx context.Context) error { dnsClientInterface := pbdns.NewDNSServiceClient(cdp.serverConn) dnsServer, err := dns.NewDNSServer(dns.DNSServerParams{ - BindAddr: dnsConfig.BindAddr, - Port: dnsConfig.Port, - Client: dnsClientInterface, - Logger: cdp.logger, - Partition: partition, - Namespace: namespace, - Token: cdp.aclToken, + BindAddr: cdp.cfg.DNSServer.BindAddr, + Port: cdp.cfg.DNSServer.Port, + Client: dnsClientInterface, + Logger: cdp.logger, }) if err == dns.ErrServerDisabled { - cdp.logger.Info("dns server disabled: configure the Consul DNS port to enable") + cdp.logger.Info("dns proxy disabled: configure the Consul DNS port to enable") return nil } else if err != nil { return fmt.Errorf("failed to create dns server: %w", err) diff --git a/pkg/consuldp/consul_dataplane_test.go b/pkg/consuldp/consul_dataplane_test.go index f7a5102d..d4d6d37a 100644 --- a/pkg/consuldp/consul_dataplane_test.go +++ b/pkg/consuldp/consul_dataplane_test.go @@ -10,9 +10,8 @@ import ( "github.com/stretchr/testify/require" ) -func validConfig(mode ModeType) *Config { +func validConfig() *Config { return &Config{ - Mode: mode, Consul: &ConsulConfig{ Addresses: "consul.servers.dns.com", GRPCPort: 1234, @@ -55,7 +54,7 @@ func validConfig(mode ModeType) *Config { } func TestNewConsulDP(t *testing.T) { - cfg := validConfig(ModeTypeSidecar) + cfg := validConfig() consulDP, err := NewConsulDP(cfg) require.NoError(t, err) require.NotNil(t, consulDP) @@ -70,121 +69,101 @@ func TestNewConsulDPError(t *testing.T) { name string modFn func(*Config) expectErr string - mode ModeType } testCases := []testCase{ - // Side car test cases { - name: "sidecar mode - missing consul config", - mode: ModeTypeSidecar, + name: "missing consul config", modFn: func(c *Config) { c.Consul = nil }, expectErr: "consul addresses not specified", }, { - name: "sidecar mode - missing consul addresses", - mode: ModeTypeSidecar, + name: "missing consul addresses", modFn: func(c *Config) { c.Consul.Addresses = "" }, expectErr: "consul addresses not specified", }, { - name: "sidecar mode - missing consul server grpc port", - mode: ModeTypeSidecar, + name: "missing consul server grpc port", modFn: func(c *Config) { c.Consul.GRPCPort = 0 }, expectErr: "consul server gRPC port not specified", }, { - name: "sidecar mode - missing proxy config", - mode: ModeTypeSidecar, + name: "missing proxy config", modFn: func(c *Config) { c.Proxy = nil }, expectErr: "proxy details not specified", }, { - name: "sidecar mode - missing proxy id", - mode: ModeTypeSidecar, + name: "missing proxy id", modFn: func(c *Config) { c.Proxy.ProxyID = "" }, expectErr: "proxy ID not specified", }, { - name: "sidecar mode - missing envoy config", - mode: ModeTypeSidecar, + name: "missing envoy config", modFn: func(c *Config) { c.Envoy = nil }, expectErr: "envoy settings not specified", }, { - name: "sidecar mode - missing envoy admin bind address", - mode: ModeTypeSidecar, + name: "missing envoy admin bind address", modFn: func(c *Config) { c.Envoy.AdminBindAddress = "" }, expectErr: "envoy admin bind address not specified", }, { - name: "sidecar mode - missing envoy admin bind port", - mode: ModeTypeSidecar, + name: "missing envoy admin bind port", modFn: func(c *Config) { c.Envoy.AdminBindPort = 0 }, expectErr: "envoy admin bind port not specified", }, { - name: "sidecar mode - missing logging config", - mode: ModeTypeSidecar, + name: "missing logging config", modFn: func(c *Config) { c.Logging = nil }, expectErr: "logging settings not specified", }, { - name: "sidecar mode - missing prometheus ca certs path", - mode: ModeTypeSidecar, + name: "missing prometheus ca certs path", modFn: func(c *Config) { c.Telemetry.Prometheus.CACertsPath = "" }, expectErr: "Must provide -telemetry-prom-ca-certs-path, -telemetry-prom-cert-file, and -telemetry-prom-key-file to enable TLS for prometheus metrics", }, { - name: "sidecar mode - missing prometheus key file", - mode: ModeTypeSidecar, + name: "missing prometheus key file", modFn: func(c *Config) { c.Telemetry.Prometheus.KeyFile = "" }, expectErr: "Must provide -telemetry-prom-ca-certs-path, -telemetry-prom-cert-file, and -telemetry-prom-key-file to enable TLS for prometheus metrics", }, { - name: "sidecar mode - missing prometheus cert file", - mode: ModeTypeSidecar, + name: "missing prometheus cert file", modFn: func(c *Config) { c.Telemetry.Prometheus.CertFile = "" }, expectErr: "Must provide -telemetry-prom-ca-certs-path, -telemetry-prom-cert-file, and -telemetry-prom-key-file to enable TLS for prometheus metrics", }, { - name: "sidecar mode - missing prometheus retention time", - mode: ModeTypeSidecar, + name: "missing prometheus retention time", modFn: func(c *Config) { c.Telemetry.Prometheus.RetentionTime = 0 }, expectErr: "-telemetry-prom-retention-time must be greater than zero", }, { - name: "sidecar mode - missing prometheus scrape path", - mode: ModeTypeSidecar, + name: "missing prometheus scrape path", modFn: func(c *Config) { c.Telemetry.Prometheus.ScrapePath = "" }, expectErr: "-telemetry-prom-scrape-path must not be empty", }, { - name: "sidecar mode - missing xds bind address", - mode: ModeTypeSidecar, + name: "missing xds bind address", modFn: func(c *Config) { c.XDSServer.BindAddress = "" }, expectErr: "envoy xDS bind address not specified", }, { - name: "sidecar mode - non-local xds bind address", - mode: ModeTypeSidecar, + name: "non-local xds bind address", modFn: func(c *Config) { c.XDSServer.BindAddress = "1.2.3.4" }, expectErr: "non-local xDS bind address not allowed", }, { - name: "sidecar mode - non-local xds bind address", - mode: ModeTypeSidecar, + name: "non-local xds bind address", modFn: func(c *Config) { c.DNSServer.BindAddr = "1.2.3.4" c.DNSServer.Port = 1 }, - expectErr: "non-local DNS proxy bind address not allowed when running as a sidecar", + expectErr: "non-local DNS proxy bind address not allowed", }, { - name: "sidecar mode - no bearer token or path given", - mode: ModeTypeSidecar, + name: "no bearer token or path given", modFn: func(c *Config) { c.Consul.Credentials.Type = CredentialsTypeLogin c.Consul.Credentials.Login = LoginCredentialsConfig{} @@ -192,147 +171,12 @@ func TestNewConsulDPError(t *testing.T) { expectErr: "bearer token (or path to a file containing a bearer token) is required for login", }, } - - dnsProxyTestCases := []testCase{ - // dns proxy test cases - { - name: "dns-proxy mode - missing consul config", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Consul = nil }, - expectErr: "consul addresses not specified", - }, - { - name: "dns-proxy mode - missing consul addresses", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Consul.Addresses = "" }, - expectErr: "consul addresses not specified", - }, - { - name: "dns-proxy mode - missing consul server grpc port", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Consul.GRPCPort = 0 }, - expectErr: "consul server gRPC port not specified", - }, - { - name: "dns-proxy mode - no error when missing proxy config", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Proxy = nil }, - expectErr: "", - }, - { - name: "dns-proxy mode - no error when missing proxy id", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Proxy.ProxyID = "" }, - expectErr: "", - }, - { - name: "dns-proxy mode - no error when missing envoy config", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Envoy = nil }, - expectErr: "", - }, - { - name: "dns-proxy mode - no error when missing envoy admin bind address", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Envoy.AdminBindAddress = "" }, - expectErr: "", - }, - { - name: "dns-proxy mode - no error when missing envoy admin bind port", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Envoy.AdminBindPort = 0 }, - expectErr: "", - }, - { - name: "dns-proxy mode - missing logging config", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Logging = nil }, - expectErr: "logging settings not specified", - }, - { - name: "dns-proxy mode - missing prometheus ca certs path", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Telemetry.Prometheus.CACertsPath = "" }, - expectErr: "Must provide -telemetry-prom-ca-certs-path, -telemetry-prom-cert-file, and -telemetry-prom-key-file to enable TLS for prometheus metrics", - }, - { - name: "dns-proxy mode - missing prometheus key file", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Telemetry.Prometheus.KeyFile = "" }, - expectErr: "Must provide -telemetry-prom-ca-certs-path, -telemetry-prom-cert-file, and -telemetry-prom-key-file to enable TLS for prometheus metrics", - }, - { - name: "dns-proxy mode - missing prometheus cert file", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Telemetry.Prometheus.CertFile = "" }, - expectErr: "Must provide -telemetry-prom-ca-certs-path, -telemetry-prom-cert-file, and -telemetry-prom-key-file to enable TLS for prometheus metrics", - }, - { - name: "dns-proxy mode - missing prometheus retention time", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Telemetry.Prometheus.RetentionTime = 0 }, - expectErr: "-telemetry-prom-retention-time must be greater than zero", - }, - { - name: "dns-proxy mode - missing prometheus scrape path", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.Telemetry.Prometheus.ScrapePath = "" }, - expectErr: "-telemetry-prom-scrape-path must not be empty", - }, - { - name: "dns-proxy mode - no error when missing xds bind address", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { c.XDSServer.BindAddress = "" }, - expectErr: "", - }, - { - name: "dns-proxy mode - no error when non-local xds bind address", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { - c.XDSServer.BindAddress = "1.2.3.4" - }, - expectErr: "", - }, - { - name: "dns-proxy mode - non-local xds bind address", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { - c.DNSServer.BindAddr = "1.2.3.4" - c.DNSServer.Port = 1 - }, - expectErr: "", - }, - { - name: "dns-proxy mode - no bearer token or path given", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { - c.Consul.Credentials.Type = CredentialsTypeLogin - c.Consul.Credentials.Login = LoginCredentialsConfig{} - }, - expectErr: "bearer token (or path to a file containing a bearer token) is required for login", - }, - { - name: "dns-proxy mode - namespace set to non empty or default value", - mode: ModeTypeDNSProxy, - modFn: func(c *Config) { - c.Proxy.Namespace = "test" - }, - expectErr: "namespace must be empty or set to 'default' when running in dns-proxy mode", - }, - } - - testCases = append(testCases, dnsProxyTestCases...) - for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - cfg := validConfig(tc.mode) + cfg := validConfig() tc.modFn(cfg) _, err := NewConsulDP(cfg) - if tc.expectErr == "" { - require.NoError(t, err) - return - } require.EqualError(t, err, tc.expectErr) }) } diff --git a/pkg/consuldp/testdata/TestBootstrapConfig/non-default_tenancy.golden b/pkg/consuldp/testdata/TestBootstrapConfig/non-default_tenancy.golden deleted file mode 100644 index c34e65e7..00000000 --- a/pkg/consuldp/testdata/TestBootstrapConfig/non-default_tenancy.golden +++ /dev/null @@ -1,166 +0,0 @@ -{ - "admin": { - "access_log_path": "/dev/null", - "address": { - "socket_address": { - "address": "127.0.0.1", - "port_value": 19000 - } - } - }, - "node": { - "cluster": "web", - "id": "web-proxy", - "metadata": { - "node_name": "agentless-node", - "namespace": "test-namespace", - "partition": "test-partition" - } - }, - "layered_runtime": { - "layers": [ - { - "name": "base", - "static_layer": { - "re2.max_program_size.error_level": 1048576 - } - } - ] - }, - "static_resources": { - "clusters": [ - { - "name": "consul-dataplane", - "ignore_health_on_host_removal": false, - "connect_timeout": "1s", - "type": "STATIC", - "http2_protocol_options": {}, - "loadAssignment": { - "clusterName": "consul-dataplane", - "endpoints": [ - { - "lbEndpoints": [ - { - "endpoint": { - "address": { - "socket_address": { - "address": "127.0.0.1", - "port_value": 1234 - } - } - } - } - ] - } - ] - } - } - ] - }, - "stats_config": { - "stats_tags": [ - { - "regex": "^cluster\\.(?:passthrough~)?((?:([^.]+)~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.custom_hash" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:([^.]+)\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.service_subset" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:[^.]+\\.)?([^.]+)\\.[^.]+\\.(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.service" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.([^.]+)\\.(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.namespace" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:([^.]+)\\.)?[^.]+\\.internal[^.]*\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.partition" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?([^.]+)\\.internal[^.]*\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.datacenter" - }, - { - "regex": "^cluster\\.([^.]+\\.(?:[^.]+\\.)?([^.]+)\\.external\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.peer" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?[^.]+\\.([^.]+)\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.routing_type" - }, - { - "regex": "^cluster\\.(?:passthrough~)?((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?[^.]+\\.[^.]+\\.([^.]+)\\.consul\\.)", - "tag_name": "consul.destination.trust_domain" - }, - { - "regex": "^cluster\\.(?:passthrough~)?(((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?[^.]+)\\.[^.]+\\.[^.]+\\.consul\\.)", - "tag_name": "consul.destination.target" - }, - { - "regex": "^cluster\\.(?:passthrough~)?(((?:[^.]+~)?(?:[^.]+\\.)?[^.]+\\.[^.]+\\.(?:[^.]+\\.)?[^.]+\\.[^.]+\\.[^.]+)\\.consul\\.)", - "tag_name": "consul.destination.full_target" - }, - { - "regex": "^(?:tcp|http)\\.upstream(?:_peered)?\\.(([^.]+)(?:\\.[^.]+)?(?:\\.[^.]+)?\\.[^.]+\\.)", - "tag_name": "consul.upstream.service" - }, - { - "regex": "^(?:tcp|http)\\.upstream\\.([^.]+(?:\\.[^.]+)?(?:\\.[^.]+)?\\.([^.]+)\\.)", - "tag_name": "consul.upstream.datacenter" - }, - { - "regex": "^(?:tcp|http)\\.upstream_peered\\.([^.]+(?:\\.[^.]+)?\\.([^.]+)\\.)", - "tag_name": "consul.upstream.peer" - }, - { - "regex": "^(?:tcp|http)\\.upstream(?:_peered)?\\.([^.]+(?:\\.([^.]+))?(?:\\.[^.]+)?\\.[^.]+\\.)", - "tag_name": "consul.upstream.namespace" - }, - { - "regex": "^(?:tcp|http)\\.upstream\\.([^.]+(?:\\.[^.]+)?(?:\\.([^.]+))?\\.[^.]+\\.)", - "tag_name": "consul.upstream.partition" - }, - { - "tag_name": "local_cluster", - "fixed_value": "web" - }, - { - "tag_name": "consul.source.service", - "fixed_value": "web" - }, - { - "tag_name": "consul.source.namespace", - "fixed_value": "test-namespace" - }, - { - "tag_name": "consul.source.partition", - "fixed_value": "test-partition" - } - ], - "use_all_default_tags": true - }, - "dynamic_resources": { - "lds_config": { - "ads": {}, - "initial_fetch_timeout": "0s", - "resource_api_version": "V3" - }, - "cds_config": { - "ads": {}, - "initial_fetch_timeout": "0s", - "resource_api_version": "V3" - }, - "ads_config": { - "api_type": "DELTA_GRPC", - "transport_api_version": "V3", - "grpc_services": { - "envoy_grpc": { - "cluster_name": "consul-dataplane" - } - } - } - } -} diff --git a/pkg/consuldp/xds.go b/pkg/consuldp/xds.go index f3cb564f..e85e1de9 100644 --- a/pkg/consuldp/xds.go +++ b/pkg/consuldp/xds.go @@ -28,7 +28,7 @@ const ( func (cdp *ConsulDataplane) director(ctx context.Context, fullMethodName string) (context.Context, *grpc.ClientConn, error) { // check to ensure other unknown/unregistered RPCs are not proxied to the target consul server. if !strings.Contains(fullMethodName, envoyADSMethodName) { - return ctx, nil, status.Errorf(codes.Unimplemented, "Unknown method %s", fullMethodName) + return ctx, nil, status.Errorf(codes.Unimplemented, fmt.Sprintf("Unknown method %s", fullMethodName)) } var mdCopy metadata.MD diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go index 39880b2f..ee881cd7 100644 --- a/pkg/dns/dns.go +++ b/pkg/dns/dns.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/consul/proto-public/pbdns" "github.com/hashicorp/go-hclog" - "google.golang.org/grpc/metadata" ) // ErrServerDisabled is returned when the server is disabled @@ -31,10 +30,6 @@ type DNSServerParams struct { Port int Logger hclog.Logger Client pbdns.DNSServiceClient - - Partition string - Namespace string - Token string } // DNSServerInterface is the interface for athe DNSServer @@ -58,10 +53,6 @@ type DNSServer struct { client pbdns.DNSServiceClient connUDP net.PacketConn listenerTCP net.Listener - - partition string - namespace string - token string } // NewDNSServer creates a new DNS proxy server @@ -77,9 +68,6 @@ func NewDNSServer(p DNSServerParams) (DNSServerInterface, error) { s.port = p.Port s.client = p.Client s.logger = p.Logger.Named("dns-proxy") - s.partition = p.Partition - s.namespace = p.Namespace - s.token = p.Token return s, nil } @@ -106,8 +94,6 @@ func (d *DNSServer) Start(ctx context.Context) error { d.lock.Lock() defer d.lock.Unlock() - d.logger.Debug("starting DNS proxy", "partition", d.partition, "namespace", d.namespace) - if d.running { return ErrServerRunning } @@ -211,14 +197,6 @@ func (d *DNSServer) queryConsulAndRespondUDP(buf []byte, addr net.Addr) { ctx, done := context.WithTimeout(context.Background(), time.Minute*1) defer done() - ctx = metadata.AppendToOutgoingContext(ctx, - "x-consul-partition", d.partition, - "x-consul-namespace", d.namespace, - "x-consul-token", d.token, - ) - - logger.Debug("querying through udp", "partition", d.partition, "namespace", d.namespace) - resp, err := d.client.Query(ctx, req) if err != nil { logger.Error("error resolving consul request", "error", err) @@ -299,14 +277,6 @@ func (d *DNSServer) proxyTCPAcceptedConn(ctx context.Context, conn net.Conn, cli ctx, done := context.WithTimeout(context.Background(), time.Minute*1) defer done() - ctx = metadata.AppendToOutgoingContext(ctx, - "x-consul-partition", d.partition, - "x-consul-namespace", d.namespace, - "x-consul-token", d.token, - ) - - logger.Debug("querying through tcp", "partition", d.partition, "namespace", d.namespace) - resp, err := client.Query(ctx, req) if err != nil { logger.Error("error resolving consul request", "error", err) diff --git a/pkg/dns/dns_test.go b/pkg/dns/dns_test.go index 6a9f984f..32c9916a 100644 --- a/pkg/dns/dns_test.go +++ b/pkg/dns/dns_test.go @@ -17,9 +17,7 @@ import ( "github.com/hashicorp/consul/proto-public/pbdns" "github.com/hashicorp/go-hclog" "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "google.golang.org/grpc/metadata" "github.com/hashicorp/consul-dataplane/pkg/dns/mocks" ) @@ -132,12 +130,9 @@ func (s *DNSTestSuite) Test_UDPProxy() { defer cancel() server := DNSServer{ - client: mockedDNSConsulClient, - connUDP: connUdp, - logger: hclog.Default(), - partition: "test-partition", - namespace: "test-namespace", - token: "test-token", + client: mockedDNSConsulClient, + connUDP: connUdp, + logger: hclog.Default(), } go server.proxyUDP(runCtx) @@ -180,17 +175,6 @@ func (s *DNSTestSuite) Test_UDPProxy() { } mockedDNSConsulClient.On("Query", mock.Anything, mock.Anything). - Run(func(args mock.Arguments) { - ctx, ok := args.Get(0).(context.Context) - require.True(s.T(), ok, "error casting to context.Context") - - md, ok := metadata.FromOutgoingContext(ctx) - require.True(s.T(), ok, "error getting metadata from context") - - require.Equal(s.T(), "test-token", md.Get("x-consul-token")[0], "token not set in context") - require.Equal(s.T(), "test-namespace", md.Get("x-consul-namespace")[0], "namespace not set in context") - require.Equal(s.T(), "test-partition", md.Get("x-consul-partition")[0], "partition not set in context") - }). Return(clientResp, tc.expectedGRPC).Once() addr := fmt.Sprintf("127.0.0.1:%v", server.UdpPort()) @@ -238,9 +222,6 @@ func (s *DNSTestSuite) Test_ProxydnsTCP() { client: mockedDNSConsulClient, listenerTCP: listenerTCP, logger: hclog.Default(), - partition: "test-partition", - namespace: "test-namespace", - token: "test-token", } go server.proxyTCP(runCtx) @@ -282,17 +263,6 @@ func (s *DNSTestSuite) Test_ProxydnsTCP() { } mockedDNSConsulClient.On("Query", mock.Anything, mock.Anything). - Run(func(args mock.Arguments) { - ctx, ok := args.Get(0).(context.Context) - require.True(s.T(), ok, "error casting to context.Context") - - md, ok := metadata.FromOutgoingContext(ctx) - require.True(s.T(), ok, "error getting metadata from context") - - require.Equal(s.T(), "test-token", md.Get("x-consul-token")[0], "token not set in context") - require.Equal(s.T(), "test-namespace", md.Get("x-consul-namespace")[0], "namespace not set in context") - require.Equal(s.T(), "test-partition", md.Get("x-consul-partition")[0], "partition not set in context") - }). Return(clientResp, tc.expectedGRPC). Once() addr := fmt.Sprintf("127.0.0.1:%v", server.TcpPort()) diff --git a/pkg/version/version.go b/pkg/version/version.go index 3bd1170c..c60b0524 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -17,7 +17,7 @@ var ( // // Version must conform to the format expected by github.com/hashicorp/go-version // for tests to work. - Version = "1.6.0" + Version = "1.4.4" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release