Add labels to more common objects and add names.fqdn (#884)

* Add labels to more common objects and add names.fqdn

* whoops copy pasta mistake
This commit is contained in:
Kjeld Schouten-Lebbing 2021-09-02 14:41:22 +02:00 committed by GitHub
parent f0b31dddc4
commit 29615ca832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 2 deletions

View File

@ -18,4 +18,4 @@ maintainers:
name: common
sources: null
type: library
version: 6.13.1
version: 6.13.2

View File

@ -7,6 +7,8 @@ Blueprint for the NetworkPolicy object that can be included in the addon.
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
labels:
{{- include "common.labels" . | nindent 4 }}
name: {{ include "common.names.fullname" . }}
spec:
podSelector:

View File

@ -10,6 +10,7 @@ kind: ClusterRole
metadata:
name: {{ include "common.names.fullname" . -}}
labels:
{{- include "common.labels" . | nindent 4 }}
{{- with .Values.rbac.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
@ -27,6 +28,7 @@ kind: ClusterRoleBinding
metadata:
name: {{ include "common.names.fullname" . -}}
labels:
{{- include "common.labels" . | nindent 4 }}
{{- with .Values.rbac.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}

View File

@ -71,7 +71,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: portal
labels: {{ include "common.labels" . | nindent 4 }}
labels:
{{ include "common.labels" . | nindent 4 }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
data:

View File

@ -56,3 +56,10 @@ If release name contains chart name it will be used as a full name.
{{- fail (printf "Not a valid controller.type (%s)" .Values.controller.type) -}}
{{- end -}}
{{- end -}}
{{/*
Create the "name" + "." + "namespace" fqdn
*/}}
{{- define "common.names.fqdn" -}}
{{- printf "%s.%s" (include "common.names.fullname" .) .Release.Namespace | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}