Skip to content

Commit

Permalink
Merge pull request #24 from nixys/fix
Browse files Browse the repository at this point in the history
Changelog update
  • Loading branch information
Roman Andreev authored Aug 1, 2022
2 parents e20c7b6 + 251996d commit 6fb0e36
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.3 - Aug 1, 2022

* fix: rolled back parameter `servicemonitors` and marked as deprecated

## 2.1.2 - Aug 1, 2022

* fix: parameter `servicemonitors` has been renamed to `serviceMonitors`
Expand Down
2 changes: 1 addition & 1 deletion templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{- include "helpers.deprecation.notice" $ }}
{{- include "helpers.deprecation.workload.imagePullSecrets" $ }}
{{- include "helpers.incompatibleChanges.serviceMonitors" $ }}
{{- include "helpers.deprecation.serviceMonitors" $ }}
8 changes: 0 additions & 8 deletions templates/helpers/_changes.tpl

This file was deleted.

12 changes: 12 additions & 0 deletions templates/helpers/_deprecations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

Option `imagePullSecrets` for workloads deprecated and will be removed in the future releases.
Please use `extraImagePullSecrets` instead.

Option `servicemonitors` has been renamed to `serviceMonitors` and will be removed in the future releases.
Please use `serviceMonitors` instead.
{{- end }}


Expand Down Expand Up @@ -32,3 +35,12 @@ You use deprecated option `imagePullSecrets` for cronjob "{{$name}}". Please use
You use deprecated option `imagePullSecrets` for job "{{$name}}". Please use `extraImagePullSecrets` instead.
{{- end }}{{ end }}
{{ end }}

{{- define "helpers.deprecation.serviceMonitors" -}}
{{- if .Values.servicemonitors }}

** WARNING **

You use deprecated option `servicemonitors`. Please use `serviceMonitors` instead.
{{- end }}
{{ end }}
22 changes: 21 additions & 1 deletion templates/servicemonitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,24 @@ spec:
{{- include "helpers.app.selectorLabels" $ | nindent 6 }}
{{- with $.Values.generic.extraSelectorLabels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}{{- end -}}
{{- with .extraSelectorLabels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}{{- end -}}
{{- end -}}
{{- end }}

{{- range $name, $sm := .Values.servicemonitors }}
---
kind: ServiceMonitor
apiVersion: monitoring.coreos.com/v1
metadata:
name: {{ include "helpers.app.fullname" (dict "name" $name "context" $) }}
namespace: {{ $.Release.Namespace | quote }}
labels:
{{- include "helpers.app.labels" $ | nindent 4 }}
{{- with .labels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }}
spec:
endpoints:
{{- include "helpers.tplvalues.render" (dict "value" .endpoints "context" $) | nindent 4 }}
selector:
matchLabels:
{{- include "helpers.app.selectorLabels" $ | nindent 6 }}
{{- with $.Values.generic.extraSelectorLabels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}{{- end -}}
{{- with .extraSelectorLabels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 6 }}{{- end -}}
{{- end }}

0 comments on commit 6fb0e36

Please sign in to comment.