Skip to content

Commit

Permalink
Merge pull request #73 from vector-im/bbz/fix-missing-top-level-labels
Browse files Browse the repository at this point in the history
Fix missing top level labels
  • Loading branch information
benbz authored Jun 29, 2023
2 parents 599a1c9 + dc0d8a6 commit c6c440f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.3
version: 0.6.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
30 changes: 27 additions & 3 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ app.kubernetes.io/managed-by: {{ .Values.managedBy | default .Release.Service }}
{{- end -}}

{{/*
Selector labels
Selector labels. These should be constant across deploys for resources of the same name.
If resources rename (i.e. nameOverride is set/changes), it is fine for these labels to
change value.
*/}}
{{- define "jitsi.selectorLabels" -}}
app.kubernetes.io/part-of: jitsi-stack
Expand Down Expand Up @@ -89,9 +91,21 @@ app.kubernetes.io/component: jitsi-web-server
shard: {{ toYaml .RelativeScope | quote }}
{{- end -}}


{{/*
General labels. These should include all the corresponding selector labels
and also include any labels that may change between standard deploys of the
chart (e.g. upgrading so version number changes). They should also
contain any user provided labels for the same reason.
If there's (e.g.) global and shard label variants for the same component
the shard label definition doesn't include the global one. This is because
both will include the selctor labels and we don't want duplicates. So there
is some unavoidable repetition here
*/}}
{{- define "jitsi.config.labels" -}}
{{ include "jitsi.selectorLabels" . }}
{{ include "jitsi.labels" . }}
{{ include "jitsi.selectorLabels" . }}
app.kubernetes.io/instance: {{ include "jitsi.name" . }}-config
app.kubernetes.io/name: jitsi-config
app.kubernetes.io/component: jitsi-shared-config
Expand All @@ -101,15 +115,16 @@ app.kubernetes.io/component: jitsi-shared-config
{{- end -}}
{{- define "jitsi.haproxy.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.haproxy.selectorLabels" . }}
{{- with $.Values.haproxy.extraLabels }}
{{ toYaml .}}
{{- end }}
{{- end -}}
{{- define "jitsi.ingress.labels" -}}
{{ include "jitsi.selectorLabels" . }}
{{ include "jitsi.labels" . }}
{{ include "jitsi.selectorLabels" . }}
app.kubernetes.io/instance: {{ include "jitsi.name" . }}-ingress
app.kubernetes.io/name: jitsi-ingress
app.kubernetes.io/component: jitsi-ingress
Expand All @@ -119,62 +134,71 @@ app.kubernetes.io/component: jitsi-ingress
{{- end -}}
{{- define "jitsi.jicofoShard.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.jicofoShard.selectorLabels" . }}
{{- with $.Values.jicofo.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.jvbGlobal.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.jvbGlobal.selectorLabels" . }}
{{- with $.Values.jvb.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.jvbShard.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.jvbShard.selectorLabels" . }}
{{- with $.Values.jvb.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.jvbReplica.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.jvbReplica.selectorLabels" . }}
{{- with $.Values.jvb.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.jvbReplicaMonitoring.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.jvbReplica.selectorLabels" . }}
{{- with $.Values.jvb.monitoring.service.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.prosodyGlobal.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.prosodyGlobal.selectorLabels" . }}
{{- with $.Values.prosody.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.prosodyShard.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.prosodyShard.selectorLabels" . }}
{{- with $.Values.prosody.extraLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{- define "jitsi.sysctlJvb.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.sysctlJvb.selectorLabels" . }}
{{- with $.Values.sysctljvb.extraLabels }}
{{ toYaml .}}
{{- end }}
{{- end -}}
{{- define "jitsi.webShard.labels" -}}
{{ include "jitsi.labels" . }}
{{ include "jitsi.webShard.selectorLabels" . }}
{{- with $.Values.web.extraLabels }}
{{ toYaml . }}
Expand Down
2 changes: 1 addition & 1 deletion templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data:
JVB_AUTH_PASSWORD: {{ required "JVB_AUTH_PASSWORD is required" $.Values.JVB_AUTH_PASSWORD | b64enc }}
kind: Secret
metadata:
labels: {{ include "jitsi.labels" $ | nindent 4 }}
labels: {{ include "jitsi.config.labels" $ | nindent 4 }}
name: {{ include "jitsi.sharedSecret.name" $ }}
namespace: {{ $.Release.Namespace }}
type: Opaque
Expand Down

0 comments on commit c6c440f

Please sign in to comment.