Skip to content

Commit fb2a657

Browse files
Bump k8s dependencies to 1.21+ (#5057)
This commit bumps: 1. k8s dependencies to 1.21+. 2. Bump controller-runtime to 0.9.2 and kb to the latest commit. 2. Bump kustomize version in Ansible and Helm operator projects. Signed-off-by: varshaprasad96 <[email protected]>
1 parent 35313e8 commit fb2a657

File tree

28 files changed

+606
-455
lines changed

28 files changed

+606
-455
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export IMAGE_VERSION = v1.9.0
99
export SIMPLE_VERSION = $(shell (test "$(shell git describe)" = "$(shell git describe --abbrev=0)" && echo $(shell git describe)) || echo $(shell git describe --abbrev=0)+git)
1010
export GIT_VERSION = $(shell git describe --dirty --tags --always)
1111
export GIT_COMMIT = $(shell git rev-parse HEAD)
12+
# TODO: bump this to 1.21, after kubectl `--generator` flag is removed from e2e tests.
1213
export K8S_VERSION = 1.20.2
1314

1415
# Build settings
@@ -144,10 +145,10 @@ e2e_targets := test-e2e $(e2e_tests)
144145

145146
.PHONY: test-e2e-setup
146147
export KIND_CLUSTER := operator-sdk-e2e
147-
export KUBEBUILDER_ASSETS := $(PWD)/$(TOOLS_DIR)
148+
149+
export KUBEBUILDER_ASSETS = $(PWD)/$(shell go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest && $(shell go env GOPATH)/bin/setup-envtest use $(K8S_VERSION) --bin-dir tools/bin/ -p path)
148150
test-e2e-setup: build
149151
$(SCRIPTS_DIR)/fetch kind 0.11.0
150-
$(SCRIPTS_DIR)/fetch envtest 0.8.3
151152
$(SCRIPTS_DIR)/fetch kubectl $(K8S_VERSION) # Install kubectl AFTER envtest because envtest includes its own kubectl binary
152153
[[ "`$(TOOLS_DIR)/kind get clusters`" =~ "$(KIND_CLUSTER)" ]] || $(TOOLS_DIR)/kind create cluster --image="kindest/node:v$(K8S_VERSION)" --name $(KIND_CLUSTER)
153154

@@ -160,8 +161,8 @@ test-e2e-teardown:
160161
# Double colon rules allow repeated rule declarations.
161162
# Repeated rules are executed in the order they appear.
162163
$(e2e_targets):: test-e2e-setup image/scorecard-test
163-
164164
test-e2e:: $(e2e_tests) ## Run e2e tests
165+
165166
test-e2e-go:: image/custom-scorecard-tests ## Run Go e2e tests
166167
go test ./test/e2e/go -v -ginkgo.v
167168
test-e2e-ansible:: image/ansible-operator ## Run Ansible e2e tests
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
(ansible/v1) Bumped Kuztomize version in ansible project scaffolding to 3.8.7.
6+
7+
# kind is one of:
8+
# - addition
9+
# - change
10+
# - deprecation
11+
# - removal
12+
# - bugfix
13+
kind: "change"
14+
15+
# Is this a breaking change?
16+
breaking: true
17+
18+
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS
19+
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST!
20+
#
21+
# The generator auto-detects the PR number from the commit
22+
# message in which this file was originally added.
23+
#
24+
# What is the pull request number (without the "#")?
25+
# pull_request_override: 0
26+
27+
28+
# Migration can be defined to automatically add a section to
29+
# the migration guide. This is required for breaking changes.
30+
migration:
31+
header: (ansible/v1) Bump Kuztomize version in helm project scaffolding to 3.8.7
32+
body: >
33+
Ansible projects are now scaffolded with `Kuztomize` version `3.8.7`. This version of kustomize
34+
requires that the path to patch file be provided with the `--path` flag in `add patch` command.
35+
In `molecule/default/prepare.yml` file, update the command under `Set pull policy`, to be:
36+
```diff
37+
- name: Set pull policy
38+
- command: '{{ "{{ kustomize }}" }} edit add patch pull_policy/{{ "{{ operator_pull_policy }}" }}.yaml'
39+
+ command: '{{ "{{ kustomize }}" }} edit add patch --path pull_policy/{{ "{{ operator_pull_policy }}" }}.yaml'
40+
```
41+

go.mod

+26-27
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,41 @@ go 1.16
55
require (
66
github.com/blang/semver/v4 v4.0.0
77
github.com/fatih/structtag v1.1.0
8-
github.com/go-logr/logr v0.3.0
8+
github.com/go-logr/logr v0.4.0
99
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
10-
github.com/kr/text v0.1.0
10+
github.com/kr/text v0.2.0
1111
github.com/markbates/inflect v1.0.4
1212
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
13-
github.com/onsi/ginkgo v1.15.2
14-
github.com/onsi/gomega v1.11.0
15-
github.com/operator-framework/api v0.8.2-0.20210526151024-41d37db9141f
16-
github.com/operator-framework/java-operator-plugins v0.0.0-20210629174633-88afbd6d98b2
17-
github.com/operator-framework/operator-lib v0.4.1
18-
github.com/operator-framework/operator-registry v1.15.3
19-
github.com/prometheus/client_golang v1.7.1
13+
github.com/onsi/ginkgo v1.16.4
14+
github.com/onsi/gomega v1.13.0
15+
github.com/operator-framework/api v0.10.0
16+
github.com/operator-framework/java-operator-plugins v0.0.0-20210708174638-463fb91f3d5e
17+
github.com/operator-framework/operator-lib v0.5.0
18+
github.com/operator-framework/operator-registry v1.17.4
19+
github.com/prometheus/client_golang v1.11.0
2020
github.com/prometheus/client_model v0.2.0
2121
github.com/sergi/go-diff v1.1.0
22-
github.com/sirupsen/logrus v1.7.0
23-
github.com/spf13/afero v1.2.2
24-
github.com/spf13/cobra v1.1.1
22+
github.com/sirupsen/logrus v1.8.1
23+
github.com/spf13/afero v1.6.0
24+
github.com/spf13/cobra v1.1.3
2525
github.com/spf13/pflag v1.0.5
2626
github.com/spf13/viper v1.7.0
27-
github.com/stretchr/testify v1.6.1
27+
github.com/stretchr/testify v1.7.0
2828
github.com/thoas/go-funk v0.8.0
2929
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
3030
golang.org/x/mod v0.4.2
31-
golang.org/x/sys v0.0.0-20210521090106-6ca3eb03dfc2 // indirect
32-
golang.org/x/tools v0.1.1
31+
golang.org/x/tools v0.1.3
3332
gomodules.xyz/jsonpatch/v3 v3.0.1
34-
helm.sh/helm/v3 v3.4.1
35-
k8s.io/api v0.20.2
36-
k8s.io/apiextensions-apiserver v0.20.2
37-
k8s.io/apimachinery v0.20.2
38-
k8s.io/cli-runtime v0.20.2
39-
k8s.io/client-go v0.20.2
40-
k8s.io/kubectl v0.20.2
41-
rsc.io/letsencrypt v0.0.3 // indirect
42-
sigs.k8s.io/controller-runtime v0.8.3
43-
sigs.k8s.io/controller-tools v0.5.0
44-
sigs.k8s.io/kubebuilder/v3 v3.0.0-beta.1
33+
helm.sh/helm/v3 v3.6.2
34+
k8s.io/api v0.21.2
35+
k8s.io/apiextensions-apiserver v0.21.2
36+
k8s.io/apimachinery v0.21.2
37+
k8s.io/cli-runtime v0.21.0
38+
k8s.io/client-go v0.21.2
39+
k8s.io/kubectl v0.21.0
40+
sigs.k8s.io/controller-runtime v0.9.2
41+
sigs.k8s.io/controller-tools v0.6.0
42+
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210707171043-359e8aa70c2b
4543
sigs.k8s.io/yaml v1.2.0
4644
)
4745

@@ -51,9 +49,10 @@ replace (
5149
// from an init function in containerd. This replace can be removed when
5250
// one of our direct dependencies begins using containerd v1.4.0+
5351
github.com/containerd/containerd => github.com/containerd/containerd v1.4.3
52+
// latest tag resolves to a very old version. this is only used for spinning up local test registries
53+
github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
5454
github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.10.0
5555
golang.org/x/text => golang.org/x/text v0.3.3 // Required to fix CVE-2020-14040
56-
sigs.k8s.io/kubebuilder/v3 => sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210518234629-191170994550
5756
)
5857

5958
exclude github.com/spf13/viper v1.3.2 // Required to fix CVE-2018-1098

0 commit comments

Comments
 (0)