Skip to content

Commit

Permalink
Bump k8s dependencies to 1.21+ (operator-framework#5057)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
varshaprasad96 authored Jul 15, 2021
1 parent 35313e8 commit fb2a657
Show file tree
Hide file tree
Showing 28 changed files with 606 additions and 455 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
export K8S_VERSION = 1.20.2

# Build settings
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down
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
Expand Up @@ -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
)

Expand All @@ -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

0 comments on commit fb2a657

Please sign in to comment.