Skip to content

Commit 6b2fff8

Browse files
Bugfixing 0.2.0 (#4)
Library 0.2.0
1 parent 852902a commit 6b2fff8

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

charts/library/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: library
33
description: Buttahtoast Helm Library
44
type: library
5-
version: 0.1.1
5+
version: 0.2.0
66
appVersion: 0.1.0
77
home: https://github.com/buttahtoast/helm-charts/tree/master/charts/library
88
keywords:

charts/library/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Buttahtoast Library
22

3-
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
3+
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
44

55
This is our take on a library Chart. It contains simple functions which are (will be) used across all of our charts. Feel free the add or improve the existing templates. This Chart is still under development/testing. Feel free to use it, if you find any issues with it, please create an issue/PR. We will try to get bugs fixed as soon as possible!
66

@@ -281,15 +281,15 @@ YAML Structure, String
281281
### Labels
282282
---
283283

284-
This template allows to define common labels. Common labels are appended to the base labels (no merge). By Using this template
285-
the key `.Values.commonLabels` is considered in your value structure. If the key has values and is type `map` the values are used
286-
as common labels.
284+
This template wraps around all the other label templates. Therefor all their functionalities are available with this template. In addition it's possible to pass labels, which overwrite the result of all the label templates.
287285

288286
#### Arguments
289287

290288
If an as required marked argument is missing, the template engine will intentionally.
291289

292-
* `.` - Inherited Root Context (Required). Make sure global variables are accessible through the context.
290+
* `./.context` - Inherited Root Context (Required).
291+
* `.labels` - Labels which overwrite the resulting labels of all the other label templates.
292+
* `.versionUnspecific` - Removes the version label. Useful when you don't want your resource to be changed on version update (Spec Change).
293293

294294
#### Keys
295295

@@ -369,7 +369,7 @@ global:
369369
defaultTag: ""
370370
371371
## Global Docker Image PullPolicy
372-
# global.pullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
372+
# global.imagePullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
373373
imagePullPolicy: ""
374374
375375
## Global StorageClass
@@ -501,7 +501,7 @@ This function enables the following keys on the global scope:
501501
global:
502502
503503
## Global Docker Image PullPolicy
504-
# global.pullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
504+
# global.imagePullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
505505
imagePullPolicy: "Always"
506506
```
507507

charts/library/README.md.gotmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,15 @@ YAML Structure, String
280280
### Labels
281281
---
282282

283-
This template allows to define common labels. Common labels are appended to the base labels (no merge). By Using this template
284-
the key `.Values.commonLabels` is considered in your value structure. If the key has values and is type `map` the values are used
285-
as common labels.
283+
This template wraps around all the other label templates. Therefor all their functionalities are available with this template. In addition it's possible to pass labels, which overwrite the result of all the label templates.
286284

287285
#### Arguments
288286

289287
If an as required marked argument is missing, the template engine will intentionally.
290288

291-
* `.` - Inherited Root Context (Required). Make sure global variables are accessible through the context.
289+
* `./.context` - Inherited Root Context (Required).
290+
* `.labels` - Labels which overwrite the resulting labels of all the other label templates.
291+
* `.versionUnspecific` - Removes the version label. Useful when you don't want your resource to be changed on version update (Spec Change).
292292

293293
#### Keys
294294

@@ -369,7 +369,7 @@ global:
369369
defaultTag: ""
370370

371371
## Global Docker Image PullPolicy
372-
# global.pullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
372+
# global.imagePullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
373373
imagePullPolicy: ""
374374

375375
## Global StorageClass
@@ -503,7 +503,7 @@ This function enables the following keys on the global scope:
503503
global:
504504

505505
## Global Docker Image PullPolicy
506-
# global.pullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
506+
# global.imagePullPolicy -- Global Docker Image Pull Policy declaration. Will overwrite all child .pullPolicy fields.
507507
imagePullPolicy: "Always"
508508
```
509509

charts/library/templates/_common.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
6161
*/}}
6262
{{- define "lib.utils.defaultLabels" -}}
6363
{{- include "lib.utils.selectorLabels" . }}
64-
{{- if .Chart.AppVersion }}
64+
{{- if and .Chart.AppVersion (not .versionunspecific) }}
6565
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
6666
{{- end }}
6767
{{- end -}}
@@ -94,7 +94,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
9494
Sprig Template - Labels
9595
*/}}
9696
{{- define "lib.utils.labels" -}}
97+
{{- $_ := set (default . .context) "versionunspecific" (default false .versionUnspecific ) -}}
9798
{{- toYaml (mergeOverwrite (fromYaml (include "lib.utils.commonLabels" (default . .context))) (default dict .labels)) | indent 0 }}
99+
{{- $_ := unset (default . .context) "versionunspecific" }}
98100
{{- end -}}
99101

100102

charts/library/templates/_lists.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
{{- end }}
1616
{{- end }}
1717
{{- end }}
18-
{{- else }}
19-
{{- fail "Template requires '.value' as argument" }}
2018
{{- end }}
2119
{{- end -}}
2220

@@ -38,8 +36,6 @@
3836
{{- end }}
3937
{{- end }}
4038
{{- end }}
41-
{{- else }}
42-
{{- fail "Template requires '.value' as argument" }}
4339
{{- end }}
4440
{{- end -}}
4541

0 commit comments

Comments
 (0)