From 3ec1fa6f214d98c437a262c1d07b80a70967ba28 Mon Sep 17 00:00:00 2001 From: Rhea Danzey Date: Mon, 17 Feb 2025 02:42:33 -0600 Subject: [PATCH] Helm Chart - Fix missing namespace attributes on resources (#1013) * Add missing namespace attribute to resources Signed-off-by: Rhea Danzey * Bump chart version to 0.1.16 Signed-off-by: Rhea Danzey * Add changelog entry Signed-off-by: Rhea Danzey --------- Signed-off-by: Rhea Danzey --- changelog.d/1013.bugfix | 1 + helm/hookshot/Chart.yaml | 2 +- helm/hookshot/templates/deployment.yaml | 1 + helm/hookshot/templates/hpa.yaml | 1 + helm/hookshot/templates/ingress-appservice.yaml | 1 + helm/hookshot/templates/ingress.yaml | 1 + helm/hookshot/templates/service.yaml | 1 + helm/hookshot/templates/serviceaccount.yaml | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog.d/1013.bugfix diff --git a/changelog.d/1013.bugfix b/changelog.d/1013.bugfix new file mode 100644 index 000000000..f5cf3318f --- /dev/null +++ b/changelog.d/1013.bugfix @@ -0,0 +1 @@ +Fixed Helm chart templates missing `namespace:` in resource metadata, causing some resources to appear in different namespaces under certain circumstances, specifically deployment scenarios using ArgoCD-deployed Helmfile with a release namespace set for Hookshot differently than the ArgoCD Application's namespace. Most other Helm deployment methods should continue to work as expected with your existing configuration, as the inferred namespace would have resulted in proper resource placement without this change. \ No newline at end of file diff --git a/helm/hookshot/Chart.yaml b/helm/hookshot/Chart.yaml index 288ec676d..50e8bfebc 100644 --- a/helm/hookshot/Chart.yaml +++ b/helm/hookshot/Chart.yaml @@ -14,7 +14,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.15 +version: 0.1.16 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/helm/hookshot/templates/deployment.yaml b/helm/hookshot/templates/deployment.yaml index 02d5b49ad..cf147667c 100644 --- a/helm/hookshot/templates/deployment.yaml +++ b/helm/hookshot/templates/deployment.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "hookshot.fullname" . }} + namespace: {{ template "hookshot.namespace" . }} labels: {{- include "hookshot.labels" . | nindent 4 }} spec: diff --git a/helm/hookshot/templates/hpa.yaml b/helm/hookshot/templates/hpa.yaml index d3a61dd5a..011e03059 100644 --- a/helm/hookshot/templates/hpa.yaml +++ b/helm/hookshot/templates/hpa.yaml @@ -4,6 +4,7 @@ apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: {{ include "hookshot.fullname" . }} + namespace: {{ template "hookshot.namespace" . }} labels: {{- include "hookshot.labels" . | nindent 4 }} spec: diff --git a/helm/hookshot/templates/ingress-appservice.yaml b/helm/hookshot/templates/ingress-appservice.yaml index 3a537d569..8dc1efbf7 100644 --- a/helm/hookshot/templates/ingress-appservice.yaml +++ b/helm/hookshot/templates/ingress-appservice.yaml @@ -17,6 +17,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ $fullName }}-appservice + namespace: {{ template "hookshot.namespace" . }} labels: {{- include "hookshot.labels" . | nindent 4 }} {{- with .Values.ingress.appservice.annotations }} diff --git a/helm/hookshot/templates/ingress.yaml b/helm/hookshot/templates/ingress.yaml index 129d19a3f..22fe1bf65 100644 --- a/helm/hookshot/templates/ingress.yaml +++ b/helm/hookshot/templates/ingress.yaml @@ -17,6 +17,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ template "hookshot.namespace" . }} labels: {{- include "hookshot.labels" . | nindent 4 }} {{- with .Values.ingress.webhook.annotations }} diff --git a/helm/hookshot/templates/service.yaml b/helm/hookshot/templates/service.yaml index a55cfbc6e..7c4bcc7c1 100644 --- a/helm/hookshot/templates/service.yaml +++ b/helm/hookshot/templates/service.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "hookshot.fullname" . }} + namespace: {{ template "hookshot.namespace" . }} {{- with .Values.service.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/helm/hookshot/templates/serviceaccount.yaml b/helm/hookshot/templates/serviceaccount.yaml index f4950c3cf..8f732d49a 100644 --- a/helm/hookshot/templates/serviceaccount.yaml +++ b/helm/hookshot/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "hookshot.serviceAccountName" . }} + namespace: {{ template "hookshot.namespace" . }} labels: {{- include "hookshot.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }}