Skip to content

Commit

Permalink
fix: set sops status to healthy only if not healthy already (#147)
Browse files Browse the repository at this point in the history
* fix: set sops status to healthy only if not healthy already

* Fix typo

* Fix typo
  • Loading branch information
isindir authored Sep 2, 2023
1 parent 1068159 commit 64b9ddf
Show file tree
Hide file tree
Showing 20 changed files with 324 additions and 635 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
image: ubuntu-2204:2023.07.2
environment: &versions
# https://github.com/kubernetes/kubernetes/releases
KUBECTL_VERSION: v1.27.4
KUBECTL_VERSION: v1.27.5
# https://hub.docker.com/r/rancher/k3s/tags
K3S_VERSION: v1.27.4-k3s1
# https://github.com/rancher/k3d/releases
K3D_VERSION: v5.5.2
# https://github.com/helm/helm/releases
HELM_VERSION: v3.12.2
HELM_VERSION: v3.12.3
# https://golang.org/dl/
GOLANG_VERSION: "1.21.0"
# https://github.com/kubernetes-sigs/kubebuilder/releases
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ kustomize 5.0.3
# https://github.com/rancher/k3d/releases
k3d 5.5.2
# https://github.com/kubernetes/kubernetes/releases
kubectl 1.27.4
kubectl 1.27.5
# https://github.com/helm/helm/releases
helm 3.12.2
helm 3.12.3
# https://github.com/norwoodj/helm-docs/releases
helm-docs 1.11.0
# https://github.com/instrumenta/kubeval/releases
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ COPY internal/ internal/
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -o manager cmd/main.go

# https://wiki.ubuntu.com/Releases
# https://hub.docker.com/_/ubuntu/tags?page=1&name=jammy
FROM ubuntu:lunar-20230731
# https://hub.docker.com/_/ubuntu/tags?page=1&name=lunar
FROM ubuntu:lunar-20230816

RUN apt-get -y update \
&& apt-get -y upgrade \
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# UPDATE_HERE
GO := GOPROXY=https://proxy.golang.org go
SOPS_SEC_OPERATOR_VERSION := 0.9.4
SOPS_SEC_OPERATOR_VERSION := 0.9.5

# https://github.com/kubernetes-sigs/controller-tools/releases
CONTROLLER_GEN_VERSION := "v0.12.1"
CONTROLLER_GEN_VERSION := "v0.13.0"
# https://github.com/kubernetes-sigs/controller-runtime/releases
CONTROLLER_RUNTIME_VERSION := "v0.15.1"
CONTROLLER_RUNTIME_VERSION := "v0.16.0"
# https://github.com/kubernetes-sigs/kustomize/releases
KUSTOMIZE_VERSION := "v5.1.1"
# use `setup-envtest list` to obtain the list of available versions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ encrypted files stored in `git` repository.

| Kubernetes | Sops | Chart | Operator |
|---|---|---|---|
| v1.27.x | v3.7.3 | 0.15.4 | 0.9.4 |
| v1.27.x | v3.7.3 | 0.15.5 | 0.9.5 |
| v1.26.x | v3.7.3 | 0.14.2 | 0.8.2 |
| v1.25.x | v3.7.3 | 0.12.5 | 0.6.4 |
| v1.24.x | v3.7.3 | 0.11.3 | 0.5.3 |
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions chart/helm3/sops-secrets-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
# UPDATE_HERE
version: 0.15.4
appVersion: 0.9.4
version: 0.15.5
appVersion: 0.9.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/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHART_NAME?=$(shell cat Chart.yaml | awk 'BEGIN { FS=": " } $$0~/^name:/ { gsub(
VERSION_TAG?=$(shell cat Chart.yaml | awk 'BEGIN { FS=": " } $$0~/^version/ { gsub(/['\'',]/, ""); print $$2; }')

# UPDATE_HERE
K8S_VERSION := "1.27.4"
K8S_VERSION := "1.27.5"

SHELL=/bin/bash

Expand Down
4 changes: 2 additions & 2 deletions chart/helm3/sops-secrets-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ 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.9.4"` | Operator image tag |
| image.tag | string | `"0.9.5"` | Operator image tag |
| imagePullSecrets | list | `[]` | Secrets to pull image from private docker repository |
| initImage.pullPolicy | string | `"Always"` | Init container image pull policy |
| initImage.repository | string | `"ubuntu"` | Init container image name |
| initImage.tag | string | `"lunar-20230731"` | Init container image tag |
| initImage.tag | string | `"lunar-20230816"` | Init container image tag |
| kubeconfig | object | `{"enabled":false,"path":null}` | Paths to a kubeconfig. Only required if out-of-cluster. |
| logging | object | `{"development":false,"encoder":"json","level":"info","stacktraceLevel":"error","timeEncoding":"iso8601"}` | Logging configuration section suggested values Development Mode (encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode (encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default) |
| logging.development | bool | `false` | Zap Development Mode enabled |
Expand Down
8 changes: 4 additions & 4 deletions chart/helm3/sops-secrets-operator/tests/operator_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,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.9.4
helm.sh/chart: sops-secrets-operator-0.15.4
app.kubernetes.io/version: 0.9.5
helm.sh/chart: sops-secrets-operator-0.15.5

# custom name
- it: should correctly render custome name
Expand Down Expand Up @@ -170,7 +170,7 @@ tests:
# UPDATE_HERE
- equal:
path: spec.template.spec.containers[0].image
value: isindir/sops-secrets-operator:0.9.4
value: isindir/sops-secrets-operator:0.9.5
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: Always
Expand Down Expand Up @@ -198,7 +198,7 @@ tests:
- equal:
path: spec.template.spec.initContainers[0].image
# UPDATE_HERE
value: ubuntu:lunar-20230731
value: ubuntu:lunar-20230816
- equal:
path: spec.template.spec.initContainers[0].imagePullPolicy
value: Always
Expand Down
4 changes: 2 additions & 2 deletions chart/helm3/sops-secrets-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ image:
# -- Operator image name
repository: isindir/sops-secrets-operator
# -- Operator image tag
tag: 0.9.4
tag: 0.9.5
# -- Operator image pull policy
pullPolicy: Always

Expand All @@ -22,7 +22,7 @@ initImage:
# -- Init container image name
repository: ubuntu
# -- Init container image tag
tag: lunar-20230731
tag: lunar-20230816
# -- Init container image pull policy
pullPolicy: Always

Expand Down
9 changes: 6 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"flag"
"fmt"
"os"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand Down Expand Up @@ -65,9 +66,11 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Scheme: scheme,
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
},
//Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "ca57d051.github.com",
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/isindir.github.com_sopssecrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
controller-gen.kubebuilder.io/version: v0.13.0
name: sopssecrets.isindir.github.com
spec:
group: isindir.github.com
Expand Down
Loading

0 comments on commit 64b9ddf

Please sign in to comment.