Change some practice

This commit is contained in:
Marsel Ibraev
2021-09-27 16:59:35 +03:00
parent f44beb51a9
commit f41e7a6611
187 changed files with 33 additions and 72 deletions
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
@@ -0,0 +1,13 @@
apiVersion: v2
name: libchart
description: A Helm chart for Kubernetes
type: library
#
# # This is the chart version. This version number should be incremented each time you make changes
# # to the chart and its templates, including the app version.
version: 0.1.0
#
# # This is the version number of the application being deployed. This version number should be
# # incremented each time you make changes to the application and it is recommended to use it with quotes.
appVersion: "1.16.0"
@@ -0,0 +1,10 @@
{{- define "libchart.configmap.tpl" -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name | printf "%s-%s" .Chart.Name }}
data: {}
{{- end -}}
{{- define "libchart.configmap" -}}
{{- include "libchart.util.merge" (append . "libchart.configmap.tpl") -}}
{{- end -}}
@@ -0,0 +1,13 @@
{{- /*
libchart.util.merge will merge two YAML templates and output the result.
This takes an array of three values:
- the top context
- the template name of the overrides (destination)
- the template name of the base (source)
*/}}
{{- define "libchart.util.merge" -}}
{{- $top := first . -}}
{{- $overrides := fromYaml (include (index . 1) $top) | default (dict ) -}}
{{- $tpl := fromYaml (include (index . 2) $top) | default (dict ) -}}
{{- toYaml (merge $overrides $tpl) -}}
{{- end -}}