Skip to content

Commit

Permalink
update k8s 1.22
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Macedo <cmacedo@redhat.com>
  • Loading branch information
Camila Macedo committed Sep 21, 2021
1 parent 19750cd commit e103eee
Show file tree
Hide file tree
Showing 36 changed files with 653 additions and 463 deletions.
62 changes: 62 additions & 0 deletions changelog/fragments/bump-1.22.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
- Upgrade the Kubernetes dependencies from `1.21` to `1.22`.
- Upgrade the controller-gen dependency from `v0.6.2` to `v0.7.0`. More info: https://github.com/kubernetes-sigs/controller-tools/releases
- Upgrade the sigs.k8s.io/controller-runtime dependency from `v0.9.2` to `v0.10.0`. More info: https://github.com/kubernetes-sigs/controller-runtime/releases
- Upgrade the Env Test used from `1.21` to `1.22`.
# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "change"
# Is this a breaking change?
breaking: false
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST!
#
# The generator auto-detects the PR number from the commit
# message in which this file was originally added.
#
# What is the pull request number (without the "#")?
# pull_request_override: 0
# Migration can be defined to automatically add a section to
# the migration guide. This is required for breaking changes.
migration:
header: Upgrade K8s versions to use 1.22 (golang/v3)
body: >
Note that to ensure the backwords compatibility SDK tool will try to downgrade the versions used if you need to still scaffolding the v1beta1 for CRDs and Webhooks to pusblish your solutions into the old cluster versions.
However, note that this versions are no longer supported on Kubernetes 1.22+, and for sigs.k8s.io/controller-runtime v0.10.0 or controller-gen v0.7.0.
Following the changes to be addressed to your Makefile and go.mod file if you are
not using the `v1beta1` K8s APIs which are no longer supported from k8s `1.22` version.
1) Update your `go.mod` file to upgrade the dependencies and run `go mod tidy` to download then
```go
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
sigs.k8s.io/controller-runtime v0.10.0
```
2) Update your Makafile by
- Replacing `ENVTEST_K8S_VERSION = 1.21` with `ENVTEST_K8S_VERSION = 1.22`
- Replacing `$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases` with `$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases`
- Now, you can also remove from this file
```
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
```
3) Replace your markers `admissionReviewVersions={v1,v1beta1}` with `admissionReviewVersions=v1`
4) Run `make manifest` to re-generate your manifests with latest versions.
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/markbates/inflect v1.0.4
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/onsi/gomega v1.15.0
github.com/operator-framework/api v0.10.5
github.com/operator-framework/java-operator-plugins v0.1.0
github.com/operator-framework/operator-lib v0.6.0
Expand All @@ -22,24 +22,23 @@ require (
github.com/sergi/go-diff v1.1.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.1.3
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
github.com/thoas/go-funk v0.8.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2
golang.org/x/tools v0.1.3
golang.org/x/tools v0.1.5
gomodules.xyz/jsonpatch/v3 v3.0.1
helm.sh/helm/v3 v3.6.2
k8s.io/api v0.21.2
k8s.io/apiextensions-apiserver v0.21.2
k8s.io/apimachinery v0.21.2
k8s.io/api v0.22.2
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/cli-runtime v0.21.0
k8s.io/client-go v0.21.2
k8s.io/client-go v0.22.2
k8s.io/kubectl v0.21.0
sigs.k8s.io/controller-runtime v0.9.2
sigs.k8s.io/controller-tools v0.6.0
sigs.k8s.io/controller-runtime v0.10.0
sigs.k8s.io/controller-tools v0.7.0
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210803185103-51e4a9aa5055
sigs.k8s.io/yaml v1.2.0
)
Expand All @@ -54,6 +53,8 @@ replace (
github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.10.0
golang.org/x/text => golang.org/x/text v0.3.3 // Required to fix CVE-2020-14040
sigs.k8s.io/kubebuilder/v3 => github.com/camilamacedo86/kubebuilder/v3 v3.0.0-20210920222540-6766994bb683

)

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

0 comments on commit e103eee

Please sign in to comment.