diff --git a/README.md b/README.md index 560c008..40510c9 100644 --- a/README.md +++ b/README.md @@ -695,12 +695,12 @@ gitea: ### Image -| Parameter | Description | Default | -| ------------------ | ----------------------------------------------------------------------------------------- | ------------- | -| `image.repository` | Image to start for this pod | `gitea/gitea` | -| `image.tag` | [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | `1.16.2` | -| `image.pullPolicy` | Image pull policy | `Always` | -| `image.rootless` | Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher | `false` | +| Parameter | Description | Default | +| ------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------- | +| `image.repository` | Image to start for this pod | `gitea/gitea` | +| `image.tag` | [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated) | see [Chart.AppVersion](Chart.yaml) | +| `image.pullPolicy` | Image pull policy | `Always` | +| `image.rootless` | Wether or not to pull the rootless version of Gitea, only works on Gitea 1.14.x or higher | `false` | ### Persistence diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index e7d98ea..40471ee 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -36,7 +36,7 @@ Create image name and tag used by the deployment. */}} {{- define "gitea.image" -}} {{- $name := .Values.image.repository -}} -{{- $tag := ternary .Values.image.version .Values.image.tag (hasKey .Values.image "version") -}} +{{- $tag := .Values.image.tag | default .Chart.AppVersion -}} {{- $rootless := ternary "-rootless" "" (.Values.image.rootless) -}} {{- printf "%s:%s%s" $name $tag $rootless -}} {{- end -}} @@ -48,10 +48,8 @@ Common labels helm.sh/chart: {{ include "gitea.chart" . }} app: {{ include "gitea.name" . }} {{ include "gitea.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }} +version: {{ .Values.image.tag | default .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} diff --git a/values.yaml b/values.yaml index 55dc82a..702e4d5 100644 --- a/values.yaml +++ b/values.yaml @@ -8,7 +8,8 @@ clusterDomain: cluster.local image: repository: gitea/gitea - tag: 1.16.2 + # Overrides the image tag whose default is the chart appVersion. + tag: "" pullPolicy: Always rootless: false # only possible when running 1.14 or later