Skip to content

Commit

Permalink
Adjust chart so that it will work with version updater
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman committed Apr 13, 2023
1 parent d95f858 commit 3efbe07
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
4 changes: 2 additions & 2 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: logstash-exporter
description: Prometheus exporter for Logstash written in Go
type: application
version: v1.0.2
appVersion: 1.0.2
version: "1.0.2"
appVersion: "1.0.2"
12 changes: 6 additions & 6 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

### Image settings

| Name | Description | Value |
| ------------------ | ---------------------------------- | ---------------------------- |
| `image.repository` | Image repository | `kuskoman/logstash-exporter` |
| `image.tag` | Image tag | `v1.0.2` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `fullnameOverride` | Override the fullname of the chart | `""` |
| Name | Description | Value |
| ------------------ | -------------------------------------------- | ---------------------------- |
| `image.repository` | Image repository | `kuskoman/logstash-exporter` |
| `image.tag` | Image tag, if not set the appVersion is used | `""` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `fullnameOverride` | Override the fullname of the chart | `""` |

### Deployment settings

Expand Down
4 changes: 2 additions & 2 deletions chart/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
},
"tag": {
"type": "string",
"description": "Image tag",
"default": "v1.0.2"
"description": "Image tag, if not set the appVersion is used",
"default": ""
},
"pullPolicy": {
"type": "string",
Expand Down
14 changes: 13 additions & 1 deletion chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@ If release name contains chart name it will be used as a full name.
{{- printf "%s" .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "logstash-exporter.serviceAccountName" -}}
{{/*
By default we want service account name to be the same as fullname
but this may change in the future, so for easier usage this is extracted
to a separate template.
*/}}
{{- define "logstash-exporter.serviceAccountName" -}}
{{- include "logstash-exporter.fullname" . }}
{{- end -}}

{{/*
logstash-exporter.imageTag is a named template that returns the image tag.
It checks if .Values.image.tag is provided, and if not, it returns a tag with "v" prefix followed by the app version from the Chart.yaml.
*/}}
{{- define "logstash-exporter.imageTag" -}}
{{- if .Values.image.tag -}}
{{- .Values.image.tag -}}
{{- else -}}
{{- printf "v%s" .Chart.AppVersion -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
valueFrom:
{{- toYaml $value | nindent 14 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
image: "{{ .Values.image.repository }}:{{ include "logstash-exporter.imageTag" $ }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}

{{- if .Values.deployment.resources }}
Expand Down
4 changes: 2 additions & 2 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ image:
## @param image.repository Image repository
##
repository: "kuskoman/logstash-exporter"
## @param image.tag Image tag
## @param image.tag Image tag, if not set the appVersion is used
##
tag: "v1.0.2"
tag: ""
## @param image.pullPolicy Image pull policy
## Options: Always, Never, IfNotPresent
##
Expand Down

0 comments on commit 3efbe07

Please sign in to comment.