Skip to content

Commit e5a6930

Browse files
Upgrade SDK to use Kubernetes 1.26.2 (#6352)
* Upgrade Kubernetes dependencies from `1.25` to `1.26`. * Upgrade `sigs.k8s.io/controller-tools` from `v0.10.0` to `v0.11.3`. More info: https://github.com/kubernetes-sigs/controller-tools/releases * Upgrade `sigs.k8s.io/controller-runtime` dependency from `v0.13.0` to `v0.14.5`. More info: https://github.com/kubernetes-sigs/controller-runtime/releases * Upgrade `k8s.io/client-go` dependency from `v0.25.3` to `v0.26.2`. * Upgrade `controller-gen` dependency from `v0.10.0` to `v0.11.1`. * Upgrade `kube-rbac-proxy` from `v0.13.0` to `v0.13.1` * Modify gov4alpha plugin to use `go/v4-alpha` from Kubebuilder Signed-off-by: rashmigottipati <chowdary.grashmi@gmail.com>
1 parent 9d2f672 commit e5a6930

File tree

105 files changed

+838
-1460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+838
-1460
lines changed

changelog/fragments/bump-1.26.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
- Upgrade Kubernetes dependencies from `1.25` to `1.26`.
6+
- Upgrade `sigs.k8s.io/controller-tools` from `v0.10.0` to `v0.11.3`. More info: https://github.com/kubernetes-sigs/controller-tools/releases
7+
- Upgrade `sigs.k8s.io/controller-runtime` dependency from `v0.13.0` to `v0.14.5`. More info: https://github.com/kubernetes-sigs/controller-runtime/releases
8+
- Upgrade `k8s.io/client-go` dependency from `v0.25.3` to `v0.26.2`.
9+
- Upgrade `controller-gen` dependency from `v0.10.0` to `v0.11.1`.
10+
- Upgrade `kube-rbac-proxy` from `v0.13.0` to `v0.13.1`
11+
- Modify gov4alpha plugin to use `go/v4-alpha` from Kubebuilder
12+
13+
# kind is one of:
14+
# - addition
15+
# - change
16+
# - deprecation
17+
# - removal
18+
# - bugfix
19+
kind: "change"
20+
21+
# Is this a breaking change?
22+
breaking: false
23+
24+
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS
25+
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST!
26+
#
27+
# The generator auto-detects the PR number from the commit
28+
# message in which this file was originally added.
29+
#
30+
# What is the pull request number (without the "#")?
31+
# pull_request_override: 0
32+
33+
# Migration can be defined to automatically add a section to
34+
# the migration guide. This is required for breaking changes.
35+
migration:
36+
header: Upgrade K8s versions to use 1.26
37+
body: >
38+
Regarding the upcoming major changes in the plugin, please note that `go/v3` is being deprecated by Kubebuilder hence Operator SDK would also be migrating to `go/v4` soon.
39+
Following are the changes to be addressed in your project structure, `Makefile` and `go.mod` files:
40+
1) [go/v3, ansible/v1, helm/v1] Update your `go.mod` file to upgrade the dependencies and run `go mod tidy` to download them
41+
```go
42+
k8s.io/api v0.26.2
43+
k8s.io/apiextensions-apiserver v0.26.2
44+
k8s.io/apimachinery v0.26.2
45+
k8s.io/cli-runtime v0.26.2
46+
k8s.io/client-go v0.26.2
47+
k8s.io/kubectl v0.26.2
48+
sigs.k8s.io/controller-runtime v0.14.5
49+
sigs.k8s.io/controller-tools v0.11.3
50+
sigs.k8s.io/kubebuilder/v3 v3.9.1
51+
```
52+
2) [go/v3, ansible/v1, helm/v1] With the bump to Kubebuilder 3.9.1, the `go/v3` projects are now scaffolded with 0.13.1 version of kube-rbac-proxy. Modify the version of kube-rbac-proxy in the following scaffolded files:
53+
- config/default/manager_auth_proxy_patch.yaml
54+
- bundle/manifests/memcached-operator.clusterserviceversion.yaml
55+
56+
```diff
57+
- gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
58+
+ gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
59+
```
60+
3) [gov4alpha] For scaffolds, replace scaffoldings of v1beta1 by using `k8s.io/api/admission/v1` instead of `k8s.io/api/admission/v1beta1` as v1beta1 is removed in latest k8s.
61+
```diff
62+
- admissionv1beta1 "k8s.io/api/admission/v1beta1"
63+
+ admissionv1 "k8s.io/api/admission/v1"
64+
```
65+
4) [gov4alpha] The project structure has changed from `/controllers` to `internal/controller/`. Modify the Dockerfile of the `go/v4-alpha` plugin to below:
66+
```diff
67+
- COPY controllers/ controllers/
68+
+ COPY internal/controller/ internal/controller/
69+
```
70+
5) [go/v3, gov4alpha] Update your Makefile by
71+
- Replacing `ENVTEST_K8S_VERSION = 1.25` with `ENVTEST_K8S_VERSION = 1.26`.
72+
- Using `manifests generate fmt vet` to build manager binary by replacing `generate fmt vet` in the build target to `manifests generate fmt vet`:
73+
```diff
74+
- build: generate fmt vet ## Build manager binary.
75+
+ build: manifests generate fmt vet ## Build manager binary.
76+
```
77+
6) [gov4alpha] The gov4alpha plugin is now being scaffolded with Kubebuilder's go/v4-alpha which has a modified project file structure according to Go's best practices. Refer https://github.com/kubernetes-sigs/kubebuilder/pull/2985 for changes. Make the following changes in your scaffolded project if gov4aplha plugin was used: - Replacing `go run ./main.go` to `go run ./cmd/main.go` due to the change in project structure.
78+
- Replacing
79+
```diff
80+
- `test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)`
81+
+ test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
82+
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
83+
```

