From 833c877ca531b354614975afd026ba391366907a Mon Sep 17 00:00:00 2001 From: yanyx Date: Tue, 19 Jul 2022 20:47:42 +0800 Subject: [PATCH] fix(argo-cd): fix unmarshal annotaions error (#1379) Signed-off-by: Yixing Yan --- charts/argo-cd/Chart.yaml | 4 ++-- .../argocd-notifications/service-metrics.yaml | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 8c643381..1444e478 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v2.4.7 description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 4.9.15 +version: 4.9.16 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Changed]: Update to app version 2.4.7" + - "[Fixed]: Fix ArgoCD notification metrics unmarshal error" diff --git a/charts/argo-cd/templates/argocd-notifications/service-metrics.yaml b/charts/argo-cd/templates/argocd-notifications/service-metrics.yaml index 118fc428..8e0a92a8 100644 --- a/charts/argo-cd/templates/argocd-notifications/service-metrics.yaml +++ b/charts/argo-cd/templates/argocd-notifications/service-metrics.yaml @@ -5,18 +5,21 @@ metadata: name: {{ template "argo-cd.notifications.fullname" . }}-metrics labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 4 }} - {{- with .Values.notifications.metrics.service.labels }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.notifications.metrics.service.annotations }} +{{- if .Values.notifications.metrics.service.labels }} +{{- toYaml .Values.notifications.metrics.service.labels | nindent 4 }} +{{- end }} +{{- if .Values.notifications.metrics.service.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- range $key, $value := .Values.notifications.metrics.service.annotations }} + {{ $key }}: {{ $value | quote }} {{- end }} +{{- end }} spec: selector: {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }} ports: - name: {{ .Values.notifications.metrics.service.portName }} + protocol: TCP port: {{ .Values.notifications.metrics.port }} - targetPort: {{ .Values.notifications.metrics.port }} + targetPort: metrics {{- end }}