github.com/nikkelma/oras-project_oras-go@v1.1.1-0.20220201001104-a75f6a419090/testdata/charts/chartmuseum/templates/_helpers.tpl (about)

     1  {{- /*
     2  name defines a template for the name of the chartmuseum chart.
     3  
     4  The prevailing wisdom is that names should only contain a-z, 0-9 plus dot (.) and dash (-), and should
     5  not exceed 63 characters.
     6  
     7  Parameters:
     8  
     9  - .Values.nameOverride: Replaces the computed name with this given name
    10  - .Values.namePrefix: Prefix
    11  - .Values.global.namePrefix: Global prefix
    12  - .Values.nameSuffix: Suffix
    13  - .Values.global.nameSuffix: Global suffix
    14  
    15  The applied order is: "global prefix + prefix + name + suffix + global suffix"
    16  
    17  Usage: 'name: "{{- template "chartmuseum.name" . -}}"'
    18  */ -}}
    19  {{- define "chartmuseum.name"}}
    20  {{- $global := default (dict) .Values.global -}}
    21  {{- $base := default .Chart.Name .Values.nameOverride -}}
    22  {{- $gpre := default "" $global.namePrefix -}}
    23  {{- $pre := default "" .Values.namePrefix -}}
    24  {{- $suf := default "" .Values.nameSuffix -}}
    25  {{- $gsuf := default "" $global.nameSuffix -}}
    26  {{- $name := print $gpre $pre $base $suf $gsuf -}}
    27  {{- $name | lower | trunc 54 | trimSuffix "-" -}}
    28  {{- end -}}
    29  
    30  {{- /*
    31  fullname defines a suitably unique name for a resource by combining
    32  the release name and the chartmuseum chart name.
    33  
    34  The prevailing wisdom is that names should only contain a-z, 0-9 plus dot (.) and dash (-), and should
    35  not exceed 63 characters.
    36  
    37  Parameters:
    38  
    39  - .Values.fullnameOverride: Replaces the computed name with this given name
    40  - .Values.fullnamePrefix: Prefix
    41  - .Values.global.fullnamePrefix: Global prefix
    42  - .Values.fullnameSuffix: Suffix
    43  - .Values.global.fullnameSuffix: Global suffix
    44  
    45  The applied order is: "global prefix + prefix + name + suffix + global suffix"
    46  
    47  Usage: 'name: "{{- template "chartmuseum.fullname" . -}}"'
    48  */ -}}
    49  {{- define "chartmuseum.fullname"}}
    50  {{- $global := default (dict) .Values.global -}}
    51  {{- $base := default (printf "%s-%s" .Release.Name .Chart.Name) .Values.fullnameOverride -}}
    52  {{- $gpre := default "" $global.fullnamePrefix -}}
    53  {{- $pre := default "" .Values.fullnamePrefix -}}
    54  {{- $suf := default "" .Values.fullnameSuffix -}}
    55  {{- $gsuf := default "" $global.fullnameSuffix -}}
    56  {{- $name := print $gpre $pre $base $suf $gsuf -}}
    57  {{- $name | lower | trunc 54 | trimSuffix "-" -}}
    58  {{- end -}}
    59  
    60  
    61  {{- /*
    62  chartmuseum.labels.standard prints the standard chartmuseum Helm labels.
    63  
    64  The standard labels are frequently used in metadata.
    65  */ -}}
    66  {{- define "chartmuseum.labels.standard" -}}
    67  app: {{ template "chartmuseum.name" . }}
    68  chart: {{ template "chartmuseum.chartref" . }}
    69  heritage: {{ .Release.Service | quote }}
    70  release: {{ .Release.Name | quote }}
    71  {{- end -}}
    72  
    73  {{- /*
    74  chartmuseum.chartref prints a chart name and version.
    75  
    76  It does minimal escaping for use in Kubernetes labels.
    77  
    78  Example output:
    79  
    80  chartmuseum-0.4.5
    81  */ -}}
    82  {{- define "chartmuseum.chartref" -}}
    83  {{- replace "+" "_" .Chart.Version | printf "%s-%s" .Chart.Name -}}
    84  {{- end -}}