Skip to content

Commit

Permalink
up: update golang to 1.17.1, base image and kustomize (#88)
Browse files Browse the repository at this point in the history
Co-authored-by: Eriks Zelenka <[email protected]>
  • Loading branch information
ezelenka and isindir authored Oct 6, 2021
1 parent 36ec7bc commit 7efb496
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 71 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
image: ubuntu-2004:202010-01
environment:
# https://golang.org/dl/
GOLANG_VERSION: "1.17"
GOLANG_VERSION: "1.17.1"
# https://github.com/kubernetes-sigs/kubebuilder/releases
KUBEBUILDER_VERSION: 3.1.0
# https://github.com/kubernetes-sigs/kustomize/releases
KUSTOMIZE_VERSION: v4.2.0
KUSTOMIZE_VERSION: v4.4.0
# https://github.com/github/hub/releases
HUB_VERSION: 2.14.2
# https://github.com/git-chglog/git-chglog/releases
Expand Down Expand Up @@ -105,13 +105,13 @@ jobs:
# https://github.com/helm/helm/releases
HELM_VERSION: v3.6.3
# https://golang.org/dl/
GOLANG_VERSION: "1.17"
GOLANG_VERSION: "1.17.1"
# https://github.com/kubernetes-sigs/kubebuilder/releases
KUBEBUILDER_VERSION: 3.1.0
# https://github.com/mozilla/sops/releases
SOPS_VERSION: v3.7.1
# https://github.com/kubernetes-sigs/kustomize/releases
KUSTOMIZE_VERSION: v4.2.0
KUSTOMIZE_VERSION: v4.4.0
# https://github.com/quintush/helm-unittest/releases
HELM_UNITTEST_VERSION: 0.2.7
# https://github.com/instrumenta/kubeval/releases
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/norwoodj/helm-docs
rev: v1.5.0
rev: v1.6.0
hooks:
- id: helm-docs
args:
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# https://github.com/kubernetes-sigs/kubebuilder/releases
kubebuilder 3.1.0
# https://golang.org/dl/
golang 1.17
golang 1.17.1
# https://github.com/mozilla/sops/releases
sops 3.7.1
# https://github.com/kubernetes-sigs/kustomize/releases
kustomize 4.2.0
kustomize 4.4.0
# https://github.com/rancher/k3d/releases
k3d 4.4.7
# https://github.com/kubernetes/kubernetes/releases
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build the manager binary
# https://www.debian.org/releases/
# https://hub.docker.com/_/golang?tab=tags&page=1&ordering=last_updated
FROM golang:1.17-buster as builder
FROM golang:1.17.1-bullseye as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -18,8 +19,9 @@ COPY controllers/ controllers/
# Build (GOARCH=amd64)
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -o manager main.go

# https://wiki.ubuntu.com/Releases
# https://hub.docker.com/_/ubuntu?tab=tags&page=1&ordering=last_updated
FROM ubuntu:focal-20210827
FROM ubuntu:focal-20210921

RUN apt-get -y update \
&& apt-get -y upgrade \
Expand Down
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GO := GOPROXY=https://proxy.golang.org go
SOPS_SEC_OPERATOR_VERSION := 0.3.4
SOPS_SEC_OPERATOR_VERSION := 0.3.5

# https://github.com/kubernetes-sigs/controller-tools/releases
CONTROLLER_GEN_VERSION := "v0.6.2"
# https://github.com/kubernetes-sigs/controller-runtime/releases
CONTROLLER_RUNTIME_VERSION := "v0.9.6"
# https://github.com/kubernetes-sigs/kustomize/releases
KUSTOMIZE_VERSION := "v4.2.0"
KUSTOMIZE_VERSION := "v4.4.0"
# use `setup-envtest list` to obtain the list of available versions
# until fixed, can't use newer version, see:
# https://github.com/kubernetes-sigs/controller-runtime/issues/1571
Expand Down Expand Up @@ -177,19 +177,33 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION})
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION})

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@${KUSTOMIZE_VERSION})

SETUP_ENVTEST = $(shell pwd)/bin/setup-envtest
setup-envtest: ## Download setup-envtest locally if necessary.
$(call go-get-tool,$(SETUP_ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
$(call go-install-tool,$(SETUP_ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)

GINKGO = $(shell pwd)/ginkgo
setup-ginkgo: ## Download ginkgo locally
$(call go-get-tool,$(GINKGO),github.com/onsi/ginkgo/ginkgo)
$(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/ginkgo)

# go-install-tool will 'go install' any package $2 and install it to $1
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-install-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin $(GO) install $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef

# go-get-tool will 'go get' any package $2 and install it to $1
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand Down
4 changes: 2 additions & 2 deletions chart/helm3/sops-secrets-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
version: 0.9.4
appVersion: 0.3.4
version: 0.9.5
appVersion: 0.3.5
type: application
description: Helm chart deploys sops-secrets-operator
name: sops-secrets-operator
Expand Down
2 changes: 1 addition & 1 deletion chart/helm3/sops-secrets-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The following table lists the configurable parameters of the Sops-secrets-operat
| healthProbes.readiness | object | `{"initialDelaySeconds":5,"periodSeconds":10}` | Readiness probe configuration |
| image.pullPolicy | string | `"Always"` | Operator image pull policy |
| image.repository | string | `"isindir/sops-secrets-operator"` | Operator image name |
| image.tag | string | `"0.3.4"` | Operator image tag |
| image.tag | string | `"0.3.5"` | Operator image tag |
| imagePullSecrets | list | `[]` | Secrets to pull image from private docker repository |
| kubeconfig | object | `{"enabled":false,"path":null}` | Paths to a kubeconfig. Only required if out-of-cluster. |
| logging | object | `{"encoder":"json","level":"info","stacktraceLevel":"error"}` | Logging configuration section suggested values Development Mode (encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode (encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default) |
Expand Down
6 changes: 3 additions & 3 deletions chart/helm3/sops-secrets-operator/tests/operator_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ tests:
app.kubernetes.io/instance: sops
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: sops-secrets-operator
app.kubernetes.io/version: 0.3.4
helm.sh/chart: sops-secrets-operator-0.9.4
app.kubernetes.io/version: 0.3.5
helm.sh/chart: sops-secrets-operator-0.9.5

# template metadata and spec selector
- it: should correctly render template metadata and spec selector
Expand Down Expand Up @@ -140,7 +140,7 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: isindir/sops-secrets-operator:0.3.4
value: isindir/sops-secrets-operator:0.3.5
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: Always
Expand Down
2 changes: 1 addition & 1 deletion chart/helm3/sops-secrets-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image:
# -- Operator image name
repository: isindir/sops-secrets-operator
# -- Operator image tag
tag: 0.3.4
tag: 0.3.5
# -- Operator image pull policy
pullPolicy: Always

Expand Down
Loading

0 comments on commit 7efb496

Please sign in to comment.