Skip to content

Commit 3f959fc

Browse files
committed
Drop the logr pin by moving to Kubernetes 1.23 libraries
The replace holding logr at v0.4.0 stopped go mod tidy working. grpc 1.79's test packages reach github.com/go-logr/logr/funcr through OpenTelemetry, and tidy walks tests of dependencies, so it reported: github.com/go-logr/logr/funcr: module github.com/go-logr/logr@latest found (replaced by github.com/go-logr/logr@v0.4.0), but does not contain package github.com/go-logr/logr/funcr Dependabot runs a strict go mod tidy, so every Go module update it opened would have failed the same way. The pin existed because klog v2.8.0 and controller-runtime v0.9.0 are written against logr v0, where Logger is an interface. The way out is to raise those rather than hold logr back. controller-runtime v0.11 is the first release built against logr v1, and it pairs with the Kubernetes 1.23 libraries, so: sigs.k8s.io/controller-runtime v0.9.0 -> v0.11.2 k8s.io/{api,apimachinery,client-go, apiextensions-apiserver,code-generator} v0.21.5 -> v0.23.17 github.com/go-logr/zapr v0.4.0 -> v1.2.4 k8s.io/klog/v2 (indirect) v2.8.0 -> v2.30.0 The only source change the move needs is the Kubernetes 1.23 rename of the embedded Handler on corev1.Probe to ProbeHandler, in the three deployment overrides that set gRPC-web probes. Everything else compiles as is; the operator already passes logr.Logger by value. Verified with go build, go vet, a strict go mod tidy, and the unit tests (85 packages ok, controllers included). The integration and end-to-end suites need a cluster and are left to CI. Assisted-by: anthropic:claude-fable-5-1 Signed-off-by: Ry Jones <ry@linux.com>
1 parent 6ea612b commit 3f959fc

5 files changed

Lines changed: 87 additions & 68 deletions

File tree

‎go.mod‎

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/cloudflare/cfssl v1.4.1
77
github.com/docker/docker v28.3.3+incompatible
88
github.com/go-logr/logr v1.4.3
9-
github.com/go-logr/zapr v0.4.0
9+
github.com/go-logr/zapr v1.2.4
1010
github.com/go-test/deep v1.0.2
1111
github.com/gogo/protobuf v1.3.2
1212
github.com/hyperledger/fabric v0.0.0-20240618194258-7c3876255bf0
@@ -25,14 +25,14 @@ require (
2525
github.com/vrischmann/envconfig v1.3.0
2626
go.uber.org/zap v1.27.0
2727
gopkg.in/yaml.v2 v2.4.0
28-
k8s.io/api v0.21.5
29-
k8s.io/apiextensions-apiserver v0.21.5
30-
k8s.io/apimachinery v0.21.5
31-
k8s.io/client-go v0.21.5
32-
k8s.io/code-generator v0.21.5
33-
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b
34-
sigs.k8s.io/controller-runtime v0.9.0
35-
sigs.k8s.io/yaml v1.2.0
28+
k8s.io/api v0.23.17
29+
k8s.io/apiextensions-apiserver v0.23.17
30+
k8s.io/apimachinery v0.23.17
31+
k8s.io/client-go v0.23.17
32+
k8s.io/code-generator v0.23.17
33+
k8s.io/utils v0.0.0-20211116205334-6203023598ed
34+
sigs.k8s.io/controller-runtime v0.11.2
35+
sigs.k8s.io/yaml v1.3.0
3636
)
3737

3838
require (
@@ -64,17 +64,16 @@ require (
6464
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
6565
github.com/eapache/queue v1.1.0 // indirect
6666
github.com/emicklei/go-restful v2.16.0+incompatible // indirect
67-
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
67+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
6868
github.com/felixge/httpsnoop v1.0.4 // indirect
6969
github.com/fsnotify/fsnotify v1.7.0 // indirect
7070
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
7171
github.com/go-kit/kit v0.10.0 // indirect
7272
github.com/go-ldap/ldap/v3 v3.4.12 // indirect
7373
github.com/go-logfmt/logfmt v0.5.1 // indirect
74-
github.com/go-openapi/jsonpointer v0.19.3 // indirect
75-
github.com/go-openapi/jsonreference v0.19.3 // indirect
76-
github.com/go-openapi/spec v0.19.5 // indirect
77-
github.com/go-openapi/swag v0.19.5 // indirect
74+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
75+
github.com/go-openapi/jsonreference v0.19.5 // indirect
76+
github.com/go-openapi/swag v0.19.14 // indirect
7877
github.com/go-sql-driver/mysql v1.5.0 // indirect
7978
github.com/go-stack/stack v1.8.1 // indirect
8079
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -89,16 +88,16 @@ require (
8988
github.com/gorilla/mux v1.8.0 // indirect
9089
github.com/grantae/certinfo v0.0.0-20170412194111-59d56a35515b // indirect
9190
github.com/hashicorp/go-version v1.4.0 // indirect
92-
github.com/hashicorp/golang-lru v0.5.4 // indirect
9391
github.com/hashicorp/hcl v1.0.0 // indirect
9492
github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect
9593
github.com/jmhodges/clock v0.0.0-20160418191101-880ee4c33548 // indirect
9694
github.com/jmoiron/sqlx v1.3.4 // indirect
95+
github.com/josharian/intern v1.0.0 // indirect
9796
github.com/json-iterator/go v1.1.12 // indirect
9897
github.com/kilic/bls12-381 v0.1.0 // indirect
9998
github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46 // indirect
10099
github.com/magiconair/properties v1.8.7 // indirect
101-
github.com/mailru/easyjson v0.7.0 // indirect
100+
github.com/mailru/easyjson v0.7.6 // indirect
102101
github.com/mattn/go-sqlite3 v1.14.18 // indirect
103102
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
104103
github.com/miekg/pkcs11 v1.1.1 // indirect
@@ -145,18 +144,15 @@ require (
145144
gopkg.in/inf.v0 v0.9.1 // indirect
146145
gopkg.in/ini.v1 v1.67.0 // indirect
147146
gopkg.in/yaml.v3 v3.0.1 // indirect
148-
k8s.io/component-base v0.21.5 // indirect
149-
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 // indirect
150-
k8s.io/klog/v2 v2.8.0 // indirect
151-
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect
152-
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
147+
k8s.io/component-base v0.23.17 // indirect
148+
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c // indirect
149+
k8s.io/klog/v2 v2.30.0 // indirect
150+
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
151+
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
152+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
153153
)
154154

155155
replace (
156-
// klog v2.8.0 and controller-runtime v0.9.0 are written against logr v0,
157-
// where Logger is an interface and compares to nil. logr v1 made it a
158-
// struct, so raising it here stops those two compiling.
159-
github.com/go-logr/logr => github.com/go-logr/logr v0.4.0
160156
github.com/onsi/ginkgo/v2 => github.com/onsi/ginkgo/v2 v2.1.4
161157
github.com/onsi/gomega => github.com/onsi/gomega v1.19.0
162158
)

0 commit comments

Comments
 (0)