Skip to content

Commit

Permalink
Upgrade operator-sdk to 0.19
Browse files Browse the repository at this point in the history
Upgraded operator-sdk: 0.17 -> 0.19

As part of this upgrade the following dependencies were also upgraded:
- Go 1.13 -> 1.16
- sigs.k8s.io/controller-runtime v0.5.2 -> v0.6.5
- k8s v0.17.5 -> v0.19.13
  • Loading branch information
amuraru committed Jul 16, 2021
1 parent 56cb7d0 commit d07e2c2
Show file tree
Hide file tree
Showing 24 changed files with 6,267 additions and 5,258 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13.8
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.13.8
go-version: 1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -30,7 +30,7 @@ jobs:
uses: codecov/[email protected]
- name: Set env
run: |
echo "KUBERNETES_VERSION=v1.21.2" >> $GITHUB_ENV
echo "KUBERNETES_VERSION=v1.19.13" >> $GITHUB_ENV
echo "OPERATOR_SDK_VERSION=v0.19.4" >> $GITHUB_ENV
echo "MINIKUBE_VERSION=v1.22.0" >> $GITHUB_ENV
echo "KUBERNETES_CONFIG_FILE=$HOME/.kube/config" >> $GITHUB_ENV
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SHELL=/bin/bash -o pipefail
PROJECT_NAME=zookeeper-operator
EXPORTER_NAME=zookeeper-exporter
APP_NAME=zookeeper
KUBE_VERSION=1.17.5
KUBE_VERSION=1.19.13
REPO=pravega/$(PROJECT_NAME)
TEST_REPO=testzkop/$(PROJECT_NAME)
APP_REPO=pravega/$(APP_NAME)
Expand All @@ -31,6 +31,12 @@ generate:
[[ ${OSDK_VERSION} == v0.19* ]] || ( echo "operator-sdk version 0.19 required" ; exit 1 )
operator-sdk generate crds --crd-version v1
env GOROOT=$(shell go env GOROOT) operator-sdk generate k8s
# sync crd generated to helm-chart
echo '{{- define "crd.openAPIV3Schema" }}' > charts/zookeeper-operator/templates/_crd_openapiv3schema.tpl
echo 'openAPIV3Schema:' >> charts/zookeeper-operator/templates/_crd_openapiv3schema.tpl
sed -e '1,/openAPIV3Schema/d' deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml | sed -n '/served: true/!p;//q' >> charts/zookeeper-operator/templates/_crd_openapiv3schema.tpl
echo '{{- end }}' >> charts/zookeeper-operator/templates/_crd_openapiv3schema.tpl


build: test build-go build-image

Expand Down Expand Up @@ -83,7 +89,7 @@ test-e2e-local:
operator-sdk test local ./test/e2e --operator-namespace default --up-local --go-test-flags "-v -timeout 0"

run-local:
operator-sdk up local
operator-sdk run local

login:
@docker login -u "$(DOCKER_USER)" -p "$(DOCKER_PASS)"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ The list of available commands are
### Build the operator image

Requirements:
- Go 1.13+
- Go 1.16+

Use the `make` command to build the Zookeeper operator image.

Expand Down
5,167 changes: 5,167 additions & 0 deletions charts/zookeeper-operator/templates/_crd_openapiv3schema.tpl

Large diffs are not rendered by default.

4,858 changes: 0 additions & 4,858 deletions charts/zookeeper-operator/templates/_helpers.tpl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/pravega/zookeeper-operator/pkg/yamlexporter"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
logf "sigs.k8s.io/controller-runtime/pkg/log"
)

var (
Expand Down
8 changes: 5 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"runtime"
"strings"

"sigs.k8s.io/controller-runtime/pkg/manager/signals"

"github.com/operator-framework/operator-sdk/pkg/k8sutil"
"github.com/operator-framework/operator-sdk/pkg/leader"
sdkVersion "github.com/operator-framework/operator-sdk/version"
Expand All @@ -28,9 +30,9 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client/config"
logf "sigs.k8s.io/controller-runtime/pkg/log"
logz "sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
)

