Skip to content

Bump k8s dependencies to 1.21+ #5057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ export IMAGE_VERSION = v1.9.0
export SIMPLE_VERSION = $(shell (test "$(shell git describe)" = "$(shell git describe --abbrev=0)" && echo $(shell git describe)) || echo $(shell git describe --abbrev=0)+git)
export GIT_VERSION = $(shell git describe --dirty --tags --always)
export GIT_COMMIT = $(shell git rev-parse HEAD)
# TODO: bump this to 1.21, after kubectl `--generator` flag is removed from e2e tests.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving this for now, since --generator flag is deprecated here and the test needs to be re-written, in sdk and kubebuilder. Will do this in a follow up PR, as I didn't want to block updating of k8s in projects because of this.

export K8S_VERSION = 1.20.2

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

.PHONY: test-e2e-setup
export KIND_CLUSTER := operator-sdk-e2e
export KUBEBUILDER_ASSETS := $(PWD)/$(TOOLS_DIR)

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)
test-e2e-setup: build
$(SCRIPTS_DIR)/fetch kind 0.11.0
$(SCRIPTS_DIR)/fetch envtest 0.8.3
$(SCRIPTS_DIR)/fetch kubectl $(K8S_VERSION) # Install kubectl AFTER envtest because envtest includes its own kubectl binary
[[ "`$(TOOLS_DIR)/kind get clusters`" =~ "$(KIND_CLUSTER)" ]] || $(TOOLS_DIR)/kind create cluster --image="kindest/node:v$(K8S_VERSION)" --name $(KIND_CLUSTER)

@@ -160,8 +161,8 @@ test-e2e-teardown:
# Double colon rules allow repeated rule declarations.
# Repeated rules are executed in the order they appear.
$(e2e_targets):: test-e2e-setup image/scorecard-test

test-e2e:: $(e2e_tests) ## Run e2e tests

test-e2e-go:: image/custom-scorecard-tests ## Run Go e2e tests
go test ./test/e2e/go -v -ginkgo.v
test-e2e-ansible:: image/ansible-operator ## Run Ansible e2e tests
41 changes: 41 additions & 0 deletions changelog/fragments/bump-kustomize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
(ansible/v1) Bumped Kuztomize version in ansible project scaffolding to 3.8.7.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "change"

# Is this a breaking change?
breaking: true

# 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: (ansible/v1) Bump Kuztomize version in helm project scaffolding to 3.8.7
body: >
Ansible projects are now scaffolded with `Kuztomize` version `3.8.7`. This version of kustomize
requires that the path to patch file be provided with the `--path` flag in `add patch` command.
In `molecule/default/prepare.yml` file, update the command under `Set pull policy`, to be:
```diff
- name: Set pull policy
- command: '{{ "{{ kustomize }}" }} edit add patch pull_policy/{{ "{{ operator_pull_policy }}" }}.yaml'
+ command: '{{ "{{ kustomize }}" }} edit add patch --path pull_policy/{{ "{{ operator_pull_policy }}" }}.yaml'
```

53 changes: 26 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -5,43 +5,41 @@ go 1.16
require (
github.com/blang/semver/v4 v4.0.0
github.com/fatih/structtag v1.1.0
github.com/go-logr/logr v0.3.0
github.com/go-logr/logr v0.4.0
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/kr/text v0.1.0
github.com/kr/text v0.2.0
github.com/markbates/inflect v1.0.4
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/onsi/ginkgo v1.15.2
github.com/onsi/gomega v1.11.0
github.com/operator-framework/api v0.8.2-0.20210526151024-41d37db9141f
github.com/operator-framework/java-operator-plugins v0.0.0-20210629174633-88afbd6d98b2
github.com/operator-framework/operator-lib v0.4.1
github.com/operator-framework/operator-registry v1.15.3
github.com/prometheus/client_golang v1.7.1
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/operator-framework/api v0.10.0
github.com/operator-framework/java-operator-plugins v0.0.0-20210708174638-463fb91f3d5e
github.com/operator-framework/operator-lib v0.5.0
github.com/operator-framework/operator-registry v1.17.4
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/sergi/go-diff v1.1.0
github.com/sirupsen/logrus v1.7.0
github.com/spf13/afero v1.2.2
github.com/spf13/cobra v1.1.1
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.6.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/sys v0.0.0-20210521090106-6ca3eb03dfc2 // indirect
golang.org/x/tools v0.1.1
golang.org/x/tools v0.1.3
gomodules.xyz/jsonpatch/v3 v3.0.1
helm.sh/helm/v3 v3.4.1
k8s.io/api v0.20.2
k8s.io/apiextensions-apiserver v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/cli-runtime v0.20.2
k8s.io/client-go v0.20.2
k8s.io/kubectl v0.20.2
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/controller-runtime v0.8.3
sigs.k8s.io/controller-tools v0.5.0
sigs.k8s.io/kubebuilder/v3 v3.0.0-beta.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/cli-runtime v0.21.0
k8s.io/client-go v0.21.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/kubebuilder/v3 v3.0.0-alpha.0.0.20210707171043-359e8aa70c2b
sigs.k8s.io/yaml v1.2.0
)

@@ -51,9 +49,10 @@ replace (
// from an init function in containerd. This replace can be removed when
// one of our direct dependencies begins using containerd v1.4.0+
github.com/containerd/containerd => github.com/containerd/containerd v1.4.3
// latest tag resolves to a very old version. this is only used for spinning up local test registries
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 => sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210518234629-191170994550
)

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