Skip to content

Commit 6854092

Browse files
committed
api: introduce APIVersion for Snapshot
This will allow the controller to pick the right method for digest calculations when we for example add new data into the calculation. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent 183d816 commit 6854092

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

api/v2beta2/snapshot_types.go

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ import (
2525
// Snapshot captures a point-in-time copy of the status information for a Helm release,
2626
// as managed by the controller.
2727
type Snapshot struct {
28+
// APIVersion is the API version of the Snapshot.
29+
// Provisional: when the calculation method of the Digest field is changed,
30+
// this field will be used to distinguish between the old and new methods.
31+
// +optional
32+
APIVersion string `json:"apiVersion,omitempty"`
2833
// Digest is the checksum of the release object in storage.
2934
// It has the format of `<algo>:<checksum>`.
3035
// +required

config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,12 @@ spec:
18001800
description: Current holds the latest observed Snapshot for the current
18011801
release.
18021802
properties:
1803+
apiVersion:
1804+
description: 'APIVersion is the API version of the Snapshot. Provisional:
1805+
when the calculation method of the Digest field is changed,
1806+
this field will be used to distinguish between the old and new
1807+
methods.'
1808+
type: string
18031809
chartName:
18041810
description: ChartName is the chart name of the release object
18051811
in storage.
@@ -1921,6 +1927,12 @@ spec:
19211927
description: Previous holds the latest observed Snapshot for the previous
19221928
(succesful) release.
19231929
properties:
1930+
apiVersion:
1931+
description: 'APIVersion is the API version of the Snapshot. Provisional:
1932+
when the calculation method of the Digest field is changed,
1933+
this field will be used to distinguish between the old and new
1934+
methods.'
1935+
type: string
19241936
chartName:
19251937
description: ChartName is the chart name of the release object
19261938
in storage.

docs/api/helmrelease.md

+14
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,20 @@ as managed by the controller.</p>
19141914
<tbody>
19151915
<tr>
19161916
<td>
1917+
<code>apiVersion</code><br>
1918+
<em>
1919+
string
1920+
</em>
1921+
</td>
1922+
<td>
1923+
<em>(Optional)</em>
1924+
<p>APIVersion is the API version of the Snapshot.
1925+
Provisional: when the calculation method of the Digest field is changed,
1926+
this field will be used to distinguish between the old and new methods.</p>
1927+
</td>
1928+
</tr>
1929+
<tr>
1930+
<td>
19171931
<code>digest</code><br>
19181932
<em>
19191933
string

0 commit comments

Comments
 (0)