From f549f7d9c24ab753430ae497cb13c975cab15026 Mon Sep 17 00:00:00 2001 From: Thomas Berreis Date: Wed, 2 Aug 2023 10:16:16 +0200 Subject: [PATCH] feat: allow changing the default revisionHistoryLimit Signed-off-by: Thomas Berreis --- cmd/build/helmify/kustomize-for-helm.yaml | 2 ++ cmd/build/helmify/replacements.go | 2 ++ cmd/build/helmify/static/values.yaml | 1 + .../gatekeeper/templates/gatekeeper-audit-deployment.yaml | 1 + .../templates/gatekeeper-controller-manager-deployment.yaml | 1 + manifest_staging/charts/gatekeeper/values.yaml | 1 + 6 files changed, 8 insertions(+) diff --git a/cmd/build/helmify/kustomize-for-helm.yaml b/cmd/build/helmify/kustomize-for-helm.yaml index 5ba1c87cdda..a2003cd3fdc 100644 --- a/cmd/build/helmify/kustomize-for-helm.yaml +++ b/cmd/build/helmify/kustomize-for-helm.yaml @@ -62,6 +62,7 @@ metadata: namespace: gatekeeper-system spec: replicas: HELMSUBST_DEPLOYMENT_REPLICAS + revisionHistoryLimit: HELMSUBST_DEPLOYMENT_REVISION_HISTORY_LIMIT strategy: type: HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_STRATEGY_TYPE template: @@ -147,6 +148,7 @@ metadata: name: gatekeeper-audit namespace: gatekeeper-system spec: + revisionHistoryLimit: HELMSUBST_DEPLOYMENT_REVISION_HISTORY_LIMIT template: metadata: annotations: diff --git a/cmd/build/helmify/replacements.go b/cmd/build/helmify/replacements.go index 5b543c4fe74..b849fb7352c 100644 --- a/cmd/build/helmify/replacements.go +++ b/cmd/build/helmify/replacements.go @@ -73,6 +73,8 @@ var replacements = map[string]string{ "HELMSUBST_DEPLOYMENT_REPLICAS": `{{ .Values.replicas }}`, + "HELMSUBST_DEPLOYMENT_REVISION_HISTORY_LIMIT": `{{ .Values.revisionHistoryLimit }}`, + `HELMSUBST_ANNOTATIONS: ""`: `{{- if .Values.podAnnotations }} {{- toYaml .Values.podAnnotations | trim | nindent 8 }} {{- end }}`, diff --git a/cmd/build/helmify/static/values.yaml b/cmd/build/helmify/static/values.yaml index 9aa9276d276..2cef41d65af 100644 --- a/cmd/build/helmify/static/values.yaml +++ b/cmd/build/helmify/static/values.yaml @@ -1,4 +1,5 @@ replicas: 3 +revisionHistoryLimit: 10 auditInterval: 60 metricsBackends: ["prometheus"] auditMatchKindOnly: false diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml index 9b66fae2492..dd7927a1c19 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml @@ -13,6 +13,7 @@ metadata: namespace: '{{ .Release.Namespace }}' spec: replicas: 1 + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: matchLabels: app: '{{ template "gatekeeper.name" . }}' diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml index 60dfe7884c5..6a202ae72b1 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml @@ -13,6 +13,7 @@ metadata: namespace: '{{ .Release.Namespace }}' spec: replicas: {{ .Values.replicas }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: matchLabels: app: '{{ template "gatekeeper.name" . }}' diff --git a/manifest_staging/charts/gatekeeper/values.yaml b/manifest_staging/charts/gatekeeper/values.yaml index 9aa9276d276..2cef41d65af 100644 --- a/manifest_staging/charts/gatekeeper/values.yaml +++ b/manifest_staging/charts/gatekeeper/values.yaml @@ -1,4 +1,5 @@ replicas: 3 +revisionHistoryLimit: 10 auditInterval: 60 metricsBackends: ["prometheus"] auditMatchKindOnly: false