Issue with template - servicemonitor.yaml
Found an issue with BB ArgoCD template, during Level-UP BB upgrade
ArgoCD Official Charts: https://github.com/argoproj/argo-helm/blob/main/charts/argo-cd/templates/argocd-repo-server/servicemonitor.yaml
honorLabels was added in the 7.7.5 bb.0. with block is used before checking honorLabels condition
{{- with .Values.repoServer.metrics.serviceMonitor.scheme }}
honorLabels: {{ .Values.repoServer.metrics.serviceMonitor.honorLabels }}
scheme: {{ . }}
{{- end }}
however in argocd official helm charts condition is define differently https://github.com/argoproj/argo-helm/blob/main/charts/argo-cd/templates/argocd-repo-server/servicemonitor.yaml
honorLabels: {{ .Values.repoServer.metrics.serviceMonitor.honorLabels }}
{{- with .Values.repoServer.metrics.serviceMonitor.scheme }}
scheme: {{ . }}
{{- end }}
The placement of the {{- with .Values.repoServer.metrics.serviceMonitor.scheme }} `block is different, which changes the context in which the variables are accessed.
BB code
The with block wraps the honorLabels and scheme lines
ArgoCD official chart:
The with block is placed after honorLabels
The reason issue didn't appear with BB team because metrics and serviceMonitor values were set tofalse hence it won't check honorslabel, but 'Level-UP Team' is using the metrics and serviceMonitor values in Taurus Repo, and that's why it is failing for Level-UP team.
metrics and serviceMonitor values are set to true for level-UP team:
repoServer:
metrics:
enabled: true
serviceMonitor:
enabled: true
honorLabels: false
When we apply helmcharts for ArgoCD we get following error due to this issue:
Helm install failed for release argocd/argocd-argocd with chart argocd@7.7.5-bb.0: template: argocd/templates/argocd-repo-server/servicemonitor.yaml:38:29: executing "argocd/templates/argocd-repo-server/servicemonitor.yaml" at <.Values.repoServer.metrics.serviceMonitor.honorLabels>: can't evaluate field Values in type string