Skip to content

Commit ad18c38

Browse files
committed
fix: ensure Helm releases have unique names for the resources
This ensures that customers can install multiple copies of snyk-monitor in their cluster. We now ensure that all of the Helm resources have a name matching the Helm release name, which will be unique. This allows global resources such as ClusterRoles to be unique.
1 parent 86034b8 commit ad18c38

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

snyk-monitor/templates/_helpers.tpl

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,7 @@
33
Expand the name of the chart.
44
*/}}
55
{{- define "snyk-monitor.name" -}}
6-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7-
{{- end -}}
8-
9-
{{/*
10-
Create a default fully qualified app name.
11-
We truncate at 63 chars 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 "snyk-monitor.fullname" -}}
15-
{{- if .Values.fullnameOverride -}}
16-
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17-
{{- else -}}
18-
{{- $name := default .Chart.Name .Values.nameOverride -}}
19-
{{- if contains $name .Release.Name -}}
20-
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21-
{{- else -}}
22-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23-
{{- end -}}
24-
{{- end -}}
6+
{{- default .Release.Name | trunc 63 | trimSuffix "-" -}}
257
{{- end -}}
268

279
{{/*

snyk-operator-certified/helm-charts/snyk-monitor/templates/_helpers.tpl

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,7 @@
33
Expand the name of the chart.
44
*/}}
55
{{- define "snyk-monitor.name" -}}
6-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7-
{{- end -}}
8-
9-
{{/*
10-
Create a default fully qualified app name.
11-
We truncate at 63 chars 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 "snyk-monitor.fullname" -}}
15-
{{- if .Values.fullnameOverride -}}
16-
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17-
{{- else -}}
18-
{{- $name := default .Chart.Name .Values.nameOverride -}}
19-
{{- if contains $name .Release.Name -}}
20-
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21-
{{- else -}}
22-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23-
{{- end -}}
24-
{{- end -}}
6+
{{- default .Release.Name | trunc 63 | trimSuffix "-" -}}
257
{{- end -}}
268

279
{{/*

0 commit comments

Comments
 (0)