From 1307041c998e20018095b92c0e3a1f66a2b87c54 Mon Sep 17 00:00:00 2001
From: Hidde Beydals
Date: Tue, 22 Aug 2023 00:58:31 +0200
Subject: [PATCH] api: introduce `APIVersion` in `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
---
api/v2beta2/snapshot_types.go | 5 +++++
.../bases/helm.toolkit.fluxcd.io_helmreleases.yaml | 12 ++++++++++++
docs/api/helmrelease.md | 14 ++++++++++++++
3 files changed, 31 insertions(+)
diff --git a/api/v2beta2/snapshot_types.go b/api/v2beta2/snapshot_types.go
index c274c2885..4dfe8a5ba 100644
--- a/api/v2beta2/snapshot_types.go
+++ b/api/v2beta2/snapshot_types.go
@@ -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 `:`.
// +required
diff --git a/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml b/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
index d73e918c8..656d1d3e0 100644
--- a/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
+++ b/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
@@ -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.
@@ -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.
diff --git a/docs/api/helmrelease.md b/docs/api/helmrelease.md
index df0eb109e..31a91a1a1 100644
--- a/docs/api/helmrelease.md
+++ b/docs/api/helmrelease.md
@@ -1914,6 +1914,20 @@ as managed by the controller.
+apiVersion
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
digest
string
|