go.mod

Lines changed: 48 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,44 @@ require (
1111
github.com/kr/text v0.2.0
1212
github.com/markbates/inflect v1.0.4
1313
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
14-
github.com/onsi/ginkgo/v2 v2.2.0
15-
github.com/onsi/gomega v1.20.2
16-
github.com/operator-framework/api v0.17.4-0.20221221181915-f1b729684854
17-
github.com/operator-framework/helm-operator-plugins v0.0.12-0.20230109213218-ebfbea851192
18-
github.com/operator-framework/java-operator-plugins v0.7.1-0.20221007075838-2e24140314fb
19-
github.com/operator-framework/operator-lib v0.11.1-0.20220921174810-791cc547e6c5
20-
github.com/operator-framework/operator-manifest-tools v0.2.3-0.20230213223805-9262eb48b716
21-
github.com/operator-framework/operator-registry v1.26.3-0.20220930210947-614d6a955dc0
22-
github.com/prometheus/client_golang v1.13.0
23-
github.com/prometheus/client_model v0.2.0
14+
github.com/onsi/ginkgo/v2 v2.7.0
15+
github.com/onsi/gomega v1.24.2
16+
github.com/operator-framework/api v0.17.4-0.20230223191600-0131a6301e42
17+
github.com/operator-framework/helm-operator-plugins v0.0.12-0.20230307164205-6e30bde28688
18+
github.com/operator-framework/java-operator-plugins v0.7.1-0.20230306190439-0eed476d2b75
19+
github.com/operator-framework/operator-lib v0.11.1-0.20230306195046-28cadc6b6055
20+
github.com/operator-framework/operator-manifest-tools v0.2.3-0.20230227155221-caa8b9e1ab12
21+
github.com/operator-framework/operator-registry v1.26.5-0.20230307160312-3bfcb23fa7d0
22+
github.com/prometheus/client_golang v1.14.0
23+
github.com/prometheus/client_model v0.3.0
2424
github.com/sergi/go-diff v1.2.0
2525
github.com/sirupsen/logrus v1.9.0
26-
github.com/spf13/afero v1.9.2
27-
github.com/spf13/cobra v1.6.0
26+
github.com/spf13/afero v1.9.3
27+
github.com/spf13/cobra v1.6.1
2828
github.com/spf13/pflag v1.0.5
2929
github.com/spf13/viper v1.10.0
30-
github.com/stretchr/testify v1.8.0
30+
github.com/stretchr/testify v1.8.1
3131
github.com/thoas/go-funk v0.8.0
32-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
33-
golang.org/x/text v0.3.8
34-
golang.org/x/tools v0.1.12
32+
golang.org/x/mod v0.7.0
33+
golang.org/x/text v0.7.0
34+
golang.org/x/tools v0.5.0
3535
gomodules.xyz/jsonpatch/v3 v3.0.1
3636
helm.sh/helm/v3 v3.10.3
37-
k8s.io/api v0.25.3
38-
k8s.io/apiextensions-apiserver v0.25.3
39-
k8s.io/apimachinery v0.25.3
40-
k8s.io/cli-runtime v0.25.3
41-
k8s.io/client-go v0.25.3
42-
k8s.io/kubectl v0.25.3
43-
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85
44-
sigs.k8s.io/controller-runtime v0.13.0
45-
sigs.k8s.io/controller-tools v0.10.0
46-
sigs.k8s.io/kubebuilder/v3 v3.7.1-0.20221011212440-eff842a46496
37+
k8s.io/api v0.26.2
38+
k8s.io/apiextensions-apiserver v0.26.2
39+
k8s.io/apimachinery v0.26.2
40+
k8s.io/cli-runtime v0.26.2
41+
k8s.io/client-go v0.26.2
42+
k8s.io/kubectl v0.26.2
43+
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
44+
sigs.k8s.io/controller-runtime v0.14.5
45+
sigs.k8s.io/controller-tools v0.11.3
46+
sigs.k8s.io/kubebuilder/v3 v3.9.1
4747
sigs.k8s.io/yaml v1.3.0
4848
)
4949

