Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ 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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.1.2
8 changes: 4 additions & 4 deletions templates/_images.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Return the proper image name.
If image tag and digest are not defined, termination fallbacks to chart appVersion.
{{ include "comet-common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" .Values.global "chart" .Chart ) }}
{{ include "comet-common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" .Values.global "chart" .Chart ) }}
*/}}
{{- define "comet-common.images.image" -}}
{{- $registryName := default .imageRoot.registry ((.global).imageRegistry) -}}
Expand All @@ -27,7 +27,7 @@ If image tag and digest are not defined, termination fallbacks to chart appVersi

{{/*
Return the proper Docker Image Registry Secret Names (deprecated: use comet-common.images.renderPullSecrets instead)
{{ include "comet-common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
{{ include "comet-common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
*/}}
{{- define "comet-common.images.pullSecrets" -}}
{{- $pullSecrets := list }}
Expand Down Expand Up @@ -60,7 +60,7 @@ imagePullSecrets:

{{/*
Return the proper Docker Image Registry Secret Names evaluating values as templates
{{ include "comet-common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
{{ include "comet-common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
*/}}
{{- define "comet-common.images.renderPullSecrets" -}}
{{- $pullSecrets := list }}
Expand Down Expand Up @@ -94,7 +94,7 @@ imagePullSecrets:

{{/*
Return the proper image version (ingores image revision/prerelease info & fallbacks to chart appVersion)
{{ include "comet-common.images.version" ( dict "imageRoot" .Values.path.to.the.image "chart" .Chart ) }}
{{ include "comet-common.images.version" ( dict "imageRoot" .Values.path.to.the.image "chart" .Chart ) }}
*/}}
{{- define "comet-common.images.version" -}}
{{- $imageTag := .imageRoot.tag | toString -}}
Expand Down
14 changes: 7 additions & 7 deletions templates/_labels.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{/*
Component label

{{ include "comet-common.labels.component" . -}}
{{ include "comet-common.labels.component" (dict "componentName" .Values.componentName "context" $) -}}
{{ include "comet-common.labels.component" . -}}
{{ include "comet-common.labels.component" (dict "componentName" .Values.componentName "context" $) -}}
*/}}
{{- define "comet-common.labels.component" -}}
{{- if not (empty .componentName) -}}
Expand All @@ -15,7 +15,7 @@ app.kubernetes.io/component: {{ include "comet-common.names.name" (ternary .cont
{{/*
Kubernetes base labels

{{ include "comet-common.labels.base" (dict "customLabels" .Values.commonLabels "context" $) -}}
{{ include "comet-common.labels.base" (dict "customLabels" .Values.commonLabels "context" $) -}}
*/}}
{{- define "comet-common.labels.base" -}}
{{- if and (hasKey . "customLabels") (hasKey . "context") -}}
Expand All @@ -38,9 +38,9 @@ app.kubernetes.io/version: {{ . | replace "+" "_" | quote }}
{{/*
Common labels

{{ include "comet-common.labels" . -}}
{{ include "comet-common.labels" . -}}
or
{{ include "comet-common.labels" (dict "componentName" .Values.componentName "customLabels" .Values.commonLabels "context" $) -}}
{{ include "comet-common.labels" (dict "componentName" .Values.componentName "customLabels" .Values.commonLabels "context" $) -}}
*/}}
{{- define "comet-common.labels" -}}
{{ include "comet-common.labels.base" . }}
Expand All @@ -50,9 +50,9 @@ or
{{/*
Selector labels

{{ include "comet-common.selectorLabels" . -}}
{{ include "comet-common.selectorLabels" . -}}
or
{{ include "comet-common.selectorLabels" (dict "componentName" .Values.componentName "customLabels" .Values.commonLabels "context" $) -}}
{{ include "comet-common.selectorLabels" (dict "componentName" .Values.componentName "customLabels" .Values.commonLabels "context" $) -}}
*/}}
{{- define "comet-common.selectorLabels" -}}
{{- if and (hasKey . "customLabels") (hasKey . "context") -}}
Expand Down
8 changes: 4 additions & 4 deletions templates/_tplvals.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Renders a value that contains template perhaps with scope if the scope is present.

Usage:
{{ include "comet-common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
{{ include "comet-common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
{{ include "comet-common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
{{ include "comet-common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
*/}}
{{- define "comet-common.tplvalues.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
Expand All @@ -23,7 +23,7 @@ Merge a list of values that contains template after rendering them.
Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge

Usage:
{{ include "comet-common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
{{ include "comet-common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
*/}}
{{- define "comet-common.tplvalues.merge" -}}
{{- $dst := dict -}}
Expand All @@ -38,7 +38,7 @@ Render single values or values within collections like dict or list.
If dict or list contains nested collections/structures, it will recurse into
them.

{{ include "comet-common.tplvalues.saferender" (dict "value" .Values.image "context" $) }}
{{ include "comet-common.tplvalues.saferender" (dict "value" .Values.image "context" $) }}
*/}}
{{- define "comet-common.tplvalues.saferender" -}}
{{- $value := .value -}}
Expand Down