Skip to content

Commit

Permalink
api: introduce APIVersion in Snapshot
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hiddeco committed Aug 21, 2023
1 parent 183d816 commit 1307041
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v2beta2/snapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import (
// Snapshot captures a point-in-time copy of the status information for a Helm release,
// as managed by the controller.
type Snapshot struct {
// APIVersion is the API version of the Snapshot.
// Provisional: when the calculation method of the Digest field is changed,
// this field will be used to distinguish between the old and new methods.
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Digest is the checksum of the release object in storage.
// It has the format of `<algo>:<checksum>`.
// +required
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,12 @@ spec:
description: Current holds the latest observed Snapshot for the current
release.
properties:
apiVersion:
description: 'APIVersion is the API version of the Snapshot. Provisional:
when the calculation method of the Digest field is changed,
this field will be used to distinguish between the old and new
methods.'
type: string
chartName:
description: ChartName is the chart name of the release object
in storage.
Expand Down Expand Up @@ -1921,6 +1927,12 @@ spec:
description: Previous holds the latest observed Snapshot for the previous
(succesful) release.
properties:
apiVersion:
description: 'APIVersion is the API version of the Snapshot. Provisional:
when the calculation method of the Digest field is changed,
this field will be used to distinguish between the old and new
methods.'
type: string
chartName:
description: ChartName is the chart name of the release object
in storage.
Expand Down
14 changes: 14 additions & 0 deletions docs/api/helmrelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -1914,6 +1914,20 @@ as managed by the controller.</p>
<tbody>
<tr>
<td>
<code>apiVersion</code><br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>APIVersion is the API version of the Snapshot.
Provisional: when the calculation method of the Digest field is changed,
this field will be used to distinguish between the old and new methods.</p>
</td>
</tr>
<tr>
<td>
<code>digest</code><br>
<em>
string
Expand Down

0 comments on commit 1307041

Please sign in to comment.