Files
deprecated-helm-charts/stable/sysdig/templates/_helpers.tpl
T
Néstor Salceda f466d228d0 [stable/sysdig] Allow to use other image registries than docker.io (#9301)
* Allow to use other image registries than docker.io

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>

* Add a section to README for documenting how to use private repositories

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>

* Add a section for documenting the AWS Marketplace setup.

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>

* Do not create Daemonset if accessKey is missing

This fixes the CI build

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>

* Fixes suggested by @bencer

Thanks!

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>

* Fix the changes that @bencer requested.

I didn't see them before

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>

* Fix feedback from @bencer

Signed-off-by: Néstor Salceda <nestor.salceda@sysdig.com>
2018-11-19 09:00:56 -08:00

67 lines
2.1 KiB
Smarty

{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "sysdig.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "sysdig.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "sysdig.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "sysdig.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "sysdig.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Return the proper Sysdig Agent image name
*/}}
{{- define "sysdig.image" -}}
{{- $registryName := .Values.image.registry -}}
{{- $repositoryName := .Values.image.repository -}}
{{- $tag := .Values.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}