-- Generated using ultisnips_to_luasnip.py

local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
local k = require("luasnip.nodes.key_indexer").new_key
local su = require("luasnip_snippets.common.snip_utils")
local cp = su.copy
local tr = su.transform
local rx_tr = su.regex_transform
local jt = su.join_text
local nl = su.new_line
local te = su.trig_engine
local c_py = su.code_python
local c_viml = su.code_viml
local c_shell = su.code_shell
local make_actions = su.make_actions


ls.add_snippets("helm", {
	s({trig = "service_sample_spec", descr = "(service_sample_spec)", priority = -1000, trigEngine = te("w")}, {
		t"apiVersion: v1", nl(),
		t"kind: Service", nl(),
		t"metadata:", nl(),
		t"{{- if .Values.", cp(1), t".service.annotations }}", nl(),
		t"  annotations:", nl(),
		t"{{ toYaml .Values.", cp(1), t".service.annotations | indent 4 }}", nl(),
		t"{{- end }}", nl(),
		t"  labels:", nl(),
		t"{{- if .Values.", cp(1), t".service.labels }}", nl(),
		t"{{ toYaml .Values.", cp(1), t".service.labels | indent 4 }}", nl(),
		t"{{- end }}", nl(),
		t"\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\tchart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
		t"\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\theritage: {{ .Release.Service }}", nl(),
		t"\trelease: {{ .Release.Name }}", nl(),
		t"  name: {{ template \"", cp(2), t".", cp(1), t".fullname\" . }}", nl(),
		t"spec:", nl(),
		t"  clusterIP: \"{{ .Values.", cp(1), t".service.clusterIP }}\"", nl(),
		t"{{- if .Values.", cp(1), t".service.externalIPs }}", nl(),
		t"  externalIPs:", nl(),
		t"{{ toYaml .Values.", cp(1), t".service.externalIPs | indent 4 }}", nl(),
		t"{{- end }}", nl(),
		t"{{- if .Values.", cp(1), t".service.loadBalancerIP }}", nl(),
		t"  loadBalancerIP: \"{{ .Values.", cp(1), t".service.loadBalancerIP }}\"", nl(),
		t"{{- end }}", nl(),
		t"{{- if .Values.", cp(1), t".service.loadBalancerSourceRanges }}", nl(),
		t"  loadBalancerSourceRanges:", nl(),
		t"{{ toYaml .Values.", cp(1), t".service.loadBalancerSourceRanges | indent 4 }}", nl(),
		t"{{- end }}", nl(),
		t"  healthCheckNodePort: {{ .Values.", cp(1), t".service.healthCheckNodePort }}", nl(),
		t"  ports:", nl(),
		t"\t- name: http", nl(),
		t"\t  port: 80", nl(),
		t"\t  protocol: TCP", nl(),
		t"\t  targetPort: {{ .Values.", cp(1), t".service.targetPorts.http }}", nl(),
		t"\t  {{- if (and (eq .Values.", cp(1), t".service.type \"NodePort\") (not (empty .Values.", cp(1), t".service.nodePorts.http))) }}", nl(),
		t"\t  nodePort: {{ .Values.", cp(1), t".service.nodePorts.http }}", nl(),
		t"\t  {{- end }}", nl(),
		t"\t- name: https", nl(),
		t"\t  port: 443", nl(),
		t"\t  protocol: TCP", nl(),
		t"\t  targetPort: {{ .Values.", cp(1), t".service.targetPorts.https }}", nl(),
		t"\t  {{- if (and (eq .Values.", cp(1), t".service.type \"NodePort\") (not (empty .Values.", cp(1), t".service.nodePorts.https))) }}", nl(),
		t"\t  nodePort: {{ .Values.", cp(1), t".service.nodePorts.https }}", nl(),
		t"\t  {{- end }}", nl(),
		t"  {{- range $key, $value := .Values.tcp }}", nl(),
		t"\t- name: \"{{ $key }}-tcp\"", nl(),
		t"\t  port: {{ $key }}", nl(),
		t"\t  protocol: TCP", nl(),
		t"\t  targetPort: \"{{ $key }}-tcp\"", nl(),
		t"  {{- end }}", nl(),
		t"  {{- range $key, $value := .Values.udp }}", nl(),
		t"\t- name: \"{{ $key }}-udp\"", nl(),
		t"\t  port: {{ $key }}", nl(),
		t"\t  protocol: UDP", nl(),
		t"\t  targetPort: \"{{ $key }}-udp\"", nl(),
		t"  {{- end }}", nl(),
		t"  selector:", nl(),
		t"\tapp: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}", nl(),
		t"\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\trelease: {{ .Release.Name }}", nl(),
		t"  type: \"{{ .Values.", i(1, "value_key", {key = "i1"}), t".service.type }}\""
	}),
	s({trig = "service_spec", descr = "(service_spec)", priority = -1000, trigEngine = te("w")}, c(1, {
		{
			t"apiVersion: v1", nl(),
			t"kind: Service", nl(),
			t"metadata:", nl(),
			t"{{- if .Values.", cp(1), t".service.annotations }}", nl(),
			t"  annotations:", nl(),
			t"{{ toYaml .Values.", cp(1), t".service.annotations | indent 4 }}", nl(),
			t"{{- end }}", nl(),
			t"  labels:", nl(),
			t"{{- if .Values.", cp(1), t".service.labels }}", nl(),
			t"{{ toYaml .Values.", cp(1), t".service.labels | indent 4 }}", nl(),
			t"{{- end }}", nl(),
			t"\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
			t"\tchart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
			t"\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
			t"\theritage: {{ .Release.Service }}", nl(),
			t"\trelease: {{ .Release.Name }}", nl(),
			t"  name: {{ template \"", i(2, "chartName", {key = "i2"}), t".", i(1, "value_key", {key = "i1"}), t".fullname\" . }}", nl(),
			t"# spec", nl(),
			i(0, "", {key = "i0"})
		},
		{
			t"spec:", nl(),
			t"  type: \"{{ .Values.", cp(1), t".service.type }}\"", nl(),
			t"  clusterIP: \"{{ .Values.", cp(1), t".service.clusterIP }}\"", nl(),
			t"{{- if .Values.", cp(1), t".service.externalIPs }}", nl(),
			t"  externalIPs:", nl(),
			t"{{ toYaml .Values.", cp(1), t".service.externalIPs | indent 4 }}", nl(),
			t"{{- end }}", nl(),
			t"{{- if .Values.", cp(1), t".service.loadBalancerIP }}", nl(),
			t"  loadBalancerIP: \"{{ .Values.", cp(1), t".service.loadBalancerIP }}\"", nl(),
			t"{{- end }}", nl(),
			t"{{- if .Values.", cp(1), t".service.loadBalancerSourceRanges }}", nl(),
			t"  loadBalancerSourceRanges:", nl(),
			t"{{ toYaml .Values.", cp(1), t".service.loadBalancerSourceRanges | indent 4 }}", nl(),
			t"{{- end }}", nl(),
			t"{{- if and (semverCompare \">=1.7-0\" .Capabilities.KubeVersion.GitVersion) (.Values.", cp(1), t".service.externalTrafficPolicy) }}", nl(),
			t"  externalTrafficPolicy: \"{{ .Values.", cp(1), t".service.externalTrafficPolicy }}\"", nl(),
			t"{{- end }}", nl(),
			t"{{- if and (semverCompare \">=1.7-0\" .Capabilities.KubeVersion.GitVersion) (.Values.", cp(1), t".service.healthCheckNodePort) }}", nl(),
			t"  healthCheckNodePort: {{ .Values.", i(1, "value_key", {key = "i1"}), t".service.healthCheckNodePort }}", nl(),
			t"{{- end }}", nl(),
			i(0, "", {key = "i0"})
		},
	})),
	s({trig = "annotations_spec", descr = "(annotations_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".service.annotations }}", nl(),
		t"  annotations:", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".service.annotations | indent 4 }}", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "labels_spec", descr = "(labels_spec)", priority = -1000, trigEngine = te("w")}, {
		t" labels:", nl(),
		t"{{- if .Values.", cp(1), t".service.labels }}", nl(),
		t"{{ toYaml .Values.", cp(1), t".service.labels | indent 4 }}", nl(),
		t"{{- end }}", nl(),
		t"\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\tchart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
		t"\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\theritage: {{ .Release.Service }}", nl(),
		t"\trelease: {{ .Release.Name }}", nl(),
		t"  name: {{ template \"", i(2, "chartName", {key = "i2"}), t".", i(1, "value_key", {key = "i1"}), t".fullname\" . }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "ports_spec", descr = "(ports_spec)", priority = -1000, trigEngine = te("w")}, {
		t"ports:", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "portHTTP_spec", descr = "(portHTTP_spec)", priority = -1000, trigEngine = te("w")}, {
		t"- name: http", nl(),
		t"  port: 80", nl(),
		t"  protocol: TCP", nl(),
		t"  targetPort: {{ .Values.", cp(1), t".service.targetPorts.http }}", nl(),
		t"  {{- if (and (eq .Values.", cp(1), t".service.type \"NodePort\") (not (empty .Values.", cp(1), t".service.nodePorts.http))) }}", nl(),
		t"  nodePort: {{ .Values.", i(1, "value_key", {key = "i1"}), t".service.nodePorts.http }}", nl(),
		t"  {{- end }}", nl(),
		t"  ", i(0, "", {key = "i0"})
	}),
	s({trig = "portHTTPS_spec", descr = "(portHTTPS_spec)", priority = -1000, trigEngine = te("w")}, {
		t"- name: https", nl(),
		t"  port: 443", nl(),
		t"  protocol: TCP", nl(),
		t"  targetPort: {{ .Values.", cp(1), t".service.targetPorts.https }}", nl(),
		t"  {{- if (and (eq .Values.", cp(1), t".service.type \"NodePort\") (not (empty .Values.", cp(1), t".service.nodePorts.https))) }}", nl(),
		t"  nodePort: {{ .Values.", i(1, "value_key", {key = "i1"}), t".service.nodePorts.https }}", nl(),
		t"  {{- end }}", nl(),
		t"  ", i(0, "", {key = "i0"})
	}),
	s({trig = "portTCP_spec", descr = "(portTCP_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- range $key, $value := .Values.tcp }}", nl(),
		t"  - name: \"{{ $key }}-tcp\"", nl(),
		t"\tport: {{ $key }}", nl(),
		t"\tprotocol: TCP", nl(),
		t"\ttargetPort: \"{{ $key }}-tcp\"", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "portUDP_spec", descr = "(portUDP_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- range $key, $value := .Values.udp }}", nl(),
		t"  - name: \"{{ $key }}-udp\"", nl(),
		t"\tport: {{ $key }}", nl(),
		t"\tprotocol: UDP", nl(),
		t"\ttargetPort: \"{{ $key }}-udp\"", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "selector_spec", descr = "(selector_spec)", priority = -1000, trigEngine = te("w")}, {
		t"selector:", nl(),
		t"  app: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}", nl(),
		t"  component: \"{{ .Values.", i(1, "value_key", {key = "i1"}), t".name }}\"", nl(),
		t"  release: {{ .Release.Name }}", nl(),
		t"  ", i(0, "", {key = "i0"})
	}),
	s({trig = "deploy_sample_spec", descr = "(deploy_sample_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".enabled }}", nl(),
		t"apiVersion: extensions/v1beta1", nl(),
		t"kind: Deployment", nl(),
		t"metadata:", nl(),
		t"  labels:", nl(),
		t"\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\tchart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
		t"\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\theritage: {{ .Release.Service }}", nl(),
		t"\trelease: {{ .Release.Name }}", nl(),
		t"  name: {{ template \"", cp(2), t".", cp(1), t".fullname\" . }}", nl(),
		t"spec:", nl(),
		t"  replicas: {{ .Values.", cp(1), t".replicaCount }}", nl(),
		t"  revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}", nl(),
		t"  template:", nl(),
		t"\tmetadata:", nl(),
		t"\t{{- if .Values.", cp(1), t".podAnnotations }}", nl(),
		t"\t  annotations:", nl(),
		t"{{ toYaml .Values.", cp(1), t".podAnnotations | indent 8 }}", nl(),
		t"\t{{- end }}", nl(),
		t"\t  labels:", nl(),
		t"\t\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\t\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\t\trelease: {{ .Release.Name }}", nl(),
		t"\t\t{{- if .Values.", cp(1), t".podLabels }}", nl(),
		t"{{ toYaml .Values.", cp(1), t".podLabels | indent 8 }}", nl(),
		t"\t\t{{- end }}", nl(),
		t"\tspec:", nl(),
		t"\t  {{- if .Values.imagePullSecrets }}", nl(),
		t"\t  imagePullSecrets:", nl(),
		t"{{ toYaml .Values.imagePullSecrets | indent 8 }}", nl(),
		t"\t  {{- end }}", nl(),
		t"\t  containers:", nl(),
		t"\t\t- name: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}-{{ .Values.", cp(1), t".name }}", nl(),
		t"\t\t  image: \"{{ .Values.", cp(1), t".image.repository }}:{{ .Values.", cp(1), t".image.tag }}\"", nl(),
		t"\t\t  imagePullPolicy: \"{{ .Values.", cp(1), t".image.pullPolicy }}\"", nl(),
		t"\t\t  args:", nl(),
		t"\t\t  {{- range $key, $value := .Values.", cp(1), t".extraArgs }}", nl(),
		t"\t\t\t{{- if $value }}", nl(),
		t"\t\t\t- --{{ $key }}={{ $value }}", nl(),
		t"\t\t\t{{- else }}", nl(),
		t"\t\t\t- --{{ $key }}", nl(),
		t"\t\t\t{{- end }}", nl(),
		t"\t\t  {{- end }}", nl(),
		t"\t\t  livenessProbe:", nl(),
		t"\t\t\thttpGet:", nl(),
		t"\t\t\t  path: /healthz", nl(),
		t"\t\t\t  port: 8080", nl(),
		t"\t\t\t  scheme: HTTP", nl(),
		t"\t\t\tinitialDelaySeconds: 30", nl(),
		t"\t\t\ttimeoutSeconds: 5", nl(),
		t"\t\t  ports:", nl(),
		t"\t\t\t- name: http", nl(),
		t"\t\t\t  containerPort: 8080", nl(),
		t"\t\t\t  protocol: TCP", nl(),
		t"\t\t  resources:", nl(),
		t"{{ toYaml .Values.", cp(1), t".resources | indent 12 }}", nl(),
		t"\t{{- if .Values.", cp(1), t".nodeSelector }}", nl(),
		t"\t  nodeSelector:", nl(),
		t"{{ toYaml .Values.", cp(1), t".nodeSelector | indent 8 }}", nl(),
		t"\t{{- end }}", nl(),
		t"\t{{- if .Values.", cp(1), t".tolerations }}", nl(),
		t"\t  tolerations:", nl(),
		t"{{ toYaml .Values.", cp(1), t".tolerations | indent 8 }}", nl(),
		t"\t{{- end }}", nl(),
		t"\t{{- if .Values.", cp(1), t".affinity }}", nl(),
		t"\t  affinity:", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".affinity | indent 8 }}", nl(),
		t"\t{{- end }}", nl(),
		t"\t  terminationGracePeriodSeconds: 60", nl(),
		t"{{- end }}"
	}),
	s({trig = "deploy_spec", descr = "(deploy_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".enabled }}", nl(),
		t"apiVersion: extensions/v1beta1", nl(),
		t"kind: Deployment", nl(),
		t"metadata:", nl(),
		t"  labels:", nl(),
		t"\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\tchart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
		t"\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\theritage: {{ .Release.Service }}", nl(),
		t"\trelease: {{ .Release.Name }}", nl(),
		t"  name: {{ template \"", i(2, "chartName", {key = "i2"}), t".", i(1, "value_key", {key = "i1"}), t".fullname\" . }}", nl(),
		t"# spec", nl(),
		t"\t# containers_spec", nl(),
		t"\t# livenessProbe_spec", nl(),
		t"\t# PersistentVolumeClaim_spec", nl(),
		t"\t# initContainers_spec", nl(),
		t"\t# resources_spec", nl(),
		t"\t# nodeselector_spec", nl(),
		t"\t# tolerations_spec", nl(),
		t"\t# affinity_spec", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "spec_spec", descr = "(spec_spec)", priority = -1000, trigEngine = te("w")}, {
		t"spec:", nl(),
		t"  replicas: {{ .Values.", cp(1), t".replicaCount }}", nl(),
		t"  revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}", nl(),
		t"  template:", nl(),
		t"\tmetadata:", nl(),
		t"\t{{- if .Values.", cp(1), t".podAnnotations }}", nl(),
		t"\t  annotations:", nl(),
		t"{{ toYaml .Values.", cp(1), t".podAnnotations | indent 8 }}", nl(),
		t"\t{{- end }}", nl(),
		t"\t  labels:", nl(),
		t"\t\tapp: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}", nl(),
		t"\t\tcomponent: \"{{ .Values.", cp(1), t".name }}\"", nl(),
		t"\t\trelease: {{ .Release.Name }}", nl(),
		t"\t\t{{- if .Values.", cp(1), t".podLabels }}", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".podLabels | indent 8 }}", nl(),
		t"\t\t{{- end }}", nl(),
		t"\tspec:", nl(),
		t"\t  {{- if .Values.imagePullSecrets }}", nl(),
		t"\t  imagePullSecrets:", nl(),
		t"{{ toYaml .Values.imagePullSecrets | indent 8 }}", nl(),
		t"\t  {{- end }}", nl(),
		t"\t  ", i(0, "", {key = "i0"})
	}),
	s({trig = "imagePullSecrets_spec", descr = "(imagePullSecrets_spec)", priority = -1000, trigEngine = te("w")}, {
		t"\t  {{- if .Values.imagePullSecrets }}", nl(),
		t"\t  imagePullSecrets:", nl(),
		t"{{ toYaml .Values.imagePullSecrets | indent 8 }}", nl(),
		t"\t  {{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "imagePullPolicy_spec", descr = "(imagePullPolicy_spec)", priority = -1000, trigEngine = te("w")}, {
		t"imagePullPolicy: ", i(1, "imagePullPolicy", {key = "i1"}), nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "containers_spec", descr = "(containers_spec)", priority = -1000, trigEngine = te("w")}, {
		t"containers:", nl(),
		t"  - name: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}-{{ .Values.", cp(1), t".name }}", nl(),
		t"\timage: \"{{ .Values.", cp(1), t".image.repository }}:{{ .Values.", cp(1), t".image.tag }}\"", nl(),
		t"\timagePullPolicy: \"{{ .Values.", i(1, "value_key", {key = "i1"}), t".image.pullPolicy }}\"", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "args_spec", descr = "(args_spec)", priority = -1000, trigEngine = te("w")}, {
		t"args:", nl(),
		t"{{- range $key, $value := .Values.", i(1, "value_key", {key = "i1"}), t".extraArgs }}", nl(),
		t"  {{- if $value }}", nl(),
		t"  - --{{ $key }}={{ $value }}", nl(),
		t"  {{- else }}", nl(),
		t"  - --{{ $key }}", nl(),
		t"  {{- end }}", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "livenessProbe_spec", descr = "(livenessProbe_spec)", priority = -1000, trigEngine = te("w")}, {
		t"livenessProbe:", nl(),
		t"  httpGet:", nl(),
		t"\tpath: /healthz", nl(),
		t"\tport: 8080", nl(),
		t"\tscheme: HTTP", nl(),
		t"  initialDelaySeconds: 30", nl(),
		t"  timeoutSeconds: 5", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "readinessProbe_spec", descr = "(readinessProbe_spec)", priority = -1000, trigEngine = te("w")}, {
		t"readinessProbe:", nl(),
		t"  httpGet:", nl(),
		t"\tpath: /go/api/v1/health", nl(),
		t"\tport: 8153", nl(),
		t"  initialDelaySeconds: {{ .Values.", i(1, "", {key = "i1"}), t".healthCheck.initialDelaySeconds }}", nl(),
		t"  periodSeconds: {{ .Values.", cp(1), t".healthCheck.periodSeconds }}", nl(),
		t"  failureThreshold: {{ .Values.", cp(1), t".healthCheck.failureThreshold }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "resources_spec", descr = "(resources_spec)", priority = -1000, trigEngine = te("w")}, {
		t"resources:", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".resources | indent 12 }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "nodeselector_spec", descr = "(nodeselector_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".nodeSelector }}", nl(),
		t"  nodeSelector:", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".nodeSelector | indent 8 }}", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "tolerations_spec", descr = "(tolerations_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".tolerations }}", nl(),
		t"  tolerations:", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".tolerations | indent 8 }}", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "affinity_spec", descr = "(affinity_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".affinity }}", nl(),
		t"  affinity:", nl(),
		t"{{ toYaml .Values.", i(1, "value_key", {key = "i1"}), t".affinity | indent 8 }}", nl(),
		t"{{- end }}", nl(),
		t"  terminationGracePeriodSeconds: 60", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "PersistentVolumeClaim_spec", descr = "(PersistentVolumeClaim_spec)", priority = -1000, trigEngine = te("w")}, {
		t"kind: PersistentVolumeClaim", nl(),
		t"apiVersion: v1", nl(),
		t"metadata:", nl(),
		t"  name: {{ template \"", i(2, "", {key = "i2"}), t".", cp(1), t".fullname\" . }}", nl(),
		t"  labels:", nl(),
		t"\tapp: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}", nl(),
		t"\tchart: \"{{ .Chart.Name }}-{{ .Chart.Version }}\"", nl(),
		t"\trelease: \"{{ .Release.Name }}\"", nl(),
		t"\theritage: \"{{ .Release.Service }}\"", nl(),
		t"spec:", nl(),
		t"  accessModes:", nl(),
		t"\t- {{ .Values.", cp(1), t".persistence.accessMode | quote }}", nl(),
		t"  resources:", nl(),
		t"\trequests:", nl(),
		t"\t  storage: {{ .Values.", cp(1), t".persistence.size | quote }}", nl(),
		t"{{- if .Values.", cp(1), t".persistence.storageClass }}", nl(),
		t"{{- if (eq \"-\" .Values.", cp(1), t".persistence.storageClass) }}", nl(),
		t"  storageClassName: \"\"", nl(),
		t"{{- else }}", nl(),
		t"  storageClassName: \"{{ .Values.", i(1, "value_key", {key = "i1"}), t".persistence.storageClass }}\"", nl(),
		t"{{- end }}", nl(),
		t"{{- end }}", nl(),
		t"{{- end }}", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "configMap_spec", descr = "(configMap_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.artifactory.enabled -}}", nl(),
		t"  apiVersion: v1", nl(),
		t"  kind: ConfigMap", nl(),
		t"  metadata:", nl(),
		t"\tname: {{ template \"", i(2, "chartName", {key = "i2"}), t".fullname\" . }}-", i(1, "value_key", {key = "i1"}), t"-config", nl(),
		t"\tlabels:", nl(),
		t"\t  app: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\t  chart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
		t"\t  heritage: {{ .Release.Service }}", nl(),
		t"\t  release: {{ .Release.Name }}", nl(),
		t"  data:", nl(),
		t"\t", i(3, "nameOfConfigFile", {key = "i3"}), t".conf: |", nl(),
		t"\t  # data goes here", nl(),
		t"{{- end -}}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "initContainers_spec", descr = "(initContainers_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if .Values.", cp(1), t".initContainers }}", nl(),
		t"\t  initContainers:", nl(),
		t"\t  - name: wait-workers", nl(),
		t"\t\timage: \"{{ .Values.", cp(1), t".image.repository }}:{{ .Values.", cp(1), t".image.tag }}\"", nl(),
		t"\t\timagePullPolicy: {{ .Values.", i(1, "value_key", {key = "i1"}), t".image.pullPolicy }}", nl(),
		t"\t\t# env", nl(),
		t"\t\tcommand:", nl(),
		t"\t\t  - sh", nl(),
		t"\t\t  - -c", nl(),
		t"\t\t  - |", nl(),
		t"\t\t\tuntil printf \".\" && nc -z -w 2 {{ template \"", i(2, "chartName", {key = "i2"}), t".fullname\" . }} {{ .Values.postgresql.service.port }}; do", nl(),
		t"\t\t\t\tsleep 2;", nl(),
		t"\t\t\tdone;", nl(),
		nl(),
		t"\t\t\techo \'PostgreSQL OK ✓\'", nl(),
		t"\t\t# args", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "pvc_spec", descr = "(pvc_spec)", priority = -1000, trigEngine = te("w")}, {
		t"kind: PersistentVolumeClaim", nl(),
		t"apiVersion: v1", nl(),
		t"metadata:", nl(),
		t"  name: {{ template \"", cp(2), t".fullname\" . }}", nl(),
		t"  labels:", nl(),
		t"\tchart: \"{{ .Chart.Name }}-{{ .Chart.Version }}\"", nl(),
		t"\trelease: \"{{ .Release.Name }}\"", nl(),
		t"\theritage: \"{{ .Release.Service }}\"", nl(),
		t"\tapp: {{ template \"", i(1, "chartName", {key = "i2"}), t".fullname\" . }}", nl(),
		t"spec:", nl(),
		t"  accessModes:", nl(),
		t"\t- {{ .Values.persistence.accessMode | quote }}", nl(),
		t"  resources:", nl(),
		t"\trequests:", nl(),
		t"\t  storage: {{ .Values.persistence.size | quote }}", nl(),
		t"{{- if .Values.persistence.storageClass }}", nl(),
		t"{{- if (eq \"-\" .Values.persistence.storageClass) }}", nl(),
		t"  storageClassName: \"\"", nl(),
		t"{{- else }}", nl(),
		t"  storageClassName: \"{{ .Values.persistence.storageClass }}\"", nl(),
		t"{{- end }}", nl(),
		t"{{- end }}", nl(),
		t"{{- end }}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "pv_nfs_spec", descr = "(pv_nfs_spec)", priority = -1000, trigEngine = te("w")}, {
		t"apiVersion: v1", nl(),
		t"kind: PersistentVolume", nl(),
		t"metadata:", nl(),
		t"  name: {{ template \"", cp(2), t".fullname\" . }}-data-pv", nl(),
		t"  labels:", nl(),
		t"\tapp: {{ template \"", cp(2), t".name\" . }}", nl(),
		t"\tchart: {{ .Chart.Name }}-{{ .Chart.Version }}", nl(),
		t"\theritage: {{ .Release.Service }}", nl(),
		t"\trelease: {{ .Release.Name }}", nl(),
		t"\tid: {{ template \"", i(2, "chartName", {key = "i2"}), t".name\" . }}-data-pv", nl(),
		t"\ttype: nfs-volume", nl(),
		t"spec:", nl(),
		t"  capacity:", nl(),
		t"\tstorage: {{ .Values.", cp(1), t".persistence.nfs.capacity }}", nl(),
		t"  accessModes:", nl(),
		t"  - ReadWriteOnce", nl(),
		t"  persistentVolumeReclaimPolicy: Retain", nl(),
		t"  nfs:", nl(),
		t"\tserver: {{ .Values.", cp(1), t".persistence.nfs.ip }}", nl(),
		t"\tpath: \"{{ .Values.", i(1, "value_key", {key = "i1"}), t".persistence.nfs.haDataMount }}\"", nl(),
		t"\treadOnly: false", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "pvc_hostpath_spec", descr = "(pvc_hostpath_spec)", priority = -1000, trigEngine = te("w")}, {
		t"{{- if and .Values.persistence.enabled .Values.persistence.", cp(1), t".hostPath (not", nl(),
		t".Values.persistence.", cp(1), t".existingClaim) -}}", nl(),
		t"apiVersion: v1", nl(),
		t"kind: PersistentVolume", nl(),
		t"metadata:", nl(),
		t"  name: {{ template \"", i(2, "chartName", {key = "i2"}), t".fullname\" . }}-", cp(1), nl(),
		t"spec:", nl(),
		t"  accessModes:", nl(),
		t"\t- {{ .Values.persistence.", cp(1), t".accessMode | quote }}", nl(),
		t"  capacity:", nl(),
		t"\tstorage: {{ .Values.persistence.", cp(1), t".size | quote }}", nl(),
		t"  hostPath:", nl(),
		t"\tpath: {{ .Values.persistence.", i(1, "value_key", {key = "i1"}), t".hostPath | quote }}", nl(),
		t"{{- end -}}", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "deploy_values", descr = "(deploy_values)", priority = -1000, trigEngine = te("w")}, {
		cp(1), t":", nl(),
		t"  name: ", i(1, "value_key", {key = "i1"}), nl(),
		t"  image:", nl(),
		t"\trepository: ", nl(),
		t"\ttag: ", nl(),
		t"\tpullPolicy: IfNotPresent", nl(),
		t"  hostNetwork: false", nl(),
		t"  dnsPolicy: ClusterFirst", nl(),
		t"  daemonset:", nl(),
		t"\tuseHostPort: false", nl(),
		t"  podLabels: {}", nl(),
		t"  scope:", nl(),
		t"\tenabled: false", nl(),
		t"\tnamespace: \"\"   # defaults to .Release.Namespace", nl(),
		t"  extraArgs: {}", nl(),
		t"  extraEnvs: []", nl(),
		t"  kind: Deployment", nl(),
		t"  updateStrategy: {}", nl(),
		t"  minReadySeconds: 0", nl(),
		t"  tolerations: []", nl(),
		t"  affinity: {}", nl(),
		t"  nodeSelector: {}", nl(),
		t"  podAnnotations: {}", nl(),
		t"  replicaCount: 1", nl(),
		t"  minAvailable: 1", nl(),
		t"  resources: {}", nl(),
		t"  autoscaling:", nl(),
		t"\tenabled: false", nl(),
		t"  extraContainers: {}", nl(),
		t"  extraVolumeMounts: {}", nl(),
		t"  extraVolumes: {}", nl(),
		t"  extraInitContainers: []", nl(),
		t"  lifecycle: {}", nl(),
		t"revisionHistoryLimit: 10", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "rbac_values", descr = "(rbac_values)", priority = -1000, trigEngine = te("w")}, {
		i(1, "value_key", {key = "i1"}), t":", nl(),
		t"rbac:", nl(),
		t"  create: true", nl(),
		t"serviceAccount:", nl(),
		t"  create: true", nl(),
		t"  name:", nl(),
		t"imagePullSecrets: []", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "service_values", descr = "(service_values)", priority = -1000, trigEngine = te("w")}, {
		i(1, "value_key", {key = "i1"}), t":", nl(),
		t"  service:", nl(),
		t"\tannotations: {}", nl(),
		t"\tlabels: {}", nl(),
		t"\tclusterIP: \"\"", nl(),
		t"\texternalIPs: []", nl(),
		t"\tloadBalancerIP: \"\"", nl(),
		t"\tloadBalancerSourceRanges: []", nl(),
		t"\texternalTrafficPolicy: \"\"", nl(),
		t"\thealthCheckNodePort: 0", nl(),
		t"\ttargetPorts:", nl(),
		t"\t  http: http", nl(),
		t"\t  https: https", nl(),
		t"\ttype: LoadBalancer", nl(),
		t"\tnodePorts:", nl(),
		t"\t  http: \"\"", nl(),
		t"\t  https: \"\"", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "readinessProbe_values", descr = "(readinessProbe_values)", priority = -1000, trigEngine = te("w")}, {
		i(1, "value_key", {key = "i1"}), t":", nl(),
		t"  readinessProbe:", nl(),
		t"\tfailureThreshold: 3", nl(),
		t"\tinitialDelaySeconds: 10", nl(),
		t"\tperiodSeconds: 10", nl(),
		t"\tsuccessThreshold: 1", nl(),
		t"\ttimeoutSeconds: 1", nl(),
		t"\tport: 10254", nl(),
		i(0, "", {key = "i0"})
	}),
	s({trig = "livenessProbe_values", descr = "(livenessProbe_values)", priority = -1000, trigEngine = te("w")}, {
		i(1, "value_key", {key = "i1"}), t":", nl(),
		t"  livenessProbe:", nl(),
		t"\tfailureThreshold: 3", nl(),
		t"\tinitialDelaySeconds: 10", nl(),
		t"\tperiodSeconds: 10", nl(),
		t"\tsuccessThreshold: 1", nl(),
		t"\ttimeoutSeconds: 1", nl(),
		t"\tport: 10254", nl(),
		i(0, "", {key = "i0"})
	}),
})
