Skip to content

Commit e5f3782

Browse files
authored
Migrate armon/go-metrics to hashicorp/go-metrics and update Go dependencies (#5403)
* migrate Makefile from armon/go-metrics to hashicorp/go-metrics * migrate workflow files from armon/go-metrics to hashicorp/go-metrics * migrate go.mod and go.sum from armon/go-metrics to hashicorp/go-metrics and update dependencies versions * migrate .go files from armon/go-metrics to hashicorp/go-metrics * add changelog file * fix acceptance go.sum missing entries after dependency upgrade
1 parent 90b0770 commit e5f3782

14 files changed

Lines changed: 575 additions & 552 deletions

File tree

.changelog/5403.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:dependency
2+
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.
3+
```

.github/workflows/build.yml

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ KIND_NODE_IMAGE= $(shell ./control-plane/build-support/scripts/read-yaml-config.
88
KUBECTL_VERSION= $(shell ./control-plane/build-support/scripts/read-yaml-config.sh acceptance/ci-inputs/kind-inputs.yaml .kubectlVersion)
99

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

1213
GOTESTSUM_PATH?=$(shell command -v gotestsum)
1314

@@ -101,21 +102,23 @@ control-plane-fips-dev-docker: ## Build consul-k8s-control-plane FIPS dev Docker
101102
.PHONY: control-plane-test
102103
control-plane-test: ## Run go test for the control plane.
103104
ifeq ("$(GOTESTSUM_PATH)","")
104-
cd control-plane && go test ./...
105+
cd control-plane && go test -tags=$(GOTAGS) ./...
105106
else
106107
cd control-plane && \
107108
gotestsum \
108109
--format=pkgname \
109110
--debug \
110111
--rerun-fails=3 \
111-
--packages="./..."
112+
--packages="./..." \
113+
-- \
114+
-tags=$(GOTAGS)
112115
endif
113116

114117

115118
.PHONY: control-plane-ent-test
116119
control-plane-ent-test: ## Run go test with Consul enterprise tests. The consul binary in your PATH must be Consul Enterprise.
117120
ifeq ("$(GOTESTSUM_PATH)","")
118-
cd control-plane && go test ./... -tags=enterprise
121+
cd control-plane && go test ./... -tags=$(GOTAGS),enterprise
119122
else
120123
cd control-plane && \
121124
gotestsum \
@@ -124,12 +127,12 @@ else
124127
--rerun-fails=3 \
125128
--packages="./..." \
126129
-- \
127-
--tags enterprise
130+
--tags $(GOTAGS),enterprise
128131
endif
129132

130133
.PHONY: control-plane-cov
131134
control-plane-cov: ## Run go test with code coverage.
132-
cd control-plane; go test ./... -coverprofile=coverage.out; go tool cover -html=coverage.out
135+
cd control-plane; go test -tags=$(GOTAGS) ./... -coverprofile=coverage.out; go tool cover -html=coverage.out
133136

134137
.PHONY: control-plane-clean
135138
control-plane-clean: ## Delete bin and pkg dirs.

acceptance/go.mod

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/hashicorp/consul/sdk v0.18.1
1616
github.com/hashicorp/go-multierror v1.1.1
1717
github.com/hashicorp/go-uuid v1.0.3
18-
github.com/hashicorp/go-version v1.6.0
18+
github.com/hashicorp/go-version v1.9.0
1919
github.com/hashicorp/serf v0.10.2
2020
github.com/hashicorp/vault/api v1.23.0
2121
github.com/stretchr/testify v1.11.1
@@ -37,41 +37,41 @@ require (
3737
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3838
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
3939
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
40-
github.com/deckarep/golang-set v1.7.1 // indirect
40+
github.com/deckarep/golang-set v1.8.0 // indirect
4141
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
4242
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
43-
github.com/fatih/color v1.18.0 // indirect
44-
github.com/fsnotify/fsnotify v1.9.0 // indirect
45-
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
43+
github.com/fatih/color v1.19.0 // indirect
44+
github.com/fsnotify/fsnotify v1.10.1 // indirect
45+
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
4646
github.com/ghodss/yaml v1.0.0 // indirect
4747
github.com/go-errors/errors v1.4.2 // indirect
4848
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
49-
github.com/go-openapi/jsonpointer v0.21.2 // indirect
50-
github.com/go-openapi/jsonreference v0.21.0 // indirect
51-
github.com/go-openapi/swag v0.24.1 // indirect
52-
github.com/go-openapi/swag/cmdutils v0.24.0 // indirect
53-
github.com/go-openapi/swag/conv v0.24.0 // indirect
54-
github.com/go-openapi/swag/fileutils v0.24.0 // indirect
55-
github.com/go-openapi/swag/jsonname v0.24.0 // indirect
56-
github.com/go-openapi/swag/jsonutils v0.24.0 // indirect
57-
github.com/go-openapi/swag/loading v0.24.0 // indirect
58-
github.com/go-openapi/swag/mangling v0.24.0 // indirect
59-
github.com/go-openapi/swag/netutils v0.24.0 // indirect
60-
github.com/go-openapi/swag/stringutils v0.24.0 // indirect
61-
github.com/go-openapi/swag/typeutils v0.24.0 // indirect
62-
github.com/go-openapi/swag/yamlutils v0.24.0 // indirect
49+
github.com/go-openapi/jsonpointer v0.23.1 // indirect
50+
github.com/go-openapi/jsonreference v0.21.6 // indirect
51+
github.com/go-openapi/swag v0.26.0 // indirect
52+
github.com/go-openapi/swag/cmdutils v0.26.0 // indirect
53+
github.com/go-openapi/swag/conv v0.26.0 // indirect
54+
github.com/go-openapi/swag/fileutils v0.26.0 // indirect
55+
github.com/go-openapi/swag/jsonname v0.26.0 // indirect
56+
github.com/go-openapi/swag/jsonutils v0.26.0 // indirect
57+
github.com/go-openapi/swag/loading v0.26.0 // indirect
58+
github.com/go-openapi/swag/mangling v0.26.0 // indirect
59+
github.com/go-openapi/swag/netutils v0.26.0 // indirect
60+
github.com/go-openapi/swag/stringutils v0.26.0 // indirect
61+
github.com/go-openapi/swag/typeutils v0.26.0 // indirect
62+
github.com/go-openapi/swag/yamlutils v0.26.0 // indirect
6363
github.com/go-sql-driver/mysql v1.5.0 // indirect
64-
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
64+
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
6565
github.com/google/btree v1.1.3 // indirect
66-
github.com/google/gnostic-models v0.7.0 // indirect
66+
github.com/google/gnostic-models v0.7.1 // indirect
6767
github.com/google/go-cmp v0.7.0 // indirect
6868
github.com/google/uuid v1.6.0 // indirect
6969
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
7070
github.com/gruntwork-io/go-commons v0.8.0 // indirect
7171
github.com/hashicorp/consul-k8s/control-plane/gateway07/gateway-api-0.7.1-custom v0.1.6 // indirect
7272
github.com/hashicorp/consul-k8s/version v0.0.0 // indirect
7373
github.com/hashicorp/errwrap v1.1.0 // indirect
74-
github.com/hashicorp/go-bexpr v0.1.11 // indirect
74+
github.com/hashicorp/go-bexpr v0.1.16 // indirect
7575
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
7676
github.com/hashicorp/go-hclog v1.6.3 // indirect
7777
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
@@ -84,13 +84,11 @@ require (
8484
github.com/hashicorp/golang-lru v1.0.2 // indirect
8585
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
8686
github.com/jmespath/go-jmespath v0.4.0 // indirect
87-
github.com/josharian/intern v1.0.0 // indirect
8887
github.com/json-iterator/go v1.1.12 // indirect
89-
github.com/mailru/easyjson v0.9.1 // indirect
90-
github.com/mattn/go-colorable v0.1.14 // indirect
91-
github.com/mattn/go-isatty v0.0.20 // indirect
88+
github.com/mattn/go-colorable v0.1.15 // indirect
89+
github.com/mattn/go-isatty v0.0.22 // indirect
9290
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
93-
github.com/miekg/dns v1.1.68 // indirect
91+
github.com/miekg/dns v1.1.72 // indirect
9492
github.com/mitchellh/go-homedir v1.1.0 // indirect
9593
github.com/mitchellh/mapstructure v1.5.0 // indirect
9694
github.com/mitchellh/pointerstructure v1.2.1 // indirect
@@ -104,28 +102,28 @@ require (
104102
github.com/pquerna/otp v1.2.0 // indirect
105103
github.com/prometheus/client_golang v1.23.2 // indirect
106104
github.com/prometheus/client_model v0.6.2 // indirect
107-
github.com/prometheus/common v0.66.1 // indirect
108-
github.com/prometheus/procfs v0.17.0 // indirect
105+
github.com/prometheus/common v0.68.1 // indirect
106+
github.com/prometheus/procfs v0.20.1 // indirect
109107
github.com/russross/blackfriday/v2 v2.1.0 // indirect
110108
github.com/ryanuber/go-glob v1.0.0 // indirect
111109
github.com/spf13/pflag v1.0.10 // indirect
112110
github.com/urfave/cli v1.22.12 // indirect
113111
github.com/x448/float16 v0.8.4 // indirect
114-
go.yaml.in/yaml/v2 v2.4.3 // indirect
112+
go.yaml.in/yaml/v2 v2.4.4 // indirect
115113
go.yaml.in/yaml/v3 v3.0.4 // indirect
116114
golang.org/x/crypto v0.52.0 // indirect
117-
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
118-
golang.org/x/mod v0.35.0 // indirect
115+
golang.org/x/exp v0.0.0-20260529124908-c761662dc8c9 // indirect
116+
golang.org/x/mod v0.36.0 // indirect
119117
golang.org/x/net v0.55.0 // indirect
120-
golang.org/x/oauth2 v0.34.0 // indirect
118+
golang.org/x/oauth2 v0.36.0 // indirect
121119
golang.org/x/sync v0.20.0 // indirect
122120
golang.org/x/sys v0.45.0 // indirect
123121
golang.org/x/term v0.43.0 // indirect
124122
golang.org/x/text v0.37.0 // indirect
125-
golang.org/x/time v0.14.0 // indirect
126-
golang.org/x/tools v0.44.0 // indirect
127-
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
128-
google.golang.org/protobuf v1.36.11 // indirect
123+
golang.org/x/time v0.15.0 // indirect
124+
golang.org/x/tools v0.45.0 // indirect
125+
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
126+
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
129127
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
130128
gopkg.in/inf.v0 v0.9.1 // indirect
131129
gopkg.in/yaml.v3 v3.0.1 // indirect
@@ -134,6 +132,6 @@ require (
134132
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
135133
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
136134
sigs.k8s.io/randfill v1.0.0 // indirect
137-
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
135+
sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect
138136
sigs.k8s.io/yaml v1.6.0 // indirect
139137
)

0 commit comments

Comments
 (0)