From 477ea20fc8833089373944da07871fdf9ceb2252 Mon Sep 17 00:00:00 2001 From: Tommy Date: Sat, 13 Apr 2024 23:10:58 +0200 Subject: [PATCH] fix: add missing selectorlabels for podmonitor and source image tag from chart --- charts/ntfy-sh/Chart.yaml | 2 +- charts/ntfy-sh/templates/_helpers.tpl | 15 +++++++++++++++ charts/ntfy-sh/templates/deployment-server.yaml | 2 +- charts/ntfy-sh/tests/values.yaml | 5 ++++- charts/ntfy-sh/values.yaml | 1 - 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/charts/ntfy-sh/Chart.yaml b/charts/ntfy-sh/Chart.yaml index 9918485..90ce3b8 100644 --- a/charts/ntfy-sh/Chart.yaml +++ b/charts/ntfy-sh/Chart.yaml @@ -4,7 +4,7 @@ description: | ntfy lets you send push notifications to your phone or desktop via scripts from any computer appVersion: v2.10.0 type: application -version: 0.2.1 +version: 0.2.2 maintainers: - name: Tommy Skaug email: tommy@skaug.me diff --git a/charts/ntfy-sh/templates/_helpers.tpl b/charts/ntfy-sh/templates/_helpers.tpl index d42a798..59f7b72 100644 --- a/charts/ntfy-sh/templates/_helpers.tpl +++ b/charts/ntfy-sh/templates/_helpers.tpl @@ -7,6 +7,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end }} +{{/* +Get the correct image tag name +*/}} +{{- define "ntfy.imageTag" -}} +{{- .Values.image.tag | default (printf "v%s" .Chart.AppVersion) -}} +{{- end -}} + # Define a template for standard labels. {{/* Common labels @@ -19,6 +26,14 @@ app.kubernetes.io/version: {{ .Chart.Version | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{/* +Selector labels +*/}} +{{- define "ntfy.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ntfy.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + # Define a template for the chart name and version. {{/* Generate basic labels diff --git a/charts/ntfy-sh/templates/deployment-server.yaml b/charts/ntfy-sh/templates/deployment-server.yaml index 462c7bb..9762e9e 100644 --- a/charts/ntfy-sh/templates/deployment-server.yaml +++ b/charts/ntfy-sh/templates/deployment-server.yaml @@ -17,7 +17,7 @@ spec: serviceAccountName: {{ include "ntfy.fullname" . }} containers: - name: {{ include "ntfy.fullname" . }}-server - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + image: {{ .Values.image.repository }}:{{ include "ntfy.imageTag" . }} args: ["serve"] env: - name: NTFY_BASE_URL diff --git a/charts/ntfy-sh/tests/values.yaml b/charts/ntfy-sh/tests/values.yaml index 9ea091f..f8d54a3 100644 --- a/charts/ntfy-sh/tests/values.yaml +++ b/charts/ntfy-sh/tests/values.yaml @@ -6,4 +6,7 @@ persistence: image: repository: binwiederhier/ntfy - tag: v2.10.0 \ No newline at end of file + +prometheus: + podmonitor: + enabled: true diff --git a/charts/ntfy-sh/values.yaml b/charts/ntfy-sh/values.yaml index 3e8073a..f8d54a3 100644 --- a/charts/ntfy-sh/values.yaml +++ b/charts/ntfy-sh/values.yaml @@ -6,7 +6,6 @@ persistence: image: repository: binwiederhier/ntfy - tag: v2.10.0 prometheus: podmonitor: