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/310.txt b/.changelog/314.txt similarity index 100% rename from .changelog/310.txt rename to .changelog/314.txt diff --git a/.changelog/372.txt b/.changelog/372.txt deleted file mode 100644 index 5f05e056..00000000 --- a/.changelog/372.txt +++ /dev/null @@ -1,6 +0,0 @@ -```release-note:improvement -Propagate merged metrics request query params to Envoy to enable metrics filtering. -``` -```release-note:bug -Exclude Prometheus scrape path query params from Envoy path match s.t. it does not break merged metrics request routing. -``` diff --git a/.changelog/373.txt b/.changelog/373.txt index 13b2bd8d..dda65b4d 100644 --- a/.changelog/373.txt +++ b/.changelog/373.txt @@ -1,3 +1,3 @@ ```release-note:security Upgrade OpenShift container images to use `ubi9-minimal:9.3` as the base image. - ``` +``` diff --git a/.changelog/416.txt b/.changelog/421.txt similarity index 81% rename from .changelog/416.txt rename to .changelog/421.txt index e64bd405..8159e749 100644 --- a/.changelog/416.txt +++ b/.changelog/421.txt @@ -1,6 +1,3 @@ -```release-note:improvement -Update Envoy version from 1.27 to 1.28 -``` ```release-note:security -Update Envoy version to 1.28.1 to address [CVE-2024-23324](https://github.com/envoyproxy/envoy/security/advisories/GHSA-gq3v-vvhj-96j6), [CVE-2024-23325](https://github.com/envoyproxy/envoy/security/advisories/GHSA-5m7c-mrwr-pm26), [CVE-2024-23322](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6p83-mfmh-qv38), [CVE-2024-23323](https://github.com/envoyproxy/envoy/security/advisories/GHSA-x278-4w4x-r7ch), [CVE-2024-23327](https://github.com/envoyproxy/envoy/security/advisories/GHSA-4h5x-x9vh-m29j), and [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) +Update Envoy version to 1.27.3 to address [CVE-2024-23324](https://github.com/envoyproxy/envoy/security/advisories/GHSA-gq3v-vvhj-96j6), [CVE-2024-23325](https://github.com/envoyproxy/envoy/security/advisories/GHSA-5m7c-mrwr-pm26), [CVE-2024-23322](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6p83-mfmh-qv38), [CVE-2024-23323](https://github.com/envoyproxy/envoy/security/advisories/GHSA-x278-4w4x-r7ch), [CVE-2024-23327](https://github.com/envoyproxy/envoy/security/advisories/GHSA-4h5x-x9vh-m29j), and [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) ``` diff --git a/.changelog/474.txt b/.changelog/477.txt similarity index 88% rename from .changelog/474.txt rename to .changelog/477.txt index d674b7ec..b12b3b2d 100644 --- a/.changelog/474.txt +++ b/.changelog/477.txt @@ -4,7 +4,7 @@ Upgrade to use Go `1.21.9`. This resolves CVE ``` ```release-note:security -Upgrade to support Envoy `1.28.2`. This resolves CVE +Upgrade to support Envoy `1.27.4`. This resolves CVE [CVE-2024-27919](https://nvd.nist.gov/vuln/detail/CVE-2024-27919) (`http2`). ``` diff --git a/.changelog/496.txt b/.changelog/497.txt similarity index 64% rename from .changelog/496.txt rename to .changelog/497.txt index 44751494..7b9d5dc5 100644 --- a/.changelog/496.txt +++ b/.changelog/497.txt @@ -1,4 +1,4 @@ ```release-note:security -Upgrade to support Envoy `1.28.3`. This resolves CVE +Upgrade to support Envoy `1.27.5`. This resolves CVE [CVE-2024-32475](https://nvd.nist.gov/vuln/detail/CVE-2024-32475). ``` 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/.github/workflows/build.yml b/.github/workflows/build.yml index 9b91f138..7e39929b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -355,12 +355,10 @@ jobs: server: - version: v1.15.0-dev image: hashicorppreview/consul:1.15-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 + - version: v1.16.0-dev + image: hashicorppreview/consul:1.16-dev + - version: v1.17.0-dev + image: hashicorppreview/consul:1.17-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 c38fe69b..427e11ca 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -40,7 +40,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 @@ -59,4 +60,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/.golangci.yml b/.golangci.yml index 2ead2dec..78d6e7df 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - issues: exclude-rules: # Allow usage of deprecated values. diff --git a/CHANGELOG.md b/CHANGELOG.md index 084487ce..c9b84cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,4 @@ -## 1.4.2 (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.28.2`. This resolves CVE - [CVE-2024-27919](https://nvd.nist.gov/vuln/detail/CVE-2024-27919) (`http2`). [[GH-474](https://github.com/hashicorp/consul-dataplane/pull/474)] -* Upgrade to support Envoy `1.28.3`. This resolves CVE - [CVE-2024-32475](https://nvd.nist.gov/vuln/detail/CVE-2024-32475). [[GH-496](https://github.com/hashicorp/consul-dataplane/pull/496)] -* Upgrade to use Go `1.21.9`. This resolves CVE - [CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288) (`http2`). [[GH-474](https://github.com/hashicorp/consul-dataplane/pull/474)] -* 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-474](https://github.com/hashicorp/consul-dataplane/pull/474)] - -IMPROVEMENTS: - -* Upgrade Go to use 1.22.3. [[GH-501](https://github.com/hashicorp/consul-dataplane/pull/501)] - -## 1.3.4 (May 20, 2024) +## 1.3.4 (May 24, 2024) SECURITY: * Upgrade Go to use 1.21.10. This addresses CVEs @@ -36,76 +16,6 @@ SECURITY: IMPROVEMENTS: * Upgrade Go to use 1.22.3. [[GH-501](https://github.com/hashicorp/consul-dataplane/pull/501)] - -## 1.2.8 (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-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.3.3 (February 14, 2024) - -SECURITY: - -* Update Envoy version to 1.27.3 to address [CVE-2024-23324](https://github.com/envoyproxy/envoy/security/advisories/GHSA-gq3v-vvhj-96j6), [CVE-2024-23325](https://github.com/envoyproxy/envoy/security/advisories/GHSA-5m7c-mrwr-pm26), [CVE-2024-23322](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6p83-mfmh-qv38), [CVE-2024-23323](https://github.com/envoyproxy/envoy/security/advisories/GHSA-x278-4w4x-r7ch), [CVE-2024-23327](https://github.com/envoyproxy/envoy/security/advisories/GHSA-4h5x-x9vh-m29j), and [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-421](https://github.com/hashicorp/consul-dataplane/pull/421)] - -IMPROVEMENTS: - -* Upgrade to use Go 1.21.7. [[GH-411](https://github.com/hashicorp/consul-dataplane/pull/411)] - -## 1.4.0 (February 28, 2024) - -SECURITY: - -* Update Envoy version to 1.27.2 to address [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-310](https://github.com/hashicorp/consul-dataplane/pull/310)] -* Update Envoy version to 1.28.1 to address [CVE-2024-23324](https://github.com/envoyproxy/envoy/security/advisories/GHSA-gq3v-vvhj-96j6), [CVE-2024-23325](https://github.com/envoyproxy/envoy/security/advisories/GHSA-5m7c-mrwr-pm26), [CVE-2024-23322](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6p83-mfmh-qv38), [CVE-2024-23323](https://github.com/envoyproxy/envoy/security/advisories/GHSA-x278-4w4x-r7ch), [CVE-2024-23327](https://github.com/envoyproxy/envoy/security/advisories/GHSA-4h5x-x9vh-m29j), and [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-416](https://github.com/hashicorp/consul-dataplane/pull/416)] -* 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)] - -FEATURES: - -* Add metrics exporting directly to HCP when configured in core. [[GH-370](https://github.com/hashicorp/consul-dataplane/pull/370)] - -IMPROVEMENTS: - -* Propagate merged metrics request query params to Envoy to enable metrics filtering. [[GH-372](https://github.com/hashicorp/consul-dataplane/pull/372)] -* Update Envoy version from 1.27 to 1.28 [[GH-416](https://github.com/hashicorp/consul-dataplane/pull/416)] - -BUG FIXES: - -* Exclude Prometheus scrape path query params from Envoy path match s.t. it does not break merged metrics request routing. [[GH-372](https://github.com/hashicorp/consul-dataplane/pull/372)] - ## 1.3.3 (February 14, 2024) SECURITY: @@ -116,16 +26,6 @@ IMPROVEMENTS: * Upgrade to use Go 1.21.7. [[GH-411](https://github.com/hashicorp/consul-dataplane/pull/411)] -## 1.2.6 (February 14, 2024) - -SECURITY: - -* Update Envoy version to 1.26.7 to address [CVE-2024-23324](https://github.com/envoyproxy/envoy/security/advisories/GHSA-gq3v-vvhj-96j6), [CVE-2024-23325](https://github.com/envoyproxy/envoy/security/advisories/GHSA-5m7c-mrwr-pm26), [CVE-2024-23322](https://github.com/envoyproxy/envoy/security/advisories/GHSA-6p83-mfmh-qv38), [CVE-2024-23323](https://github.com/envoyproxy/envoy/security/advisories/GHSA-x278-4w4x-r7ch), [CVE-2024-23327](https://github.com/envoyproxy/envoy/security/advisories/GHSA-4h5x-x9vh-m29j), and [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-417](https://github.com/hashicorp/consul-dataplane/pull/417)] - -IMPROVEMENTS: - -* Upgrade to use Go 1.21.7. [[GH-411](https://github.com/hashicorp/consul-dataplane/pull/411)] - ## 1.3.2 (January 24, 2024) SECURITY: @@ -136,26 +36,6 @@ IMPROVEMENTS: * Upgrade to use Go 1.21.6. [[GH-384](https://github.com/hashicorp/consul-dataplane/pull/384)] -## 1.2.5 (January 24, 2024) - -SECURITY: - -* Upgrade OpenShift container images to use `ubi9-minimal:9.3` as the base image. [[GH-373](https://github.com/hashicorp/consul-dataplane/pull/373)] - -IMPROVEMENTS: - -* Upgrade to use Go 1.21.6. [[GH-384](https://github.com/hashicorp/consul-dataplane/pull/384)] - -## 1.1.8 (January 24, 2024) - -SECURITY: - -* Upgrade OpenShift container images to use `ubi9-minimal:9.3` as the base image. [[GH-373](https://github.com/hashicorp/consul-dataplane/pull/373)] - -IMPROVEMENTS: - -* Upgrade to use Go 1.21.6. [[GH-384](https://github.com/hashicorp/consul-dataplane/pull/384)] - ## 1.3.1 (December 18, 2023) SECURITY: @@ -171,34 +51,6 @@ BUG FIXES: * Fix issue where the internal grpc-proxy would hit the max message size limit for xDS streams with a large amount of configuration. [[GH-357](https://github.com/hashicorp/consul-dataplane/pull/357)] -## 1.2.4 (December 18, 2023) - -SECURITY: - -* Upgrade to use Go 1.20.12. This resolves CVEs - [CVE-2023-45283](https://nvd.nist.gov/vuln/detail/CVE-2023-45283): (`path/filepath`) recognize \??\ as a Root Local Device path prefix (Windows) - [CVE-2023-45284](https://nvd.nist.gov/vuln/detail/CVE-2023-45285): recognize device names with trailing spaces and superscripts (Windows) - [CVE-2023-39326](https://nvd.nist.gov/vuln/detail/CVE-2023-39326): (`net/http`) limit chunked data overhead - [CVE-2023-45285](https://nvd.nist.gov/vuln/detail/CVE-2023-45285): (`cmd/go`) go get may unexpectedly fallback to insecure git [[GH-353](https://github.com/hashicorp/consul-dataplane/pull/353)] - -BUG FIXES: - -* Fix issue where the internal grpc-proxy would hit the max message size limit for xDS streams with a large amount of configuration. [[GH-357](https://github.com/hashicorp/consul-dataplane/pull/357)] - -## 1.1.7 (December 18, 2023) - -SECURITY: - -* Upgrade to use Go 1.20.12. This resolves CVEs - [CVE-2023-45283](https://nvd.nist.gov/vuln/detail/CVE-2023-45283): (`path/filepath`) recognize \??\ as a Root Local Device path prefix (Windows) - [CVE-2023-45284](https://nvd.nist.gov/vuln/detail/CVE-2023-45285): recognize device names with trailing spaces and superscripts (Windows) - [CVE-2023-39326](https://nvd.nist.gov/vuln/detail/CVE-2023-39326): (`net/http`) limit chunked data overhead - [CVE-2023-45285](https://nvd.nist.gov/vuln/detail/CVE-2023-45285): (`cmd/go`) go get may unexpectedly fallback to insecure git [[GH-353](https://github.com/hashicorp/consul-dataplane/pull/353)] - -BUG FIXES: - -* Fix issue where the internal grpc-proxy would hit the max message size limit for xDS streams with a large amount of configuration. [[GH-357](https://github.com/hashicorp/consul-dataplane/pull/357)] - ## 1.3.0 (November 6, 2023) SECURITY: @@ -210,57 +62,6 @@ SECURITY: This resolves [CVE-2023-39325](https://nvd.nist.gov/vuln/detail/CVE-2023-39325) / [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-299](https://github.com/hashicorp/consul-dataplane/pull/299)] -## 1.2.3 (November 1, 2023) - -SECURITY: - -* Update Envoy version to 1.26.6 to address [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-313](https://github.com/hashicorp/consul-dataplane/pull/313)] -* Upgrade `google.golang.org/grpc` to 1.56.3. - This resolves vulnerability [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-323](https://github.com/hashicorp/consul-dataplane/pull/323)] -* Upgrade to use Go 1.20.10 and `x/net` 0.17.0. - This resolves [CVE-2023-39325](https://nvd.nist.gov/vuln/detail/CVE-2023-39325) - / [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-299](https://github.com/hashicorp/consul-dataplane/pull/299)] -* Upgrade to use Go 1.20.8. This resolves CVEs - [CVE-2023-39320](https://github.com/advisories/GHSA-rxv8-v965-v333) (`cmd/go`), - [CVE-2023-39318](https://github.com/advisories/GHSA-vq7j-gx56-rxjh) (`html/template`), - [CVE-2023-39319](https://github.com/advisories/GHSA-vv9m-32rr-3g55) (`html/template`), - [CVE-2023-39321](https://github.com/advisories/GHSA-9v7r-x7cv-v437) (`crypto/tls`), and - [CVE-2023-39322](https://github.com/advisories/GHSA-892h-r6cr-53g4) (`crypto/tls`) [[GH-261](https://github.com/hashicorp/consul-dataplane/pull/261)] - -## 1.1.6 (November 1, 2023) - -SECURITY: - -* Update Envoy version to 1.25.11 to address [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-312](https://github.com/hashicorp/consul-dataplane/pull/312)] -* Upgrade `google.golang.org/grpc` to 1.56.3. - This resolves vulnerability [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-323](https://github.com/hashicorp/consul-dataplane/pull/323)] -* Upgrade to use Go 1.20.10 and `x/net` 0.17.0. - This resolves [CVE-2023-39325](https://nvd.nist.gov/vuln/detail/CVE-2023-39325) - / [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-299](https://github.com/hashicorp/consul-dataplane/pull/299)] -* Upgrade to use Go 1.20.8. This resolves CVEs - [CVE-2023-39320](https://github.com/advisories/GHSA-rxv8-v965-v333) (`cmd/go`), - [CVE-2023-39318](https://github.com/advisories/GHSA-vq7j-gx56-rxjh) (`html/template`), - [CVE-2023-39319](https://github.com/advisories/GHSA-vv9m-32rr-3g55) (`html/template`), - [CVE-2023-39321](https://github.com/advisories/GHSA-9v7r-x7cv-v437) (`crypto/tls`), and - [CVE-2023-39322](https://github.com/advisories/GHSA-892h-r6cr-53g4) (`crypto/tls`) [[GH-261](https://github.com/hashicorp/consul-dataplane/pull/261)] - -## 1.0.7 (November 1, 2023) - -SECURITY: - -* Update Envoy version to 1.24.12 to address [CVE-2023-44487](https://github.com/envoyproxy/envoy/security/advisories/GHSA-jhv4-f7mr-xx76) [[GH-311](https://github.com/hashicorp/consul-dataplane/pull/311)] -* Upgrade `google.golang.org/grpc` to 1.56.3. - This resolves vulnerability [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-323](https://github.com/hashicorp/consul-dataplane/pull/323)] -* Upgrade to use Go 1.20.10 and `x/net` 0.17.0. - This resolves [CVE-2023-39325](https://nvd.nist.gov/vuln/detail/CVE-2023-39325) - / [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487). [[GH-299](https://github.com/hashicorp/consul-dataplane/pull/299)] -* Upgrade to use Go 1.20.8. This resolves CVEs - [CVE-2023-39320](https://github.com/advisories/GHSA-rxv8-v965-v333) (`cmd/go`), - [CVE-2023-39318](https://github.com/advisories/GHSA-vq7j-gx56-rxjh) (`html/template`), - [CVE-2023-39319](https://github.com/advisories/GHSA-vv9m-32rr-3g55) (`html/template`), - [CVE-2023-39321](https://github.com/advisories/GHSA-9v7r-x7cv-v437) (`crypto/tls`), and - [CVE-2023-39322](https://github.com/advisories/GHSA-892h-r6cr-53g4) (`crypto/tls`) [[GH-261](https://github.com/hashicorp/consul-dataplane/pull/261)] - ## 1.3.0-rc1 (October 10, 2023) SECURITY: @@ -299,99 +100,6 @@ BUG FIXES: * Fix a bug where exiting envoy would inadvertently throw an error [[GH-175](https://github.com/hashicorp/consul-dataplane/pull/175)] * Fix a bug with Envoy potentially starting with incomplete configuration by not waiting enough for initial xDS configuration. [[GH-140](https://github.com/hashicorp/consul-dataplane/pull/140)] -## 1.2.2 (September 5, 2023) - -SECURITY: - -* Update to Go 1.20.7 and Envoy 1.26.4 within the Dockerfile. [[GH-235](https://github.com/hashicorp/consul-dataplane/pull/235)] - -BUG FIXES: - -* Fix a bug where container user was unable to bind to privileged ports (< 1024). The consul-dataplane container now requires the NET_BIND_SERVICE capability. [[GH-238](https://github.com/hashicorp/consul-dataplane/pull/238)] - -## 1.1.5 (September 5, 2023) - -SECURITY: - -* Update to Go 1.20.7 and Envoy 1.25.9 within the Dockerfile. [[GH-236](https://github.com/hashicorp/consul-dataplane/pull/236)] - -BUG FIXES: - -* Fix a bug where container user was unable to bind to privileged ports (< 1024). The consul-dataplane container now requires the NET_BIND_SERVICE capability. [[GH-238](https://github.com/hashicorp/consul-dataplane/pull/238)] - -## 1.0.6 (September 5, 2023) - -SECURITY: - -* Update to Go 1.20.7 and Envoy 1.24.10 within the Dockerfile. [[GH-237](https://github.com/hashicorp/consul-dataplane/pull/237)] - -BUG FIXES: - -* Fix a bug where container user was unable to bind to privileged ports (< 1024). The consul-dataplane container now requires the NET_BIND_SERVICE capability. [[GH-238](https://github.com/hashicorp/consul-dataplane/pull/238)] - -## 1.2.1 (August 9, 2023) - -SECURITY: - -* Upgrade to use Go 1.20.7 and `x/net/http` 0.12.0. - This resolves [CVE-2023-29406](https://github.com/advisories/GHSA-f8f7-69v5-w4vx)(`net/http`). [[GH-219](https://github.com/hashicorp/consul-dataplane/pull/219)] -* Upgrade to use Go 1.20.7 and `x/net` 0.13.0. - This resolves [CVE-2023-29409](https://nvd.nist.gov/vuln/detail/CVE-2023-29409)(`crypto/tls`) - and [CVE-2023-3978](https://nvd.nist.gov/vuln/detail/CVE-2023-3978)(`net/html`). [[GH-227](https://github.com/hashicorp/consul-dataplane/pull/227)] - -FEATURES: - -* Add -shutdown-drain-listeners, -shutdown-grace-period, -graceful-shutdown-path and -graceful-port flags to configure proxy lifecycle management settings for the Envoy container. [[GH-100](https://github.com/hashicorp/consul-dataplane/pull/100)] -* Add HTTP server with configurable port and endpoint path for initiating graceful shutdown. [[GH-115](https://github.com/hashicorp/consul-dataplane/pull/115)] -* Catch SIGTERM and SIGINT to initate graceful shutdown in accordance with proxy lifecycle management configuration. [[GH-130](https://github.com/hashicorp/consul-dataplane/pull/130)] - -IMPROVEMENTS: - -* connect: Add capture group labels from Envoy cluster FQDNs to Envoy exported metric labels [[GH-184](https://github.com/hashicorp/consul-dataplane/pull/184)] - -BUG FIXES: - -* Add support for envoy-extra-args. Fixes [Envoy extra-args annotation crashing consul-dataplane container](https://github.com/hashicorp/consul-k8s/issues/1846). [[GH-133](https://github.com/hashicorp/consul-dataplane/pull/133)] -* Fix a bug where exiting envoy would inadvertently throw an error [[GH-175](https://github.com/hashicorp/consul-dataplane/pull/175)] -* Fix a bug with Envoy potentially starting with incomplete configuration by not waiting enough for initial xDS configuration. [[GH-140](https://github.com/hashicorp/consul-dataplane/pull/140)] - - -## 1.1.4 (August 9, 2023) - -SECURITY: - -* Upgrade to use Go 1.20.6 and `x/net/http` 0.12.0. - This resolves [CVE-2023-29406](https://github.com/advisories/GHSA-f8f7-69v5-w4vx)(`net/http`). [[GH-219](https://github.com/hashicorp/consul-dataplane/pull/219)] -* Upgrade to use Go 1.20.7 and `x/net` 0.13.0. - This resolves [CVE-2023-29409](https://nvd.nist.gov/vuln/detail/CVE-2023-29409)(`crypto/tls`) - and [CVE-2023-3978](https://nvd.nist.gov/vuln/detail/CVE-2023-3978)(`net/html`). [[GH-227](https://github.com/hashicorp/consul-dataplane/pull/227)] - -IMPROVEMENTS: - -* connect: Add capture group labels from Envoy cluster FQDNs to Envoy exported metric labels [[GH-184](https://github.com/hashicorp/consul-dataplane/pull/184)] - -BUG FIXES: - -* Fix a bug with Envoy potentially starting with incomplete configuration by not waiting enough for initial xDS configuration. [[GH-140](https://github.com/hashicorp/consul-dataplane/pull/140)] - -## 1.0.5 (August 9, 2023) - -SECURITY: - -* Upgrade to use Go 1.20.6 and `x/net/http` 0.12.0. - This resolves [CVE-2023-29406](https://github.com/advisories/GHSA-f8f7-69v5-w4vx)(`net/http`). [[GH-219](https://github.com/hashicorp/consul-dataplane/pull/219)] -* Upgrade to use Go 1.20.7 and `x/net` 0.13.0. - This resolves [CVE-2023-29409](https://nvd.nist.gov/vuln/detail/CVE-2023-29409)(`crypto/tls`) - and [CVE-2023-3978](https://nvd.nist.gov/vuln/detail/CVE-2023-3978)(`net/html`). [[GH-227](https://github.com/hashicorp/consul-dataplane/pull/227)] - -IMPROVEMENTS: - -* connect: Add capture group labels from Envoy cluster FQDNs to Envoy exported metric labels [[GH-184](https://github.com/hashicorp/consul-dataplane/pull/184)] - -BUG FIXES: - -* Fix a bug with Envoy potentially starting with incomplete configuration by not waiting enough for initial xDS configuration. [[GH-140](https://github.com/hashicorp/consul-dataplane/pull/140)] - ## 1.2.0 (June 28, 2023) SECURITY: @@ -400,41 +108,6 @@ SECURITY: * Update to Envoy 1.26.2 within the Dockerfile. [[GH-142](https://github.com/hashicorp/consul-dataplane/pull/142)] * Update to Go 1.20.4 and Envoy 1.26.1 within the Dockerfile. [[GH-97](https://github.com/hashicorp/consul-dataplane/pull/97)] - -## 1.1.3 (June 28, 2023) - -SECURITY: - -* Update go-discover to 214571b6a5309addf3db7775f4ee8cf4d264fd5f within the Dockerfile. [[GH-153](https://github.com/hashicorp/consul-dataplane/pull/153)] - -FEATURES: - -* Add -shutdown-drain-listeners, -shutdown-grace-period, -graceful-shutdown-path and -graceful-port flags to configure proxy lifecycle management settings for the Envoy container. [[GH-100](https://github.com/hashicorp/consul-dataplane/pull/100)] -* Add HTTP server with configurable port and endpoint path for initiating graceful shutdown. [[GH-115](https://github.com/hashicorp/consul-dataplane/pull/115)] -* Catch SIGTERM and SIGINT to initate graceful shutdown in accordance with proxy lifecycle management configuration. [[GH-130](https://github.com/hashicorp/consul-dataplane/pull/130)] - -BUG FIXES: - -* Add support for envoy-extra-args. Fixes [Envoy extra-args annotation crashing consul-dataplane container](https://github.com/hashicorp/consul-k8s/issues/1846). [[GH-133](https://github.com/hashicorp/consul-dataplane/pull/133)] -* Fix a bug where exiting envoy would inadvertently throw an error [[GH-175](https://github.com/hashicorp/consul-dataplane/pull/175)] - -## 1.0.4 (June 28, 2023) - -SECURITY: - -* Update go-discover to 214571b6a5309addf3db7775f4ee8cf4d264fd5f within the Dockerfile. [[GH-153](https://github.com/hashicorp/consul-dataplane/pull/153)] - -FEATURES: - -* Add -shutdown-drain-listeners, -shutdown-grace-period, -graceful-shutdown-path and -graceful-port flags to configure proxy lifecycle management settings for the Envoy container. [[GH-100](https://github.com/hashicorp/consul-dataplane/pull/100)] -* Add HTTP server with configurable port and endpoint path for initiating graceful shutdown. [[GH-115](https://github.com/hashicorp/consul-dataplane/pull/115)] -* Catch SIGTERM and SIGINT to initate graceful shutdown in accordance with proxy lifecycle management configuration. [[GH-130](https://github.com/hashicorp/consul-dataplane/pull/130)] - -BUG FIXES: - -* Add support for envoy-extra-args. Fixes [Envoy extra-args annotation crashing consul-dataplane container](https://github.com/hashicorp/consul-k8s/issues/1846). [[GH-133](https://github.com/hashicorp/consul-dataplane/pull/133)] -* Fix a bug where exiting envoy would inadvertently throw an error [[GH-175](https://github.com/hashicorp/consul-dataplane/pull/175)] - ## 1.1.2 (June 1, 2023) BUG FIXES: diff --git a/Dockerfile b/Dockerfile index 9495f8c4..27c88e5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ # prebuilt binaries in any other form. # ARG GOLANG_VERSION -FROM envoyproxy/envoy-distroless:v1.29.4 as envoy-binary +FROM envoyproxy/envoy-distroless:v1.27.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.4-fips1402 as envoy-fips-binary +FROM hashicorp/envoy-fips:1.27.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/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index 8339782e..00000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,10 +0,0 @@ -# DANGER: this dockerfile is experimental and could be modified/removed at any time. -# A simple image for testing changes to consul-dataplane -# -# Meant to be used with the following make target -# DEV_IMAGE= make skaffold - -FROM hashicorp/consul-dataplane as cache -ARG TARGETARCH - -COPY dist/linux/${TARGETARCH}/consul-dataplane /usr/local/bin/ diff --git a/Makefile b/Makefile index ada7c187..123e7524 100644 --- a/Makefile +++ b/Makefile @@ -151,15 +151,6 @@ ifndef DP_NEXT_RELEASE_VERSION endif @$(CURDIR)/build-scripts/prepare-release.sh $(CURDIR)/pkg/version/version.go $(DP_NEXT_RELEASE_VERSION) "dev" -# This generates mocks against public proto packages in consul. At the time of writing, -# only the dns and resource packages are used in consul-dataplane so only mocks for their -# interfaces are generated here. -.PHONY: mocks -mocks: - for pkg in pbdns pbresource; do \ - mockery --srcpkg=github.com/hashicorp/consul/proto-public/$$pkg --output ./internal/mocks/$${pkg}mock --outpkg $${pkg}mock --case underscore --all; \ - done - .PHONY: go-mod-get go-mod-get: $(foreach mod,$(GO_MODULES),go-mod-get/$(mod)) ## Run go get and go mod tidy in every module for the given dependency diff --git a/go.mod b/go.mod index d27502fd..c98ca432 100644 --- a/go.mod +++ b/go.mod @@ -2,18 +2,21 @@ module github.com/hashicorp/consul-dataplane go 1.20 +// This replace directive is needed because `api` requires 0.4.1 of proto-public but we need an unreleased version +replace github.com/hashicorp/consul/proto-public v0.4.1 => github.com/hashicorp/consul/proto-public v0.1.2-0.20230929231147-632fd65c091c + 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.8 - github.com/hashicorp/consul/proto-public v0.6.1 + github.com/hashicorp/consul-server-connection-manager v0.1.6 + github.com/hashicorp/consul/proto-public v0.4.1 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.8.4 + github.com/stretchr/testify v1.8.3 google.golang.org/grpc v1.56.3 google.golang.org/protobuf v1.33.0 ) diff --git a/go.sum b/go.sum index e81ea690..7d03aac7 100644 --- a/go.sum +++ b/go.sum @@ -145,10 +145,10 @@ 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.8 h1:ZXSWoqeoieyZq55X40NA9t0a+vokyg8cAlmgMSvvA4k= -github.com/hashicorp/consul-server-connection-manager v0.1.8/go.mod h1:ca1Mq2xBFnFPpW+X+CBct8z59YmSkuW5VEMqnV141H4= -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-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.1.2-0.20230929231147-632fd65c091c h1:d1ULTfDs6Hha01yfITC55MPGIsQpv0VqQfS45WZHJiY= +github.com/hashicorp/consul/proto-public v0.1.2-0.20230929231147-632fd65c091c/go.mod h1:KAOxsaELPpA7JX10kMeygAskAqsQnu3SPgeruMhYZMU= 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= @@ -188,6 +188,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/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.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= 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= @@ -210,7 +211,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -249,6 +249,7 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= 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.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -265,8 +266,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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.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/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/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= @@ -569,7 +570,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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/bootstrap/bootstrap_config.go b/internal/bootstrap/bootstrap_config.go index 51ee754d..abfcf1b7 100644 --- a/internal/bootstrap/bootstrap_config.go +++ b/internal/bootstrap/bootstrap_config.go @@ -16,8 +16,6 @@ import ( "path" "strings" "text/template" - - "github.com/hashicorp/go-hclog" ) const ( @@ -161,17 +159,6 @@ type BootstrapConfig struct { // the bootstrap config. It's format may vary based on Envoy version used. // See https://www.envoyproxy.io/docs/envoy/v1.9.0/api-v2/config/trace/v2/trace.proto. TracingConfigJSON string `mapstructure:"envoy_tracing_json"` - - Logger hclog.Logger -} - -// log returns the Logger for BootstrapConfig or a null Logger if none is configured. -// This method is meant to support tests that do not configure a Logger. -func (c *BootstrapConfig) log() hclog.Logger { - if c.Logger == nil { - return hclog.NewNullLogger() - } - return c.Logger } // Template returns the bootstrap template to use as a base. @@ -654,24 +641,6 @@ func (c *BootstrapConfig) generateListenerConfig(args *BootstrapTplArgs, bindAdd clusterPort = prometheusBackendPort clusterName = "prometheus_backend" } - - if !strings.HasPrefix(matchValue, "/") { - // Must begin with '/' for match to work and to support request URL parsing. - // - // Warn rather than returning an error for the sake of backwards compatibility. - c.log().Warn(fmt.Sprintf("%s path %s must begin with '/', adding for path match", name, matchValue)) - matchValue = "/" + matchValue - } - if u, err := url.ParseRequestURI(matchValue); err == nil && u.RawQuery != "" { - // Strip query params from the match value (prefix or path), since Envoy does - // not expect a query and will strip the query from a request path before - // comparing against the configured value (i.e. the match value must not ever - // have a query in order to work). - // - // Warn rather than returning an error for the sake of backwards compatibility. - c.log().Warn(fmt.Sprintf("%s path %s must not contain a query, stripping for path match", name, matchValue)) - matchValue = u.Path - } clusterJSON := `{ "name": "` + clusterName + `", diff --git a/internal/mocks/pbdnsmock/dns_service_client.go b/internal/mocks/pbdnsmock/dns_service_client.go deleted file mode 100644 index dbdfb3fa..00000000 --- a/internal/mocks/pbdnsmock/dns_service_client.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbdnsmock - -import ( - context "context" - - grpc "google.golang.org/grpc" - - mock "github.com/stretchr/testify/mock" - - pbdns "github.com/hashicorp/consul/proto-public/pbdns" -) - -// DNSServiceClient is an autogenerated mock type for the DNSServiceClient type -type DNSServiceClient struct { - mock.Mock -} - -// Query provides a mock function with given fields: ctx, in, opts -func (_m *DNSServiceClient) Query(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption) (*pbdns.QueryResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbdns.QueryResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) (*pbdns.QueryResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) *pbdns.QueryResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbdns.QueryResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewDNSServiceClient creates a new instance of DNSServiceClient. 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 NewDNSServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *DNSServiceClient { - mock := &DNSServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbdnsmock/dns_service_server.go b/internal/mocks/pbdnsmock/dns_service_server.go deleted file mode 100644 index 705aaf63..00000000 --- a/internal/mocks/pbdnsmock/dns_service_server.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbdnsmock - -import ( - context "context" - - pbdns "github.com/hashicorp/consul/proto-public/pbdns" - mock "github.com/stretchr/testify/mock" -) - -// DNSServiceServer is an autogenerated mock type for the DNSServiceServer type -type DNSServiceServer struct { - mock.Mock -} - -// Query provides a mock function with given fields: _a0, _a1 -func (_m *DNSServiceServer) Query(_a0 context.Context, _a1 *pbdns.QueryRequest) (*pbdns.QueryResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbdns.QueryResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest) (*pbdns.QueryResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest) *pbdns.QueryResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbdns.QueryResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbdns.QueryRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewDNSServiceServer creates a new instance of DNSServiceServer. 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 NewDNSServiceServer(t interface { - mock.TestingT - Cleanup(func()) -}) *DNSServiceServer { - mock := &DNSServiceServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go b/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go deleted file mode 100644 index 3f817f10..00000000 --- a/internal/mocks/pbdnsmock/is_cloning_dns_service_client.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbdnsmock - -import mock "github.com/stretchr/testify/mock" - -// IsCloningDNSServiceClient is an autogenerated mock type for the IsCloningDNSServiceClient type -type IsCloningDNSServiceClient struct { - mock.Mock -} - -// IsCloningDNSServiceClient provides a mock function with given fields: -func (_m *IsCloningDNSServiceClient) IsCloningDNSServiceClient() bool { - ret := _m.Called() - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// NewIsCloningDNSServiceClient creates a new instance of IsCloningDNSServiceClient. 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 NewIsCloningDNSServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *IsCloningDNSServiceClient { - mock := &IsCloningDNSServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbdnsmock/unsafe_dns_service_server.go b/internal/mocks/pbdnsmock/unsafe_dns_service_server.go deleted file mode 100644 index 1c385ee7..00000000 --- a/internal/mocks/pbdnsmock/unsafe_dns_service_server.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbdnsmock - -import mock "github.com/stretchr/testify/mock" - -// UnsafeDNSServiceServer is an autogenerated mock type for the UnsafeDNSServiceServer type -type UnsafeDNSServiceServer struct { - mock.Mock -} - -// mustEmbedUnimplementedDNSServiceServer provides a mock function with given fields: -func (_m *UnsafeDNSServiceServer) mustEmbedUnimplementedDNSServiceServer() { - _m.Called() -} - -// NewUnsafeDNSServiceServer creates a new instance of UnsafeDNSServiceServer. 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 NewUnsafeDNSServiceServer(t interface { - mock.TestingT - Cleanup(func()) -}) *UnsafeDNSServiceServer { - mock := &UnsafeDNSServiceServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go b/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go deleted file mode 100644 index 65d590f2..00000000 --- a/internal/mocks/pbresourcemock/is_cloning_resource_service_client.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import mock "github.com/stretchr/testify/mock" - -// IsCloningResourceServiceClient is an autogenerated mock type for the IsCloningResourceServiceClient type -type IsCloningResourceServiceClient struct { - mock.Mock -} - -// IsCloningResourceServiceClient provides a mock function with given fields: -func (_m *IsCloningResourceServiceClient) IsCloningResourceServiceClient() bool { - ret := _m.Called() - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// NewIsCloningResourceServiceClient creates a new instance of IsCloningResourceServiceClient. 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 NewIsCloningResourceServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *IsCloningResourceServiceClient { - mock := &IsCloningResourceServiceClient{} - 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 deleted file mode 100644 index b1b89a9d..00000000 --- a/internal/mocks/pbresourcemock/resource_service__watch_list_client.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - metadata "google.golang.org/grpc/metadata" - - pbresource "github.com/hashicorp/consul/proto-public/pbresource" -) - -// ResourceService_WatchListClient is an autogenerated mock type for the ResourceService_WatchListClient type -type ResourceService_WatchListClient struct { - mock.Mock -} - -// CloseSend provides a mock function with given fields: -func (_m *ResourceService_WatchListClient) CloseSend() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Context provides a mock function with given fields: -func (_m *ResourceService_WatchListClient) Context() context.Context { - ret := _m.Called() - - var r0 context.Context - if rf, ok := ret.Get(0).(func() context.Context); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(context.Context) - } - } - - return r0 -} - -// Header provides a mock function with given fields: -func (_m *ResourceService_WatchListClient) Header() (metadata.MD, error) { - ret := _m.Called() - - var r0 metadata.MD - var r1 error - if rf, ok := ret.Get(0).(func() (metadata.MD, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() metadata.MD); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(metadata.MD) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Recv provides a mock function with given fields: -func (_m *ResourceService_WatchListClient) Recv() (*pbresource.WatchEvent, error) { - ret := _m.Called() - - var r0 *pbresource.WatchEvent - var r1 error - if rf, ok := ret.Get(0).(func() (*pbresource.WatchEvent, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *pbresource.WatchEvent); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.WatchEvent) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RecvMsg provides a mock function with given fields: m -func (_m *ResourceService_WatchListClient) RecvMsg(m interface{}) error { - ret := _m.Called(m) - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(m) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SendMsg provides a mock function with given fields: m -func (_m *ResourceService_WatchListClient) SendMsg(m interface{}) error { - ret := _m.Called(m) - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(m) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Trailer provides a mock function with given fields: -func (_m *ResourceService_WatchListClient) Trailer() metadata.MD { - ret := _m.Called() - - var r0 metadata.MD - if rf, ok := ret.Get(0).(func() metadata.MD); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(metadata.MD) - } - } - - return r0 -} - -// NewResourceService_WatchListClient creates a new instance of ResourceService_WatchListClient. 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 NewResourceService_WatchListClient(t interface { - mock.TestingT - Cleanup(func()) -}) *ResourceService_WatchListClient { - mock := &ResourceService_WatchListClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/resource_service__watch_list_server.go b/internal/mocks/pbresourcemock/resource_service__watch_list_server.go deleted file mode 100644 index 661f2e03..00000000 --- a/internal/mocks/pbresourcemock/resource_service__watch_list_server.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - metadata "google.golang.org/grpc/metadata" - - pbresource "github.com/hashicorp/consul/proto-public/pbresource" -) - -// ResourceService_WatchListServer is an autogenerated mock type for the ResourceService_WatchListServer type -type ResourceService_WatchListServer struct { - mock.Mock -} - -// Context provides a mock function with given fields: -func (_m *ResourceService_WatchListServer) Context() context.Context { - ret := _m.Called() - - var r0 context.Context - if rf, ok := ret.Get(0).(func() context.Context); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(context.Context) - } - } - - return r0 -} - -// RecvMsg provides a mock function with given fields: m -func (_m *ResourceService_WatchListServer) RecvMsg(m interface{}) error { - ret := _m.Called(m) - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(m) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Send provides a mock function with given fields: _a0 -func (_m *ResourceService_WatchListServer) Send(_a0 *pbresource.WatchEvent) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(*pbresource.WatchEvent) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SendHeader provides a mock function with given fields: _a0 -func (_m *ResourceService_WatchListServer) SendHeader(_a0 metadata.MD) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(metadata.MD) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SendMsg provides a mock function with given fields: m -func (_m *ResourceService_WatchListServer) SendMsg(m interface{}) error { - ret := _m.Called(m) - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(m) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SetHeader provides a mock function with given fields: _a0 -func (_m *ResourceService_WatchListServer) SetHeader(_a0 metadata.MD) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(metadata.MD) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SetTrailer provides a mock function with given fields: _a0 -func (_m *ResourceService_WatchListServer) SetTrailer(_a0 metadata.MD) { - _m.Called(_a0) -} - -// NewResourceService_WatchListServer creates a new instance of ResourceService_WatchListServer. 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 NewResourceService_WatchListServer(t interface { - mock.TestingT - Cleanup(func()) -}) *ResourceService_WatchListServer { - mock := &ResourceService_WatchListServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/resource_service_client.go b/internal/mocks/pbresourcemock/resource_service_client.go deleted file mode 100644 index 3cbb1c8b..00000000 --- a/internal/mocks/pbresourcemock/resource_service_client.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import ( - context "context" - - grpc "google.golang.org/grpc" - - mock "github.com/stretchr/testify/mock" - - pbresource "github.com/hashicorp/consul/proto-public/pbresource" -) - -// ResourceServiceClient is an autogenerated mock type for the ResourceServiceClient type -type ResourceServiceClient struct { - mock.Mock -} - -// Delete provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) Delete(ctx context.Context, in *pbresource.DeleteRequest, opts ...grpc.CallOption) (*pbresource.DeleteResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.DeleteResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.DeleteRequest, ...grpc.CallOption) (*pbresource.DeleteResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.DeleteRequest, ...grpc.CallOption) *pbresource.DeleteResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.DeleteResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.DeleteRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// List provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) List(ctx context.Context, in *pbresource.ListRequest, opts ...grpc.CallOption) (*pbresource.ListResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.ListResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListRequest, ...grpc.CallOption) (*pbresource.ListResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListRequest, ...grpc.CallOption) *pbresource.ListResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.ListResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.ListRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListByOwner provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) ListByOwner(ctx context.Context, in *pbresource.ListByOwnerRequest, opts ...grpc.CallOption) (*pbresource.ListByOwnerResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.ListByOwnerResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListByOwnerRequest, ...grpc.CallOption) (*pbresource.ListByOwnerResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListByOwnerRequest, ...grpc.CallOption) *pbresource.ListByOwnerResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.ListByOwnerResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.ListByOwnerRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MutateAndValidate provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) MutateAndValidate(ctx context.Context, in *pbresource.MutateAndValidateRequest, opts ...grpc.CallOption) (*pbresource.MutateAndValidateResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.MutateAndValidateResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.MutateAndValidateRequest, ...grpc.CallOption) (*pbresource.MutateAndValidateResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.MutateAndValidateRequest, ...grpc.CallOption) *pbresource.MutateAndValidateResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.MutateAndValidateResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.MutateAndValidateRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Read provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) Read(ctx context.Context, in *pbresource.ReadRequest, opts ...grpc.CallOption) (*pbresource.ReadResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.ReadResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ReadRequest, ...grpc.CallOption) (*pbresource.ReadResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ReadRequest, ...grpc.CallOption) *pbresource.ReadResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.ReadResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.ReadRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WatchList provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) WatchList(ctx context.Context, in *pbresource.WatchListRequest, opts ...grpc.CallOption) (pbresource.ResourceService_WatchListClient, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - 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 { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WatchListRequest, ...grpc.CallOption) pbresource.ResourceService_WatchListClient); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(pbresource.ResourceService_WatchListClient) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.WatchListRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Write provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) Write(ctx context.Context, in *pbresource.WriteRequest, opts ...grpc.CallOption) (*pbresource.WriteResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.WriteResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteRequest, ...grpc.CallOption) (*pbresource.WriteResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteRequest, ...grpc.CallOption) *pbresource.WriteResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.WriteResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.WriteRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WriteStatus provides a mock function with given fields: ctx, in, opts -func (_m *ResourceServiceClient) WriteStatus(ctx context.Context, in *pbresource.WriteStatusRequest, opts ...grpc.CallOption) (*pbresource.WriteStatusResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbresource.WriteStatusResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteStatusRequest, ...grpc.CallOption) (*pbresource.WriteStatusResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteStatusRequest, ...grpc.CallOption) *pbresource.WriteStatusResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.WriteStatusResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.WriteStatusRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewResourceServiceClient creates a new instance of ResourceServiceClient. 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 NewResourceServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *ResourceServiceClient { - mock := &ResourceServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/resource_service_server.go b/internal/mocks/pbresourcemock/resource_service_server.go deleted file mode 100644 index f82d9d9c..00000000 --- a/internal/mocks/pbresourcemock/resource_service_server.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import ( - context "context" - - pbresource "github.com/hashicorp/consul/proto-public/pbresource" - mock "github.com/stretchr/testify/mock" -) - -// ResourceServiceServer is an autogenerated mock type for the ResourceServiceServer type -type ResourceServiceServer struct { - mock.Mock -} - -// Delete provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) Delete(_a0 context.Context, _a1 *pbresource.DeleteRequest) (*pbresource.DeleteResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.DeleteResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.DeleteRequest) (*pbresource.DeleteResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.DeleteRequest) *pbresource.DeleteResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.DeleteResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.DeleteRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// List provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) List(_a0 context.Context, _a1 *pbresource.ListRequest) (*pbresource.ListResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.ListResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListRequest) (*pbresource.ListResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListRequest) *pbresource.ListResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.ListResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.ListRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListByOwner provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) ListByOwner(_a0 context.Context, _a1 *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.ListByOwnerResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ListByOwnerRequest) *pbresource.ListByOwnerResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.ListByOwnerResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.ListByOwnerRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MutateAndValidate provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) MutateAndValidate(_a0 context.Context, _a1 *pbresource.MutateAndValidateRequest) (*pbresource.MutateAndValidateResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.MutateAndValidateResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.MutateAndValidateRequest) (*pbresource.MutateAndValidateResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.MutateAndValidateRequest) *pbresource.MutateAndValidateResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.MutateAndValidateResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.MutateAndValidateRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Read provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) Read(_a0 context.Context, _a1 *pbresource.ReadRequest) (*pbresource.ReadResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.ReadResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ReadRequest) (*pbresource.ReadResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ReadRequest) *pbresource.ReadResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.ReadResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.ReadRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WatchList provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) WatchList(_a0 *pbresource.WatchListRequest, _a1 pbresource.ResourceService_WatchListServer) error { - ret := _m.Called(_a0, _a1) - - var r0 error - if rf, ok := ret.Get(0).(func(*pbresource.WatchListRequest, pbresource.ResourceService_WatchListServer) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Write provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) Write(_a0 context.Context, _a1 *pbresource.WriteRequest) (*pbresource.WriteResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.WriteResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteRequest) (*pbresource.WriteResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteRequest) *pbresource.WriteResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.WriteResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.WriteRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WriteStatus provides a mock function with given fields: _a0, _a1 -func (_m *ResourceServiceServer) WriteStatus(_a0 context.Context, _a1 *pbresource.WriteStatusRequest) (*pbresource.WriteStatusResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbresource.WriteStatusResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteStatusRequest) (*pbresource.WriteStatusResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.WriteStatusRequest) *pbresource.WriteStatusResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbresource.WriteStatusResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbresource.WriteStatusRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewResourceServiceServer creates a new instance of ResourceServiceServer. 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 NewResourceServiceServer(t interface { - mock.TestingT - Cleanup(func()) -}) *ResourceServiceServer { - mock := &ResourceServiceServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/server_stream.go b/internal/mocks/pbresourcemock/server_stream.go deleted file mode 100644 index 48025fc3..00000000 --- a/internal/mocks/pbresourcemock/server_stream.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - metadata "google.golang.org/grpc/metadata" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" -) - -// serverStream is an autogenerated mock type for the serverStream type -type serverStream[T protoreflect.ProtoMessage] struct { - mock.Mock -} - -// CloseSend provides a mock function with given fields: -func (_m *serverStream[T]) CloseSend() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Context provides a mock function with given fields: -func (_m *serverStream[T]) Context() context.Context { - ret := _m.Called() - - var r0 context.Context - if rf, ok := ret.Get(0).(func() context.Context); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(context.Context) - } - } - - return r0 -} - -// Header provides a mock function with given fields: -func (_m *serverStream[T]) Header() (metadata.MD, error) { - ret := _m.Called() - - var r0 metadata.MD - var r1 error - if rf, ok := ret.Get(0).(func() (metadata.MD, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() metadata.MD); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(metadata.MD) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Recv provides a mock function with given fields: -func (_m *serverStream[T]) Recv() (T, error) { - ret := _m.Called() - - var r0 T - var r1 error - if rf, ok := ret.Get(0).(func() (T, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() T); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(T) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RecvMsg provides a mock function with given fields: m -func (_m *serverStream[T]) RecvMsg(m interface{}) error { - ret := _m.Called(m) - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(m) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SendMsg provides a mock function with given fields: m -func (_m *serverStream[T]) SendMsg(m interface{}) error { - ret := _m.Called(m) - - var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(m) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Trailer provides a mock function with given fields: -func (_m *serverStream[T]) Trailer() metadata.MD { - ret := _m.Called() - - var r0 metadata.MD - if rf, ok := ret.Get(0).(func() metadata.MD); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(metadata.MD) - } - } - - return r0 -} - -// newServerStream creates a new instance of serverStream. 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 newServerStream[T protoreflect.ProtoMessage](t interface { - mock.TestingT - Cleanup(func()) -}) *serverStream[T] { - mock := &serverStream[T]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mocks/pbresourcemock/unsafe_resource_service_server.go b/internal/mocks/pbresourcemock/unsafe_resource_service_server.go deleted file mode 100644 index 809a9a73..00000000 --- a/internal/mocks/pbresourcemock/unsafe_resource_service_server.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by mockery v2.32.0. DO NOT EDIT. - -package pbresourcemock - -import mock "github.com/stretchr/testify/mock" - -// UnsafeResourceServiceServer is an autogenerated mock type for the UnsafeResourceServiceServer type -type UnsafeResourceServiceServer struct { - mock.Mock -} - -// mustEmbedUnimplementedResourceServiceServer provides a mock function with given fields: -func (_m *UnsafeResourceServiceServer) mustEmbedUnimplementedResourceServiceServer() { - _m.Called() -} - -// NewUnsafeResourceServiceServer creates a new instance of UnsafeResourceServiceServer. 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 NewUnsafeResourceServiceServer(t interface { - mock.TestingT - Cleanup(func()) -}) *UnsafeResourceServiceServer { - mock := &UnsafeResourceServiceServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/consuldp/bootstrap.go b/pkg/consuldp/bootstrap.go index d14e28f9..326a1375 100644 --- a/pkg/consuldp/bootstrap.go +++ b/pkg/consuldp/bootstrap.go @@ -54,14 +54,6 @@ func (cdp *ConsulDataplane) bootstrapConfig(ctx context.Context) (*bootstrap.Boo return nil, nil, fmt.Errorf("failed to get envoy bootstrap params: %w", err) } - // store the final resolved service for others to use. - cdp.resolvedProxyConfig = ProxyConfig{ - NodeName: rsp.NodeName, - ProxyID: cdp.cfg.Proxy.ProxyID, - Namespace: rsp.Namespace, - Partition: rsp.Partition, - } - prom := cdp.cfg.Telemetry.Prometheus args := &bootstrap.BootstrapTplArgs{ GRPC: bootstrap.GRPC{ @@ -134,8 +126,6 @@ func (cdp *ConsulDataplane) bootstrapConfig(ctx context.Context) (*bootstrap.Boo args.PrometheusBackendPort = strconv.Itoa(prom.MergePort) } - bootstrapConfig.Logger = cdp.logger.Named("bootstrap-config") - // Note: we pass true for omitDeprecatedTags here - consul-dataplane is clean // slate, and we don't need to maintain this legacy behavior. cfg, err := bootstrapConfig.GenerateJSON(args, true) diff --git a/pkg/consuldp/bootstrap_test.go b/pkg/consuldp/bootstrap_test.go index fe91a6f8..28f6be2c 100644 --- a/pkg/consuldp/bootstrap_test.go +++ b/pkg/consuldp/bootstrap_test.go @@ -16,7 +16,6 @@ import ( "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" "google.golang.org/protobuf/types/known/structpb" @@ -41,13 +40,12 @@ func TestBootstrapConfig(t *testing.T) { } testCases := map[string]struct { - cfg *Config - rsp *pbdataplane.GetEnvoyBootstrapParamsResponse - rspV2 *pbdataplane.GetEnvoyBootstrapParamsResponse - resolvedProxyConfig *ProxyConfig + cfg *Config + rsp *pbdataplane.GetEnvoyBootstrapParamsResponse + rspV2 *pbdataplane.GetEnvoyBootstrapParamsResponse }{ "access-logs": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -61,7 +59,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{ @@ -69,7 +67,7 @@ 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%\"}}}}"}, }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Identity: "web", NodeName: nodeName, BootstrapConfig: &pbmesh.BootstrapConfig{ @@ -79,7 +77,7 @@ func TestBootstrapConfig(t *testing.T) { }, }, "basic": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -93,14 +91,14 @@ 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", }), }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Identity: "web", NodeName: nodeName, BootstrapConfig: &pbmesh.BootstrapConfig{ @@ -109,7 +107,7 @@ func TestBootstrapConfig(t *testing.T) { }, }, "central-telemetry-config": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -123,14 +121,14 @@ 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", }), }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Identity: "web", NodeName: nodeName, BootstrapConfig: &pbmesh.BootstrapConfig{ @@ -172,7 +170,7 @@ func TestBootstrapConfig(t *testing.T) { }, }, "custom-prometheus-scrape-path": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -190,49 +188,14 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ - Service: "web", - NodeName: nodeName, - Config: makeStruct(map[string]any{ - "envoy_prometheus_bind_addr": "0.0.0.0:20200", - }), - }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ - Identity: "web", - NodeName: nodeName, - BootstrapConfig: &pbmesh.BootstrapConfig{ - PrometheusBindAddr: "0.0.0.0:20200", - }, - }, - }, - "custom-prometheus-scrape-path-with-query": { - cfg: &Config{ - Proxy: &ProxyConfig{ - ProxyID: "web-proxy", - NodeName: nodeName, - }, - Envoy: &EnvoyConfig{ - AdminBindAddress: "127.0.0.1", - AdminBindPort: 19000, - }, - Telemetry: &TelemetryConfig{ - UseCentralConfig: true, - Prometheus: PrometheusTelemetryConfig{ - MergePort: 20100, - // Expect query is _not_ included in xDS path match - ScrapePath: "/custom/scrape/path?usedonly", - }, - }, - 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", }), }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Identity: "web", NodeName: nodeName, BootstrapConfig: &pbmesh.BootstrapConfig{ @@ -240,50 +203,8 @@ func TestBootstrapConfig(t *testing.T) { }, }, }, - "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", - NodeName: nodeName, - Config: makeStruct(map[string]any{ - "envoy_dogstatsd_url": "this-should-not-appear-in-generated-config", - }), - Namespace: "test-namespace", - Partition: "test-partition", - }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ - Identity: "web", - NodeName: nodeName, - BootstrapConfig: &pbmesh.BootstrapConfig{ - DogstatsdUrl: "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", - }, - }, "ready-listener": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -299,17 +220,17 @@ func TestBootstrapConfig(t *testing.T) { }, XDSServer: &XDSServer{BindAddress: "127.0.0.1", BindPort: xdsBindPort}, }, - rsp: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Service: "web", NodeName: nodeName, }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Identity: "web", NodeName: nodeName, }, }, "unix-socket-xds-server": { - cfg: &Config{ + &Config{ Proxy: &ProxyConfig{ ProxyID: "web-proxy", NodeName: nodeName, @@ -323,14 +244,14 @@ 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", }), }, - rspV2: &pbdataplane.GetEnvoyBootstrapParamsResponse{ + &pbdataplane.GetEnvoyBootstrapParamsResponse{ Identity: "web", NodeName: nodeName, BootstrapConfig: &pbmesh.BootstrapConfig{ @@ -357,7 +278,6 @@ func TestBootstrapConfig(t *testing.T) { dp := &ConsulDataplane{ cfg: tc.cfg, dpServiceClient: client, - logger: hclog.NewNullLogger(), } if strings.HasPrefix(tc.cfg.XDSServer.BindAddress, "unix://") { @@ -371,10 +291,6 @@ func TestBootstrapConfig(t *testing.T) { golden(t, bsCfg) validateBootstrapConfig(t, bsCfg) - - if tc.resolvedProxyConfig != nil { - require.Equal(t, *tc.resolvedProxyConfig, dp.resolvedProxyConfig) - } }) t.Run(desc+"-v2", func(t *testing.T) { @@ -394,7 +310,6 @@ func TestBootstrapConfig(t *testing.T) { dp := &ConsulDataplane{ cfg: tc.cfg, dpServiceClient: client, - logger: hclog.NewNullLogger(), } if strings.HasPrefix(tc.cfg.XDSServer.BindAddress, "unix://") { @@ -408,10 +323,6 @@ func TestBootstrapConfig(t *testing.T) { golden(t, bsCfg) validateBootstrapConfig(t, bsCfg) - - if tc.resolvedProxyConfig != nil { - require.Equal(t, *tc.resolvedProxyConfig, dp.resolvedProxyConfig) - } }) } } diff --git a/pkg/consuldp/consul_dataplane.go b/pkg/consuldp/consul_dataplane.go index f822a984..16694bd2 100644 --- a/pkg/consuldp/consul_dataplane.go +++ b/pkg/consuldp/consul_dataplane.go @@ -47,8 +47,6 @@ type ConsulDataplane struct { aclToken string metricsConfig *metricsConfig lifecycleConfig *lifecycleConfig - - resolvedProxyConfig ProxyConfig } // NewConsulDP creates a new instance of ConsulDataplane @@ -257,13 +255,10 @@ func (cdp *ConsulDataplane) startDNSProxy(ctx context.Context) error { dnsClientInterface := pbdns.NewDNSServiceClient(cdp.serverConn) dnsServer, err := dns.NewDNSServer(dns.DNSServerParams{ - BindAddr: cdp.cfg.DNSServer.BindAddr, - Port: cdp.cfg.DNSServer.Port, - Client: dnsClientInterface, - Logger: cdp.logger, - Partition: cdp.resolvedProxyConfig.Partition, - Namespace: cdp.resolvedProxyConfig.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 proxy disabled: configure the Consul DNS port to enable") diff --git a/pkg/consuldp/metrics.go b/pkg/consuldp/metrics.go index 64213a07..313a182b 100644 --- a/pkg/consuldp/metrics.go +++ b/pkg/consuldp/metrics.go @@ -61,37 +61,6 @@ const ( Statsd ) -type urlFn func(*http.Request) string - -// staticUrlFn returns a urlFn that redirects to the given URL (not validated) unmodified. -func staticUrlFn(redirectUrl string) urlFn { - return func(_ *http.Request) string { - return redirectUrl - } -} - -// retainQueryUrlFn returns a urlFn that retains the original query params of the inbound -// request when redirecting. -func retainQueryUrlFn(redirectUrl string) (urlFn, error) { - parsedUrl, err := url.Parse(redirectUrl) - if err != nil { - return nil, fmt.Errorf("failed to parse redirect URL: %w", err) - } - - return func(req *http.Request) string { - targetUrl := *parsedUrl - // Add and re-encode to sanitize invalid query params. - targetQuery := targetUrl.Query() - for k, vs := range req.URL.Query() { - for _, v := range vs { - targetQuery.Add(k, v) - } - } - targetUrl.RawQuery = targetQuery.Encode() - return targetUrl.String() - }, nil -} - // metricsConfig handles all configuration related to merging // the metrics and presenting them on promScrapeServer type metricsConfig struct { @@ -111,7 +80,7 @@ type metricsConfig struct { // merged metrics config promScrapeServer *http.Server // the server that will serve all the merged metrics client httpClient // the client that will scrape the urls - urls []urlFn // the urls that will be scraped + urls []string // the urls that will be scraped // consuldp metrics server cdpMetricsServer *http.Server // cdp metrics prometheus scrape server @@ -178,15 +147,9 @@ func (m *metricsConfig) startMetrics(ctx context.Context, bcfg *bootstrap.Bootst // will actually scrape. mux := http.NewServeMux() mux.HandleFunc("/stats/prometheus", m.mergedMetricsHandler) - // Retain request query for Envoy endpoint to enable customizing response (see - // https://www.envoyproxy.io/docs/envoy/latest/operations/admin#get--stats?format=prometheus&usedonly). - envoyUrlFn, err := retainQueryUrlFn(fmt.Sprintf("http://%s:%v/stats/prometheus", m.envoyAdminAddr, m.envoyAdminBindPort)) - if err != nil { - return err - } - m.urls = []urlFn{staticUrlFn(cdpMetricsUrl), envoyUrlFn} + m.urls = []string{cdpMetricsUrl, fmt.Sprintf("http://%s:%v/stats/prometheus", m.envoyAdminAddr, m.envoyAdminBindPort)} if m.cfg != nil && m.cfg.Prometheus.ServiceMetricsURL != "" { - m.urls = append(m.urls, staticUrlFn(m.cfg.Prometheus.ServiceMetricsURL)) + m.urls = append(m.urls, m.cfg.Prometheus.ServiceMetricsURL) } // 3. Determine what the merged metrics bind port is. It can be set as a flag. @@ -286,12 +249,11 @@ func (m *metricsConfig) metricsServerExited() <-chan struct{} { // Consul Dataplane, Envoy and (optionally) the service/application. The Envoy // and service metrics are scraped synchronously during the handling of this // request. -func (m *metricsConfig) mergedMetricsHandler(rw http.ResponseWriter, req *http.Request) { - for _, urlFn := range m.urls { - urlStr := urlFn(req) - m.logger.Debug("scraping url for merging", "url", urlStr) - if err := m.scrapeMetrics(rw, urlStr); err != nil { - m.scrapeError(rw, urlStr, err) +func (m *metricsConfig) mergedMetricsHandler(rw http.ResponseWriter, _ *http.Request) { + for _, url := range m.urls { + m.logger.Debug("scraping url for merging", "url", url) + if err := m.scrapeMetrics(rw, url); err != nil { + m.scrapeError(rw, url, err) return } } diff --git a/pkg/consuldp/metrics_test.go b/pkg/consuldp/metrics_test.go index 6dd7fd5b..5666e184 100644 --- a/pkg/consuldp/metrics_test.go +++ b/pkg/consuldp/metrics_test.go @@ -18,19 +18,16 @@ import ( "time" "github.com/armon/go-metrics" - "github.com/stretchr/testify/require" - "github.com/hashicorp/consul-dataplane/internal/bootstrap" metricscache "github.com/hashicorp/consul-dataplane/pkg/metrics-cache" + "github.com/stretchr/testify/require" ) var ( dogStatsdAddr = "127.0.0.1" envoyMetricsPort = 19000 envoyMetricsAddr = "127.0.0.1" - - // net/url encodes value-less query params with an '=' - envoyMetricsUrl = fmt.Sprintf("http://%s:%v/stats/prometheus?usedonly=", envoyMetricsAddr, envoyMetricsPort) + envoyMetricsUrl = fmt.Sprintf("http://%s:%v/stats/prometheus", envoyMetricsAddr, envoyMetricsPort) emptyTags = []metrics.Label{} ) @@ -202,8 +199,7 @@ func TestMetricsServerEnabled(t *testing.T) { require.NotEqual(t, port, 0, "test failed to figure out metrics server port") log.Printf("port = %v", port) - // Include a query to test that it is propagated _only_ to Envoy's stats endpoint. - url := fmt.Sprintf("http://127.0.0.1:%d/stats/prometheus?usedonly", port) + url := fmt.Sprintf("http://127.0.0.1:%d/stats/prometheus", port) resp, err := http.Get(url) require.NoError(t, err) require.NotNil(t, resp) diff --git a/pkg/consuldp/testdata/TestBootstrapConfig/custom-prometheus-scrape-path-with-query.golden b/pkg/consuldp/testdata/TestBootstrapConfig/custom-prometheus-scrape-path-with-query.golden deleted file mode 100644 index 5454b373..00000000 --- a/pkg/consuldp/testdata/TestBootstrapConfig/custom-prometheus-scrape-path-with-query.golden +++ /dev/null @@ -1,255 +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": "default", - "partition": "default" - } - }, - "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 - } - } - } - } - ] - } - ] - } - }, - { - "name": "prometheus_backend", - "ignore_health_on_host_removal": false, - "connect_timeout": "5s", - "type": "STATIC", - "http_protocol_options": {}, - "loadAssignment": { - "clusterName": "prometheus_backend", - "endpoints": [ - { - "lbEndpoints": [ - { - "endpoint": { - "address": { - "socket_address": { - "address": "127.0.0.1", - "port_value": 20100 - } - } - } - } - ] - } - ] - } - } - ], - "listeners": [ - { - "name": "envoy_prometheus_metrics_listener", - "address": { - "socket_address": { - "address": "0.0.0.0", - "port_value": 20200 - } - }, - "filter_chains": [ - { - "filters": [ - { - "name": "envoy.filters.network.http_connection_manager", - "typedConfig": { - "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", - "stat_prefix": "envoy_prometheus_metrics", - "codec_type": "HTTP1", - "route_config": { - "name": "self_admin_route", - "virtual_hosts": [ - { - "name": "self_admin", - "domains": [ - "*" - ], - "routes": [ - { - "match": { - "path": "/custom/scrape/path" - }, - "route": { - "cluster": "prometheus_backend", - "prefix_rewrite": "/stats/prometheus" - } - }, - { - "match": { - "prefix": "/" - }, - "direct_response": { - "status": 404 - } - } - ] - } - ] - }, - "http_filters": [ - { - "name": "envoy.filters.http.router", - "typedConfig": { - "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router" - } - } - ] - } - } - ] - } - ] - } - ] - }, - "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": "default" - }, - { - "tag_name": "consul.source.partition", - "fixed_value": "default" - } - ], - "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/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/dns/.mockery.yaml b/pkg/dns/.mockery.yaml deleted file mode 100644 index a159390b..00000000 --- a/pkg/dns/.mockery.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -with-expecter: true -recursive: true -include-regex: ".*" -dir: "mocks/" -outpkg: "mocks" -mockname: "{{.InterfaceName}}" -packages: - github.com/hashicorp/consul/proto-public/pbdns: diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go index 93d7f8ba..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 } @@ -209,12 +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, - ) - resp, err := d.client.Query(ctx, req) if err != nil { logger.Error("error resolving consul request", "error", err) @@ -295,12 +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, - ) - 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..100683d4 100644 --- a/pkg/dns/dns_test.go +++ b/pkg/dns/dns_test.go @@ -17,11 +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" ) type MockedNetConn struct { @@ -44,7 +40,7 @@ func genRandomBytes(size int) (blk []byte) { } func (s *DNSTestSuite) Test_DisabledServer() { - mockedDNSConsulClient := mocks.NewDNSServiceClient(s.T()) + mockedDNSConsulClient := pbdns.NewMockDNSServiceClient(s.T()) server, err := NewDNSServer(DNSServerParams{ BindAddr: "127.0.0.1", Port: -1, // disabled server @@ -66,7 +62,7 @@ func (s *DNSTestSuite) Test_DisabledServer() { } func (s *DNSTestSuite) Test_AlreadyRunning() { - mockedDNSConsulClient := mocks.NewDNSServiceClient(s.T()) + mockedDNSConsulClient := pbdns.NewMockDNSServiceClient(s.T()) server, err := NewDNSServer(DNSServerParams{ BindAddr: "127.0.0.1", Port: 0, // disabled server @@ -85,7 +81,7 @@ func (s *DNSTestSuite) Test_AlreadyRunning() { } func (s *DNSTestSuite) Test_ServerStop() { - mockedDNSConsulClient := mocks.NewDNSServiceClient(s.T()) + mockedDNSConsulClient := pbdns.NewMockDNSServiceClient(s.T()) server, err := NewDNSServer(DNSServerParams{ BindAddr: "127.0.0.1", Port: 0, // let the os choose a port @@ -124,7 +120,7 @@ func (s *DNSTestSuite) Test_ServerStop() { } func (s *DNSTestSuite) Test_UDPProxy() { - mockedDNSConsulClient := mocks.NewDNSServiceClient(s.T()) + mockedDNSConsulClient := pbdns.NewMockDNSServiceClient(s.T()) addr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0} connUdp, err := net.ListenUDP("udp", addr) s.Require().NoError(err) @@ -132,12 +128,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 +173,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()) @@ -226,7 +208,7 @@ func (s *DNSTestSuite) Test_UDPProxy() { } func (s *DNSTestSuite) Test_ProxydnsTCP() { - mockedDNSConsulClient := mocks.NewDNSServiceClient(s.T()) + mockedDNSConsulClient := pbdns.NewMockDNSServiceClient(s.T()) addr := &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0} listenerTCP, err := net.ListenTCP("tcp", addr) s.Require().NoError(err) @@ -238,9 +220,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 +261,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/dns/mocks/mock_DNSServiceClient.go b/pkg/dns/mocks/mock_DNSServiceClient.go deleted file mode 100644 index 55566e3d..00000000 --- a/pkg/dns/mocks/mock_DNSServiceClient.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by mockery v2.37.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - grpc "google.golang.org/grpc" - - mock "github.com/stretchr/testify/mock" - - pbdns "github.com/hashicorp/consul/proto-public/pbdns" -) - -// DNSServiceClient is an autogenerated mock type for the DNSServiceClient type -type DNSServiceClient struct { - mock.Mock -} - -type DNSServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *DNSServiceClient) EXPECT() *DNSServiceClient_Expecter { - return &DNSServiceClient_Expecter{mock: &_m.Mock} -} - -// Query provides a mock function with given fields: ctx, in, opts -func (_m *DNSServiceClient) Query(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption) (*pbdns.QueryResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *pbdns.QueryResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) (*pbdns.QueryResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) *pbdns.QueryResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbdns.QueryResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DNSServiceClient_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' -type DNSServiceClient_Query_Call struct { - *mock.Call -} - -// Query is a helper method to define mock.On call -// - ctx context.Context -// - in *pbdns.QueryRequest -// - opts ...grpc.CallOption -func (_e *DNSServiceClient_Expecter) Query(ctx interface{}, in interface{}, opts ...interface{}) *DNSServiceClient_Query_Call { - return &DNSServiceClient_Query_Call{Call: _e.mock.On("Query", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *DNSServiceClient_Query_Call) Run(run func(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption)) *DNSServiceClient_Query_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*pbdns.QueryRequest), variadicArgs...) - }) - return _c -} - -func (_c *DNSServiceClient_Query_Call) Return(_a0 *pbdns.QueryResponse, _a1 error) *DNSServiceClient_Query_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DNSServiceClient_Query_Call) RunAndReturn(run func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) (*pbdns.QueryResponse, error)) *DNSServiceClient_Query_Call { - _c.Call.Return(run) - return _c -} - -// NewDNSServiceClient creates a new instance of DNSServiceClient. 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 NewDNSServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *DNSServiceClient { - mock := &DNSServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/dns/mocks/mock_DNSServiceServer.go b/pkg/dns/mocks/mock_DNSServiceServer.go deleted file mode 100644 index e1398912..00000000 --- a/pkg/dns/mocks/mock_DNSServiceServer.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by mockery v2.37.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - pbdns "github.com/hashicorp/consul/proto-public/pbdns" - mock "github.com/stretchr/testify/mock" -) - -// DNSServiceServer is an autogenerated mock type for the DNSServiceServer type -type DNSServiceServer struct { - mock.Mock -} - -type DNSServiceServer_Expecter struct { - mock *mock.Mock -} - -func (_m *DNSServiceServer) EXPECT() *DNSServiceServer_Expecter { - return &DNSServiceServer_Expecter{mock: &_m.Mock} -} - -// Query provides a mock function with given fields: _a0, _a1 -func (_m *DNSServiceServer) Query(_a0 context.Context, _a1 *pbdns.QueryRequest) (*pbdns.QueryResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *pbdns.QueryResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest) (*pbdns.QueryResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest) *pbdns.QueryResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*pbdns.QueryResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *pbdns.QueryRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DNSServiceServer_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' -type DNSServiceServer_Query_Call struct { - *mock.Call -} - -// Query is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *pbdns.QueryRequest -func (_e *DNSServiceServer_Expecter) Query(_a0 interface{}, _a1 interface{}) *DNSServiceServer_Query_Call { - return &DNSServiceServer_Query_Call{Call: _e.mock.On("Query", _a0, _a1)} -} - -func (_c *DNSServiceServer_Query_Call) Run(run func(_a0 context.Context, _a1 *pbdns.QueryRequest)) *DNSServiceServer_Query_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*pbdns.QueryRequest)) - }) - return _c -} - -func (_c *DNSServiceServer_Query_Call) Return(_a0 *pbdns.QueryResponse, _a1 error) *DNSServiceServer_Query_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DNSServiceServer_Query_Call) RunAndReturn(run func(context.Context, *pbdns.QueryRequest) (*pbdns.QueryResponse, error)) *DNSServiceServer_Query_Call { - _c.Call.Return(run) - return _c -} - -// NewDNSServiceServer creates a new instance of DNSServiceServer. 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 NewDNSServiceServer(t interface { - mock.TestingT - Cleanup(func()) -}) *DNSServiceServer { - mock := &DNSServiceServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/dns/mocks/mock_UnsafeDNSServiceServer.go b/pkg/dns/mocks/mock_UnsafeDNSServiceServer.go deleted file mode 100644 index ec44b563..00000000 --- a/pkg/dns/mocks/mock_UnsafeDNSServiceServer.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by mockery v2.37.1. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// UnsafeDNSServiceServer is an autogenerated mock type for the UnsafeDNSServiceServer type -type UnsafeDNSServiceServer struct { - mock.Mock -} - -type UnsafeDNSServiceServer_Expecter struct { - mock *mock.Mock -} - -func (_m *UnsafeDNSServiceServer) EXPECT() *UnsafeDNSServiceServer_Expecter { - return &UnsafeDNSServiceServer_Expecter{mock: &_m.Mock} -} - -// mustEmbedUnimplementedDNSServiceServer provides a mock function with given fields: -func (_m *UnsafeDNSServiceServer) mustEmbedUnimplementedDNSServiceServer() { - _m.Called() -} - -// UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'mustEmbedUnimplementedDNSServiceServer' -type UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call struct { - *mock.Call -} - -// mustEmbedUnimplementedDNSServiceServer is a helper method to define mock.On call -func (_e *UnsafeDNSServiceServer_Expecter) mustEmbedUnimplementedDNSServiceServer() *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call { - return &UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call{Call: _e.mock.On("mustEmbedUnimplementedDNSServiceServer")} -} - -func (_c *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call) Run(run func()) *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call) Return() *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call { - _c.Call.Return() - return _c -} - -func (_c *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call) RunAndReturn(run func()) *UnsafeDNSServiceServer_mustEmbedUnimplementedDNSServiceServer_Call { - _c.Call.Return(run) - return _c -} - -// NewUnsafeDNSServiceServer creates a new instance of UnsafeDNSServiceServer. 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 NewUnsafeDNSServiceServer(t interface { - mock.TestingT - Cleanup(func()) -}) *UnsafeDNSServiceServer { - mock := &UnsafeDNSServiceServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/version/version.go b/pkg/version/version.go index 3bd1170c..76aeb5b1 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.3.6" // 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