diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c9d35114..aa1a6ab7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,10 +18,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: "1.20" id: go - name: Set up Go for root run: | diff --git a/Dockerfile b/Dockerfile index a30e213c..6c7c6ff5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ ARG DOCKER_REGISTRY -ARG ALPINE_VERSION=3.15 -FROM ${DOCKER_REGISTRY:+$DOCKER_REGISTRY/}golang:1.18-alpine${ALPINE_VERSION} as go-builder +ARG DISTROLESS_DOCKER_REGISTRY +ARG ALPINE_VERSION=3.18 +FROM ${DOCKER_REGISTRY:+$DOCKER_REGISTRY/}golang:1.20-alpine${ALPINE_VERSION} as go-builder ARG PROJECT_NAME=zookeeper-operator ARG REPO_PATH=github.com/pravega/$PROJECT_NAME @@ -28,14 +29,10 @@ COPY controllers/ controllers/ RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /src/${PROJECT_NAME} \ -ldflags "-X ${REPO_PATH}/pkg/version.Version=${VERSION} -X ${REPO_PATH}/pkg/version.GitSHA=${GIT_SHA}" main.go -FROM ${DOCKER_REGISTRY:+$DOCKER_REGISTRY/}alpine:${ALPINE_VERSION} AS final - +FROM ${DISTROLESS_DOCKER_REGISTRY:-gcr.io/}distroless/static-debian11:nonroot AS final ARG PROJECT_NAME=zookeeper-operator COPY --from=go-builder /src/${PROJECT_NAME} /usr/local/bin/${PROJECT_NAME} -RUN adduser -D ${PROJECT_NAME} -USER ${PROJECT_NAME} - ENTRYPOINT ["/usr/local/bin/zookeeper-operator"] diff --git a/Makefile b/Makefile index b1d37124..0017afbb 100644 --- a/Makefile +++ b/Makefile @@ -130,10 +130,11 @@ build-go: -o bin/$(EXPORTER_NAME)-windows-amd64.exe cmd/exporter/main.go build-image: - docker build --build-arg VERSION=$(VERSION) --build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) --build-arg GIT_SHA=$(GIT_SHA) -t $(REPO):$(VERSION) . + docker build --build-arg VERSION=$(VERSION) --build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) --build-arg DISTROLESS_DOCKER_REGISTRY=$(DISTROLESS_DOCKER_REGISTRY) --build-arg GIT_SHA=$(GIT_SHA) -t $(REPO):$(VERSION) . docker tag $(REPO):$(VERSION) $(REPO):latest build-zk-image: + docker build --build-arg VERSION=$(VERSION) --build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) --build-arg GIT_SHA=$(GIT_SHA) -t $(APP_REPO):$(VERSION) ./docker docker tag $(APP_REPO):$(VERSION) $(APP_REPO):latest diff --git a/api/v1beta1/zookeepercluster_types.go b/api/v1beta1/zookeepercluster_types.go index a1269b86..f64474b4 100644 --- a/api/v1beta1/zookeepercluster_types.go +++ b/api/v1beta1/zookeepercluster_types.go @@ -26,7 +26,7 @@ const ( // DefaultZkContainerVersion is the default tag used for for the zookeeper // container - DefaultZkContainerVersion = "0.2.14" + DefaultZkContainerVersion = "0.2.15" // DefaultZkContainerPolicy is the default container pull policy used DefaultZkContainerPolicy = "Always" diff --git a/api/v1beta1/zookeepercluster_types_test.go b/api/v1beta1/zookeepercluster_types_test.go index c098cbd6..c8d59fb0 100644 --- a/api/v1beta1/zookeepercluster_types_test.go +++ b/api/v1beta1/zookeepercluster_types_test.go @@ -79,7 +79,7 @@ var _ = Describe("ZookeeperCluster Types", func() { }) It("Checking tostring() function", func() { - Ω(z.Spec.Image.ToString()).To(Equal("pravega/zookeeper:0.2.14")) + Ω(z.Spec.Image.ToString()).To(Equal("pravega/zookeeper:0.2.15")) }) }) diff --git a/charts/zookeeper-operator/Chart.yaml b/charts/zookeeper-operator/Chart.yaml index 9fafe472..5ed41166 100644 --- a/charts/zookeeper-operator/Chart.yaml +++ b/charts/zookeeper-operator/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: zookeeper-operator description: Zookeeper Operator Helm chart for Kubernetes -version: 0.2.14 -appVersion: 0.2.14 +version: 0.2.15 +appVersion: 0.2.15 keywords: - zookeeper - storage diff --git a/charts/zookeeper-operator/README.md b/charts/zookeeper-operator/README.md index 3175a2ce..4497ecf2 100644 --- a/charts/zookeeper-operator/README.md +++ b/charts/zookeeper-operator/README.md @@ -55,7 +55,7 @@ The following table lists the configurable parameters of the zookeeper-operator | `hooks.image.tag` | Image tag for batch jobs | `"v1.16.10"` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `image.repository` | Image repository | `pravega/zookeeper-operator` | -| `image.tag` | Image tag | `0.2.14` | +| `image.tag` | Image tag | `0.2.15` | | `labels` | Operator pod labels | `{}` | | `nodeSelector` | Map of key-value pairs to be present as labels in the node in which the pod should run | `{}` | | `rbac.create` | Create RBAC resources | `true` | diff --git a/charts/zookeeper-operator/values.yaml b/charts/zookeeper-operator/values.yaml index eeef7645..afc8397e 100644 --- a/charts/zookeeper-operator/values.yaml +++ b/charts/zookeeper-operator/values.yaml @@ -9,7 +9,7 @@ global: image: repository: pravega/zookeeper-operator - tag: 0.2.14 + tag: 0.2.15 pullPolicy: IfNotPresent securityContext: {} diff --git a/charts/zookeeper/Chart.yaml b/charts/zookeeper/Chart.yaml index 3ba08e5a..594d7de3 100644 --- a/charts/zookeeper/Chart.yaml +++ b/charts/zookeeper/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: zookeeper description: Zookeeper Helm chart for Kubernetes -version: 0.2.14 -appVersion: 0.2.14 +version: 0.2.15 +appVersion: 0.2.15 keywords: - zookeeper - storage diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index 8d0417bd..95027a3a 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -57,7 +57,7 @@ The following table lists the configurable parameters of the zookeeper chart and | `maxUnavailableReplicas` | Max unavailable replicas in pdb | `1` | | `triggerRollingRestart` | If true, the zookeeper cluster is restarted. After the restart is triggered, this value is auto-reverted to false. | `false` | | `image.repository` | Image repository | `pravega/zookeeper` | -| `image.tag` | Image tag | `0.2.14` | +| `image.tag` | Image tag | `0.2.15` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `domainName` | External host name appended for dns annotation | | | `kubernetesClusterDomain` | Domain of the kubernetes cluster | `cluster.local` | diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index d7977ec7..8a449f0b 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -3,7 +3,7 @@ maxUnavailableReplicas: image: repository: pravega/zookeeper - tag: 0.2.14 + tag: 0.2.15 pullPolicy: IfNotPresent triggerRollingRestart: false diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 718a8b49..18163b4c 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -16,7 +16,7 @@ spec: containers: - name: zookeeper-operator # Replace this with the built image name - image: pravega/zookeeper-operator:0.2.14 + image: pravega/zookeeper-operator:0.2.15 ports: - containerPort: 60000 name: metrics diff --git a/config/samples/ECS/zookeeper_v1beta1_zookeepercluster_cr.yaml b/config/samples/ECS/zookeeper_v1beta1_zookeepercluster_cr.yaml index 26faab41..8130f753 100644 --- a/config/samples/ECS/zookeeper_v1beta1_zookeepercluster_cr.yaml +++ b/config/samples/ECS/zookeeper_v1beta1_zookeepercluster_cr.yaml @@ -6,7 +6,7 @@ spec: replicas: 3 image: repository: pravega/zookeeper - tag: 0.2.14 + tag: 0.2.15 storageType: persistence persistence: reclaimPolicy: Retain diff --git a/config/samples/pravega/zookeeper_v1beta1_zookeepercluster_cr.yaml b/config/samples/pravega/zookeeper_v1beta1_zookeepercluster_cr.yaml index b28a34fd..d3520411 100644 --- a/config/samples/pravega/zookeeper_v1beta1_zookeepercluster_cr.yaml +++ b/config/samples/pravega/zookeeper_v1beta1_zookeepercluster_cr.yaml @@ -6,7 +6,7 @@ spec: replicas: 3 image: repository: pravega/zookeeper - tag: 0.2.14 + tag: 0.2.15 storageType: persistence persistence: reclaimPolicy: Delete diff --git a/controllers/zookeepercluster_controller.go b/controllers/zookeepercluster_controller.go index 45e82b32..6ef4d50f 100644 --- a/controllers/zookeepercluster_controller.go +++ b/controllers/zookeepercluster_controller.go @@ -125,9 +125,9 @@ func getRollingRestartAnnotation() (string, string) { // compareResourceVersion compare resoure versions for the supplied ZookeeperCluster and StatefulSet // resources // Returns: -// 0 if versions are equal +// 0 if versions are equal // -1 if ZookeeperCluster version is less than StatefulSet version -// 1 if ZookeeperCluster version is greater than StatefulSet version +// 1 if ZookeeperCluster version is greater than StatefulSet version func compareResourceVersion(zk *zookeeperv1beta1.ZookeeperCluster, sts *appsv1.StatefulSet) int { zkResourceVersion, zkErr := strconv.Atoi(zk.ResourceVersion) diff --git a/go.mod b/go.mod index 1f60fd17..59e7a880 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/pravega/zookeeper-operator -go 1.18 +go 1.20 require ( github.com/ghodss/yaml v1.0.0 @@ -22,7 +22,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful v2.15.0+incompatible // indirect + github.com/emicklei/go-restful v2.16.0+incompatible // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-logr/zapr v1.2.3 // indirect @@ -53,11 +53,11 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect - golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 2388f754..32e51597 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.15.0+incompatible h1:8KpYO/Xl/ZudZs5RNOEhWMBY4hmzlZhhRd9cu+jrZP4= -github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.16.0+incompatible h1:rgqiKNjTnFQA6kkhFe16D8epTksy9HQ1MyrbDXSdYhM= +github.com/emicklei/go-restful v2.16.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -657,8 +657,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220526153639-5463443f8c37 h1:lUkvobShwKsOesNfWWlCS5q7fnbG1MEliIzwu886fn8= -golang.org/x/net v0.0.0-20220526153639-5463443f8c37/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -768,12 +768,12 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -782,8 +782,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=