Skip to content

Commit

Permalink
Fix broken labels (#251)
Browse files Browse the repository at this point in the history
* Fix broken labels

Turns out k8s doesn't like having a plus "+" sign in labels, meaning I
need to convert the "+" sign in the version to a supported character.
This does that.

Signed-off-by: M. David Bennett <[email protected]>

* Remove indent.

Signed-off-by: M. David Bennett <[email protected]>
  • Loading branch information
mdavidbennett authored Feb 11, 2020
1 parent 0f0f0a5 commit c4b335e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions helm/opsy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Common labels
*/}}
{{- define "opsy.labels" -}}
app.kubernetes.io/name: {{ include "opsy.name" . }}
helm.sh/chart: {{ include "opsy.chart" . }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
Expand All @@ -49,7 +49,7 @@ Migration labels
*/}}
{{- define "opsy.migrationLabels" -}}
app.kubernetes.io/name: {{ include "opsy.name" . }}-database-migrations
helm.sh/chart: {{ include "opsy.chart" . }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
Expand Down
6 changes: 1 addition & 5 deletions helm/opsy/templates/database_migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ spec:
metadata:
name: {{ include "opsy.fullname" . }}-database-migration
labels:
app: {{ include "opsy.fullname" . }}
app.kubernetes.io/name: {{ include "opsy.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
{{ include "opsy.migrationLabels" . | indent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
Expand Down
6 changes: 1 addition & 5 deletions helm/opsy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ spec:
template:
metadata:
labels:
app: {{ include "opsy.fullname" . }}
app.kubernetes.io/name: {{ include "opsy.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
{{ include "opsy.labels" . | indent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
Expand Down

0 comments on commit c4b335e

Please sign in to comment.