var (
Expand All @@ -57,7 +59,7 @@ func main() {
// implementing the logr.Logger interface. This logger will
// be propagated through the whole operator, generating
// uniform and structured logs.
logf.SetLogger(logf.ZapLogger(false))
logf.SetLogger(logz.New(logz.UseDevMode(false)))

printVersion()

Expand Down
504 changes: 402 additions & 102 deletions deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml

Large diffs are not rendered by default.

117 changes: 68 additions & 49 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,84 +1,103 @@
module github.com/pravega/zookeeper-operator

go 1.13
go 1.16

require (
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect
dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363 // indirect
github.com/alecthomas/gocyclo v0.0.0-20150208221726-aa8f8b160214 // indirect
github.com/alexkohler/nakedret v1.0.0 // indirect
github.com/Azure/go-autorest/autorest v0.11.19 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.14 // indirect
github.com/Microsoft/go-winio v0.4.15 // indirect
github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990 // indirect
github.com/containerd/containerd v1.4.4 // indirect
github.com/containerd/ttrpc v1.0.2 // indirect
github.com/docker/docker v20.10.2+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-logr/logr v0.1.0
github.com/gordonklaus/ineffassign v0.0.0-20201107091007-3b93a8888063 // indirect
github.com/mdempsky/maligned v0.0.0-20180708014732-6e39bd26a8c8 // indirect
github.com/mdempsky/unconvert v0.0.0-20200228143138-95ecdbfc0b5f // indirect
github.com/mibk/dupl v1.0.0 // indirect
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/operator-framework/operator-sdk v0.17.0
github.com/go-logr/logr v0.4.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/uuid v1.1.5 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
github.com/operator-framework/api v0.3.25 // indirect
github.com/operator-framework/operator-registry v1.13.9 // indirect
github.com/operator-framework/operator-sdk v0.19.4
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/common v0.9.1
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989 // indirect
github.com/sirupsen/logrus v1.5.0
github.com/stripe/safesql v0.2.0 // indirect
k8s.io/api v0.17.5
k8s.io/apimachinery v0.17.5
github.com/rogpeppe/go-internal v1.5.2 // indirect
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
github.com/sirupsen/logrus v1.7.1
github.com/spf13/cobra v1.1.3 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/net v0.0.0-20210716203947-853a461950ff // indirect
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
golang.org/x/tools v0.1.5 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.19.13
k8s.io/apiextensions-apiserver v0.19.13 // indirect
k8s.io/apimachinery v0.19.13
k8s.io/client-go v12.0.0+incompatible
k8s.io/code-generator v0.19.3 // indirect
sigs.k8s.io/controller-runtime v0.5.2
k8s.io/kube-openapi v0.0.0-20210527164424-3c818078ee3d // indirect
k8s.io/utils v0.0.0-20210709001253-0e1f9d693477 // indirect
sigs.k8s.io/controller-runtime v0.6.5
)

replace (
github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible // Required by OLM
github.com/go-logr/zapr => github.com/go-logr/zapr v0.4.0

github.com/docker/docker => github.com/moby/moby v0.7.3-0.20190826074503-38ab9da00309 // Required by Helm
k8s.io/api => k8s.io/api v0.19.13

k8s.io/api => k8s.io/api v0.17.5
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.13

k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.17.5
k8s.io/apimachinery => k8s.io/apimachinery v0.19.14-rc.0

k8s.io/apimachinery => k8s.io/apimachinery v0.17.6-beta.0
k8s.io/apiserver => k8s.io/apiserver v0.19.13

k8s.io/apiserver => k8s.io/apiserver v0.17.5
k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.13

k8s.io/cli-runtime => k8s.io/cli-runtime v0.17.5
k8s.io/client-go => k8s.io/client-go v0.19.13

k8s.io/client-go => k8s.io/client-go v0.17.5
k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.13

k8s.io/cloud-provider => k8s.io/cloud-provider v0.17.5
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.13

k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.17.5
k8s.io/code-generator => k8s.io/code-generator v0.19.14-rc.0

k8s.io/code-generator => k8s.io/code-generator v0.17.6-beta.0
k8s.io/component-base => k8s.io/component-base v0.19.13

k8s.io/component-base => k8s.io/component-base v0.17.5
k8s.io/controller-manager => k8s.io/controller-manager v0.19.14-rc.0

k8s.io/cri-api => k8s.io/cri-api v0.17.7-rc.0
k8s.io/cri-api => k8s.io/cri-api v0.19.14-rc.0

k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.17.5
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.19.13

k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.17.5
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.19.13

k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.17.5
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.19.13

k8s.io/kube-proxy => k8s.io/kube-proxy v0.17.5
k8s.io/kube-proxy => k8s.io/kube-proxy v0.19.13

k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.17.5
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.19.13

k8s.io/kubectl => k8s.io/kubectl v0.17.5
k8s.io/kubectl => k8s.io/kubectl v0.19.13

k8s.io/kubelet => k8s.io/kubelet v0.17.5
k8s.io/kubelet => k8s.io/kubelet v0.19.13

k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.17.5
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.19.13

k8s.io/metrics => k8s.io/metrics v0.17.5
k8s.io/metrics => k8s.io/metrics v0.19.13

k8s.io/node-api => k8s.io/node-api v0.17.5
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.13

k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.17.5
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.19.13

k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.17.5

k8s.io/sample-controller => k8s.io/sample-controller v0.17.5
k8s.io/sample-controller => k8s.io/sample-controller v0.19.13
)
Loading

0 comments on commit d07e2c2

Please sign in to comment.