Skip to content

Commit 951745c

Browse files
authored
[common] feat: add "common.namespace", defaults to .Release.Namespace… (CloudPirates-io#323)
[common] feat: add "common.namespace", defaults to .Release.Namespace but can be overridden via .Values.namespaceOverride
1 parent 986eff5 commit 951745c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

charts/common/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: common
33
description: A library chart for common templates and helper functions
44
type: library
5-
version: 1.1.1
5+
version: 1.1.2
66
appVersion: "1.0.0"
77

88
home: https://www.cloudpirates.io

charts/common/templates/_helpers.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ If release name contains chart name it will be used as a full name.
2323
{{- end }}
2424
{{- end }}
2525

26+
{{/*
27+
Return the namespace to use for resources.
28+
Defaults to .Release.Namespace but can be overridden via .Values.namespaceOverride.
29+
Useful for multi-namespace deployments in combined charts.
30+
*/}}
31+
{{- define "common.namespace" -}}
32+
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
33+
{{- end }}
34+
2635
{{/*
2736
Create chart name and version as used by the chart label.
2837
*/}}

0 commit comments

Comments
 (0)