Skip to content

Commit c5cce3b

Browse files
joshdcuallanger
andauthored
Allow overriding the image tag completely (#83)
See issue #82 for details - Bump Chart major version to 2.0.0 - Add notes on breaking change - Add `v` prefix to Chart `appVersion` as temporary workaround - Remove unnecessary Helm template related to image tag - Completely override image tag using `.Values.image.tag` --------- Co-authored-by: Nikolai Rodionov <[email protected]>
1 parent cee4e69 commit c5cce3b

File tree

7 files changed

+24
-21
lines changed

7 files changed

+24
-21
lines changed

charts/db-operator/Chart.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
apiVersion: v2
22
type: application
33
name: db-operator
4-
version: 1.42.1
4+
version: 2.0.0
5+
56
# ---------------------------------------------------------------------------------
67
# -- All supported k8s versions are in the test:
78
# -- https://github.com/db-operator/charts/blob/main/.github/workflows/test.yaml
89
# ---------------------------------------------------------------------------------
910
kubeVersion: ">= 1.30-prerelease"
10-
appVersion: "2.16.0"
11+
appVersion: "v2.16.0"
1112
description: The DB Operator creates databases and make them available in the cluster via Custom Resource.
1213
home: https://github.com/db-operator/db-operator
1314
maintainers:

charts/db-operator/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ After changing default `Values`, please execute `make gen_docs` to update the `R
170170
If there is an breaking change, or something that might make the upgrade complicated, it should be described here
171171

172172
<details>
173-
<summary>To `v1.11.0`</summary>
173+
<summary>To <code>v2.0.0</code></summary>
174+
From `v2.0.0` onwards, the `v` prefix will not be automatically added to the image tag. If you are overriding the image tag through `.Values.image.tag` and are relying on this behaviour, please add the `v` prefix manually to the Helm value. Otherwise, no action is required from your side!
175+
</details>
176+
177+
<details>
178+
<summary>To <code>v1.11.0</code></summary>
174179
Additional selectors were added to the default templates in an attempt to follow the same labelling scheme everywhere, but since selectors are immutable, the upgrade will require removing of the db-operator deployment.
175180

176181
```bash
@@ -185,7 +190,7 @@ $ helm upgrade db-operator db-operator/db-operator --version 1.11.0
185190
</details>
186191

187192
<details>
188-
<summary>To `v1.10.0`</summary>
193+
<summary>To <code>v1.10.0</code></summary>
189194

190195
CRDs are moved to the `templates` folder, so now they are part of the release. It means that after the upgrade, you will get errors about resource ownerships. Thow errors will contain messages about missing `labels` and `annotations`, and the easiest way to fix it, will be just to add the `metadata` that helm can't find. So you can follow those messages one by one and when all the `CRDs` are patched, you'll be able to install the release.
191196

charts/db-operator/README.md.gotmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ After changing default `Values`, please execute `make gen_docs` to update the `R
9090
If there is an breaking change, or something that might make the upgrade complicated, it should be described here
9191

9292
<details>
93-
<summary>To `v1.11.0`</summary>
93+
<summary>To <code>v2.0.0</code></summary>
94+
From `v2.0.0` onwards, the `v` prefix will not be automatically added to the image tag. If you are overriding the image tag through `.Values.image.tag` and are relying on this behaviour, please add the `v` prefix manually to the Helm value. Otherwise, no action is required from your side!
95+
</details>
96+
97+
<details>
98+
<summary>To <code>v1.11.0</code></summary>
9499
Additional selectors were added to the default templates in an attempt to follow the same labelling scheme everywhere, but since selectors are immutable, the upgrade will require removing of the db-operator deployment.
95100

96101
```bash
@@ -105,7 +110,7 @@ $ helm upgrade db-operator db-operator/db-operator --version 1.11.0
105110
</details>
106111

107112
<details>
108-
<summary>To `v1.10.0`</summary>
113+
<summary>To <code>v1.10.0</code></summary>
109114

110115
CRDs are moved to the `templates` folder, so now they are part of the release. It means that after the upgrade, you will get errors about resource ownerships. Thow errors will contain messages about missing `labels` and `annotations`, and the easiest way to fix it, will be just to add the `metadata` that helm can't find. So you can follow those messages one by one and when all the `CRDs` are patched, you'll be able to install the release.
111116

charts/db-operator/templates/NOTES.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ The Release name {{ .Release.Name }}.
2424
-----------------------------------------------------------------------
2525
Breaking changes and migration paths:
2626

27-
{{ .Chart.Version }} introduces a new status field "operatorVersion"
28-
to the Database CRD. This change is not breaking if your CRDs are
29-
managed by this Helm chart. Otherwise if you're deploying them separately,
30-
please read the migration plan below:
31-
32-
https://github.com/db-operator/charts/tree/main/charts/db-operator#upgrading
27+
From {{ .Chart.Version }}, the "v" prefix will not be
28+
automatically added to the image tag. If you are overriding the image
29+
tag through ".Values.image.tag" and are relying on this behaviour,
30+
please add the "v" prefix manually to the Helm value.
31+
Otherwise, no action is required from your side!
3332

3433
{{- if not .Values.crds.install }}
3534
-----------------------------------------------------------------------

charts/db-operator/templates/_helpers.tpl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,3 @@ Image version definition;
119119
{{- define "image_version" -}}
120120
{{ default .Chart.AppVersion .Values.image.tag }}
121121
{{- end -}}
122-
123-
{{/*
124-
Image version definition using Github Packages format ('v' prefix);
125-
*/}}
126-
{{- define "github_packages_image_version" -}}
127-
{{- printf "v%s" (default .Chart.AppVersion .Values.image.tag) }}
128-
{{- end -}}

charts/db-operator/templates/controller/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
securityContext:
4343
{{- toYaml . | nindent 12 }}
4444
{{- end }}
45-
image: "{{ .Values.image.repository }}:{{ template "github_packages_image_version" . }}"
45+
image: "{{ .Values.image.repository }}:{{ template "image_version" . }}"
4646
ports:
4747
- containerPort: 60000
4848
name: metrics

charts/db-operator/templates/webhook/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
securityContext:
4242
{{- toYaml . | nindent 12 }}
4343
{{- end }}
44-
image: "{{ .Values.image.repository }}:{{ template "github_packages_image_version" . }}"
44+
image: "{{ .Values.image.repository }}:{{ template "image_version" . }}"
4545
ports:
4646
- containerPort: 9443
4747
name: webhook-server

0 commit comments

Comments
 (0)