Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1143.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:dependency
deps: update Go dependencies to latest versions and migrate `armon/go-metrics` to `hashicorp/go-metrics` v0.5.4, the actively maintained fork. `armon/go-metrics` is retained as an indirect dependency. Added `hashicorpmetrics` build tag support across CI, Makefile, and source packages to select the `hashicorp/go-metrics` implementation at build time.
```
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ jobs:
strategy:
matrix:
include:
- {goos: "linux", goarch: "arm"}
- {goos: "linux", goarch: "arm64"}
- {goos: "linux", goarch: "386"}
- {goos: "linux", goarch: "amd64"}
- {goos: "linux", goarch: "amd64", gotags: "fips", env: "CGO_ENABLED=1 GOEXPERIMENT=boringcrypto", fips: "+fips1402", pkg_suffix: "-fips" }
- {goos: "linux", goarch: "arm64", gotags: "fips", env: "CGO_ENABLED=1 GOEXPERIMENT=boringcrypto CC=aarch64-linux-gnu-gcc", fips: "+fips1402", pkg_suffix: "-fips" }
- {goos: "darwin", goarch: "amd64"}
- {goos: "darwin", goarch: "arm64"}
- {goos: "linux", goarch: "arm", gotags: "hashicorpmetrics"}
- {goos: "linux", goarch: "arm64", gotags: "hashicorpmetrics"}
- {goos: "linux", goarch: "386", gotags: "hashicorpmetrics"}
- {goos: "linux", goarch: "amd64", gotags: "hashicorpmetrics"}
- {goos: "linux", goarch: "amd64", gotags: "hashicorpmetrics,fips", env: "CGO_ENABLED=1 GOEXPERIMENT=boringcrypto", fips: "+fips1402", pkg_suffix: "-fips" }
- {goos: "linux", goarch: "arm64", gotags: "hashicorpmetrics,fips", env: "CGO_ENABLED=1 GOEXPERIMENT=boringcrypto CC=aarch64-linux-gnu-gcc", fips: "+fips1402", pkg_suffix: "-fips" }
- {goos: "darwin", goarch: "amd64", gotags: "hashicorpmetrics"}
- {goos: "darwin", goarch: "arm64", gotags: "hashicorpmetrics"}

fail-fast: true

Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
uses: hashicorp/actions-docker-build@v2
with:
smoke_test: |
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version | head -n1 | cut -d' ' -f3 | sed 's/^v//')"
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version 2>/dev/null | sed -n '1p' | cut -d' ' -f3 | sed 's/^v//')"
if [ "${TEST_VERSION}" != "${version}" ]; then
echo "Test FAILED: Got ${TEST_VERSION}, want ${version}."
exit 1
Expand All @@ -209,7 +209,7 @@ jobs:
uses: hashicorp/actions-docker-build@v2
with:
smoke_test: |
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version | head -n1 | cut -d' ' -f3 | sed 's/^v//')"
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version 2>/dev/null | sed -n '1p' | cut -d' ' -f3 | sed 's/^v//')"
if [ "${TEST_VERSION}" != "${version}" ]; then
echo "Test FAILED: Got ${TEST_VERSION}, want ${version}."
exit 1
Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:
uses: hashicorp/actions-docker-build@v2
with:
smoke_test: |
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version | head -n1 | cut -d' ' -f3 | sed 's/^v//')"
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version 2>/dev/null | sed -n '1p' | cut -d' ' -f3 | sed 's/^v//')"
if [ "${TEST_VERSION}" != "${version}" ]; then
echo "Test FAILED: Got ${TEST_VERSION}, want ${version}."
exit 1
Expand All @@ -310,7 +310,7 @@ jobs:
uses: hashicorp/actions-docker-build@v2
with:
smoke_test: |
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version | head -n1 | cut -d' ' -f3 | sed 's/^v//')"
TEST_VERSION="$(docker run "${IMAGE_NAME}" --version 2>/dev/null | sed -n '1p' | cut -d' ' -f3 | sed 's/^v//')"
if [ "${TEST_VERSION}" != "${version}" ]; then
echo "Test FAILED: Got ${TEST_VERSION}, want ${version}}."
exit 1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/consul-dataplane-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: go test ./... -p 1 -coverprofile=coverage.txt -covermode=set # disable parallelism to avoid port conflicts from default metrics and lifecycle server configuration
- run: go test ./... -p 1 -tags hashicorpmetrics -coverprofile=coverage.txt -covermode=set # disable parallelism to avoid port conflicts from default metrics and lifecycle server configuration
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: always()
with:
Expand Down Expand Up @@ -76,3 +76,4 @@ jobs:
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
version: "v2.11.4"
args: --build-tags hashicorpmetrics
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(GOPATH)/bin

GO_MODULES := $(shell find . -name go.mod -exec dirname {} \; | sort)
GOTAGS ?= hashicorpmetrics

# Get local ARCH; on Intel Mac, 'uname -m' returns x86_64 which we turn into amd64.
# Not using 'go env GOOS/GOARCH' here so 'make docker' will work without local Go install.
Expand Down Expand Up @@ -44,7 +45,7 @@ dist: ## make dist directory and ignore everything

.PHONY: bin
bin: dist ## Build the binary
GOARCH=$(ARCH) GOOS=$(OS) CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags="$(GOLDFLAGS)" -o $(BIN) ./cmd/$(BIN_NAME)
GOARCH=$(ARCH) GOOS=$(OS) CGO_ENABLED=0 go build -tags=$(GOTAGS) -trimpath -buildvcs=false -ldflags="$(GOLDFLAGS)" -o $(BIN) ./cmd/$(BIN_NAME)

.PHONY: dev
dev: bin ## Build binary and copy to the destination
Expand Down Expand Up @@ -76,7 +77,7 @@ dev-docker: docker ## build docker image and tag the image to local

.PHONY: unit-tests
unit-tests: ## unit tests
go test ./...
go test -tags=$(GOTAGS) ./...

.PHONY: expand-integration-tests-output-dir
expand-integration-tests-output-dir: ## create directory to support integration tests
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,45 @@ go 1.26

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.12
github.com/hashicorp/consul/proto-public v0.8.1
github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-metrics v0.5.4
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.23.2
github.com/stretchr/testify v1.11.1
google.golang.org/grpc v1.80.0
google.golang.org/grpc v1.81.1
google.golang.org/protobuf v1.36.11
)

require (
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
github.com/hashicorp/go-metrics v0.5.4 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-netaddrs v0.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/mattn/go-colorable v0.1.15 // indirect
github.com/mattn/go-isatty v0.0.22 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
github.com/prometheus/common v0.68.1 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/stretchr/objx v0.5.3 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading