blob: b2d3d523a970e4c42512a2ab31ef319816ae9e79 [file] [log] [blame]
Dominic Lunanuova50aafc52018-03-30 02:29:23 +00001{{/* vim: set filetype=mustache: */}}
2{{/*
3Expand the name of the chart.
4*/}}
5{{- define "postgresql.name" -}}
6{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7{{- end -}}
8
9{{/*
10Create a default fully qualified app name.
11We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12If release name contains chart name it will be used as a full name.
13*/}}
14{{- define "postgresql.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 -}}
25{{- end -}}
26
27{{/*
28Return the appropriate apiVersion for networkpolicy.
29*/}}
30{{- define "postgresql.networkPolicy.apiVersion" -}}
31{{- if and (ge .Capabilities.KubeVersion.Minor "4") (le .Capabilities.KubeVersion.Minor "6") -}}
32"extensions/v1beta1"
33{{- else if ge .Capabilities.KubeVersion.Minor "7" -}}
34"networking.k8s.io/v1"
35{{- end -}}
36{{- end -}}