5050
require (
51-
cloud.google.com/go v0.99.0 // indirect
5251
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
53-
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
54-
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
55-
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
56-
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
57-
github.com/Azure/go-autorest/logger v0.2.1 // indirect
58-
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
5952
github.com/BurntSushi/toml v1.2.0 // indirect
6053
github.com/MakeNowJust/heredoc v1.0.0 // indirect
6154
github.com/Masterminds/goutils v1.1.1 // indirect
@@ -66,12 +59,13 @@ require (
6659
github.com/Microsoft/hcsshim v0.9.4 // indirect
6760
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect
6861
github.com/adrg/xdg v0.4.0 // indirect
69-
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed // indirect
62+
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
7063
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
7164
github.com/beorn7/perks v1.0.1 // indirect
7265
github.com/bshuster-repo/logrus-logstash-hook v1.0.0 // indirect
7366
github.com/bugsnag/bugsnag-go v1.5.3 // indirect
7467
github.com/bugsnag/panicwrap v1.2.0 // indirect
68+
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
7569
github.com/cespare/xxhash/v2 v2.1.2 // indirect
7670
github.com/chai2010/gettext-go v1.0.2 // indirect
7771
github.com/containerd/cgroups v1.0.4 // indirect
@@ -97,30 +91,30 @@ require (
9791
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
9892
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
9993
github.com/fatih/color v1.13.0 // indirect
100-
github.com/felixge/httpsnoop v1.0.1 // indirect
94+
github.com/felixge/httpsnoop v1.0.3 // indirect
10195
github.com/fsnotify/fsnotify v1.6.0 // indirect
10296
github.com/ghodss/yaml v1.0.0 // indirect
10397
github.com/go-errors/errors v1.4.2 // indirect
10498
github.com/go-git/gcfg v1.5.0 // indirect
10599
github.com/go-git/go-billy/v5 v5.1.0 // indirect
106100
github.com/go-git/go-git/v5 v5.3.0 // indirect
107101
github.com/go-gorp/gorp/v3 v3.0.2 // indirect
102+
github.com/go-logr/stdr v1.2.2 // indirect
108103
github.com/go-logr/zapr v1.2.3 // indirect
109104
github.com/go-openapi/jsonpointer v0.19.5 // indirect
110105
github.com/go-openapi/jsonreference v0.20.0 // indirect
111106
github.com/go-openapi/swag v0.22.3 // indirect
112107
github.com/gobuffalo/envy v1.6.5 // indirect
113-
github.com/gobuffalo/flect v0.3.0 // indirect
108+
github.com/gobuffalo/flect v1.0.0 // indirect
114109
github.com/gobwas/glob v0.2.3 // indirect
115110
github.com/gofrs/uuid v4.0.0+incompatible // indirect
116111
github.com/gogo/protobuf v1.3.2 // indirect
117-
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
118112
github.com/golang-migrate/migrate/v4 v4.6.2 // indirect
119113
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
120114
github.com/golang/protobuf v1.5.2 // indirect
121115
github.com/gomodule/redigo v1.8.2 // indirect
122116
github.com/google/btree v1.1.2 // indirect
123-
github.com/google/cel-go v0.12.5 // indirect
117+
github.com/google/cel-go v0.12.6 // indirect
124118
github.com/google/gnostic v0.6.9 // indirect
125119
github.com/google/go-cmp v0.5.9 // indirect
126120
github.com/google/go-containerregistry v0.8.0 // indirect
@@ -131,7 +125,7 @@ require (
131125
github.com/gorilla/mux v1.8.0 // indirect
132126
github.com/gosuri/uitable v0.0.4 // indirect
133127
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
134-
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
128+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
135129
github.com/h2non/filetype v1.1.1 // indirect
136130
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
137131
github.com/hashicorp/hcl v1.0.0 // indirect
@@ -182,7 +176,6 @@ require (
182176
github.com/prometheus/procfs v0.8.0 // indirect
183177
github.com/rivo/uniseg v0.4.2 // indirect
184178
github.com/rubenv/sql-migrate v1.2.0 // indirect
185-
github.com/russross/blackfriday v1.6.0 // indirect
186179
github.com/russross/blackfriday/v2 v2.1.0 // indirect
187180
github.com/shopspring/decimal v1.3.1 // indirect
188181
github.com/spf13/cast v1.5.0 // indirect
@@ -200,27 +193,26 @@ require (
200193
go.etcd.io/bbolt v1.3.6 // indirect
201194
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
202195
go.opencensus.io v0.23.0 // indirect
203-
go.opentelemetry.io/contrib v0.20.0 // indirect
204-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
196+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 // indirect
205197
go.opentelemetry.io/otel v1.11.0 // indirect
206-
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
207-
go.opentelemetry.io/otel/metric v0.20.0 // indirect
198+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
199+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
200+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
201+
go.opentelemetry.io/otel/metric v0.31.0 // indirect
208202
go.opentelemetry.io/otel/sdk v1.11.0 // indirect
209-
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
210-
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
211203
go.opentelemetry.io/otel/trace v1.11.0 // indirect
212204
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
213205
go.starlark.net v0.0.0-20221010140840-6bf6f0955179 // indirect
214206
go.uber.org/atomic v1.10.0 // indirect
215207
go.uber.org/multierr v1.8.0 // indirect
216-
go.uber.org/zap v1.23.0 // indirect
217-
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
218-
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
208+
go.uber.org/zap v1.24.0 // indirect
209+
golang.org/x/crypto v0.1.0 // indirect
210+
golang.org/x/net v0.7.0 // indirect
219211
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
220-
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
221-
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
222-
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
223-
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
212+
golang.org/x/sync v0.1.0 // indirect
213+
golang.org/x/sys v0.5.0 // indirect
214+
golang.org/x/term v0.5.0 // indirect
215+
golang.org/x/time v0.3.0 // indirect
224216
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
225217
gomodules.xyz/orderedmap v0.1.0 // indirect
226218
google.golang.org/appengine v1.6.7 // indirect
@@ -232,12 +224,12 @@ require (
232224
gopkg.in/warnings.v0 v0.1.2 // indirect
233225
gopkg.in/yaml.v2 v2.4.0 // indirect
234226
gopkg.in/yaml.v3 v3.0.1 // indirect
235-
k8s.io/apiserver v0.25.3 // indirect
236-
k8s.io/component-base v0.25.3 // indirect
227+
k8s.io/apiserver v0.26.2 // indirect
228+
k8s.io/component-base v0.26.2 // indirect
237229
k8s.io/klog/v2 v2.80.1 // indirect
238230
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
239231
oras.land/oras-go v1.2.0 // indirect
240-
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 // indirect
232+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.35 // indirect
241233
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
242234
sigs.k8s.io/kustomize/api v0.12.1 // indirect
243235
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
@@ -250,14 +242,4 @@ replace (
250242
// latest tag resolves to a very old version. this is only used for spinning up local test registries
251243
github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
252244
github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.10.0
253-
254-
// TODO: Pinning due to the k8s.io/apiserver and k8s.io/component-base
255-
// v0.25.3 indirect dependencies needing opentelemetry packages
256-
// at v0.20.0 . It looks like they will be bumped to use opentelemetry
257-
// packages at v1.10.0 as of their v0.26.0 release. We can remove
258-
// this replacement when we bump to support K8s 1.26.x
259-
go.opentelemetry.io/otel => go.opentelemetry.io/otel v0.20.0
260-
go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v0.20.0
261-
go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v0.20.0
262-
go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v0.7.0
263245
)

0 commit comments

Comments
 (0)