github.com/Azure/aad-pod-identity@v1.8.17/charts/aad-pod-identity/templates/_helper.tpl (about)

     1  {{/* vim: set filetype=mustache: */}}
     2  {{/*
     3  Expand the name of the chart.
     4  */}}
     5  {{- define "aad-pod-identity.name" -}}
     6  {{- default .Chart.Name .Values.nameOverride | trunc 59 | trimSuffix "-" -}}
     7  {{- end -}}
     8  
     9  {{/*
    10  Create a default fully qualified app name.
    11  We truncate at 63 chars (minus 4 for suffix) because some Kubernetes name fields are limited to this (by the DNS naming spec).
    12  If release name contains chart name it will be used as a full name.
    13  */}}
    14  {{- define "aad-pod-identity.fullname" -}}
    15  {{- if .Values.fullnameOverride -}}
    16  {{- .Values.fullnameOverride | trunc 59 | trimSuffix "-" -}}
    17  {{- else -}}
    18  {{- $name := default .Chart.Name .Values.nameOverride -}}
    19  {{- if contains $name .Release.Name -}}
    20  {{- .Release.Name | trunc 59 | trimSuffix "-" -}}
    21  {{- else -}}
    22  {{- printf "%s-%s" .Release.Name $name | trunc 59 | trimSuffix "-" -}}
    23  {{- end -}}
    24  {{- end -}}
    25  {{- end -}}
    26  
    27  {{- define "aad-pod-identity.mic.fullname" -}}
    28  {{- printf "%s-mic" (include "aad-pod-identity.name" .) -}}
    29  {{- end }}
    30  
    31  {{- define "aad-pod-identity.nmi.fullname" -}}
    32  {{- printf "%s-nmi" (include "aad-pod-identity.name" .) -}}
    33  {{- end }}
    34  
    35  {{- define "aad-pod-identity-psp.mic.fullname" -}}
    36  {{- printf "%s-psp-mic" (include "aad-pod-identity.name" .) -}}
    37  {{- end }}
    38  
    39  {{- define "aad-pod-identity-psp.nmi.fullname" -}}
    40  {{- printf "%s-psp-nmi" (include "aad-pod-identity.name" .) -}}
    41  {{- end }}
    42  
    43  {{/*
    44  Create chart name and version as used by the chart label.
    45  */}}
    46  {{- define "aad-pod-identity.chart" -}}
    47  {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
    48  {{- end -}}
    49  
    50  {{/*
    51  Common selectors.
    52  */}}
    53  {{- define "aad-pod-identity.selectors" -}}
    54  app.kubernetes.io/name: {{ template "aad-pod-identity.name" . }}
    55  app.kubernetes.io/instance: {{ .Release.Name }}
    56  {{- end -}}
    57  
    58  {{/*
    59  Common labels.
    60  */}}
    61  {{- define "aad-pod-identity.labels" -}}
    62  {{- include "aad-pod-identity.selectors" . }}
    63  app.kubernetes.io/managed-by: {{ .Release.Service }}
    64  helm.sh/chart: {{ template "aad-pod-identity.chart" . }}
    65  {{- end -}}