From be69782978f5d2f226a6bec5d2de9a768a258527 Mon Sep 17 00:00:00 2001 From: Brady Todhunter Date: Fri, 16 Feb 2024 13:29:22 -0800 Subject: [PATCH] Fix ecs-inventory & k8s-inventory existing secrets (#349) * dont fail deployment if using existing secrets (#195) * dont fail deployment if using existing secrets * bump chart version --------- * K8s inventory fix existing secrets (#196) * change useExistingSecrets to match values useExistingSecret in values file * bump chart version * fix existing secret reference in ecs-inventory chart --------- Signed-off-by: Brady Todhunter --- stable/ecs-inventory/Chart.yaml | 2 +- stable/ecs-inventory/templates/deployment.yaml | 2 +- stable/k8s-inventory/Chart.yaml | 2 +- stable/k8s-inventory/templates/_helpers.tpl | 4 ++-- stable/k8s-inventory/templates/deployment.yaml | 2 +- stable/k8s-inventory/templates/secrets.yaml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stable/ecs-inventory/Chart.yaml b/stable/ecs-inventory/Chart.yaml index df292f99..04f0197b 100644 --- a/stable/ecs-inventory/Chart.yaml +++ b/stable/ecs-inventory/Chart.yaml @@ -20,7 +20,7 @@ maintainers: email: hung.nguyen@anchore.com type: application -version: 0.0.5 +version: 0.0.6 appVersion: "1.3.0" icon: https://anchore.com/wp-content/uploads/2016/08/anchore.png diff --git a/stable/ecs-inventory/templates/deployment.yaml b/stable/ecs-inventory/templates/deployment.yaml index fc440b04..9365255c 100644 --- a/stable/ecs-inventory/templates/deployment.yaml +++ b/stable/ecs-inventory/templates/deployment.yaml @@ -19,7 +19,7 @@ spec: {{- with .Values.annotations }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if not .Values.useExistingSecrets }} + {{- if not .Values.useExistingSecret }} checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} {{- end }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} diff --git a/stable/k8s-inventory/Chart.yaml b/stable/k8s-inventory/Chart.yaml index d0c1b7a0..ea2a0696 100644 --- a/stable/k8s-inventory/Chart.yaml +++ b/stable/k8s-inventory/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: k8s-inventory -version: 0.2.0 +version: 0.2.2 appVersion: "1.2.0" description: A Helm chart for Kubernetes Automated Inventory, which describes which images are in use in a given Kubernetes Cluster keywords: diff --git a/stable/k8s-inventory/templates/_helpers.tpl b/stable/k8s-inventory/templates/_helpers.tpl index 0b50a7e3..c675921f 100644 --- a/stable/k8s-inventory/templates/_helpers.tpl +++ b/stable/k8s-inventory/templates/_helpers.tpl @@ -72,7 +72,7 @@ Create the name of the service account to use Require Anchore endpoint and Anchore credentials */}} {{- define "checkAnchoreRequisites" }} -{{- if or (not .Values.k8sInventory.anchore.url) (not .Values.k8sInventory.anchore.user) (not .Values.k8sInventory.anchore.password) }} +{{- if or (not .Values.k8sInventory.anchore.url) (not .Values.k8sInventory.anchore.user) (and (not .Values.useExistingSecret) (not .Values.k8sInventory.anchore.password)) }} {{- fail "Anchore endpoint and credentials are required. See the chart README for more instructions on configuring Anchore Requisites." }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/stable/k8s-inventory/templates/deployment.yaml b/stable/k8s-inventory/templates/deployment.yaml index f4ae1823..aaaa895a 100644 --- a/stable/k8s-inventory/templates/deployment.yaml +++ b/stable/k8s-inventory/templates/deployment.yaml @@ -25,7 +25,7 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if not .Values.useExistingSecrets }} + {{- if not .Values.useExistingSecret }} checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} {{- end }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} diff --git a/stable/k8s-inventory/templates/secrets.yaml b/stable/k8s-inventory/templates/secrets.yaml index c4c90896..37d81d92 100644 --- a/stable/k8s-inventory/templates/secrets.yaml +++ b/stable/k8s-inventory/templates/secrets.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.useExistingSecrets }} +{{- if not .Values.useExistingSecret }} apiVersion: v1 kind: Secret metadata: