Skip to content

Commit 0936633

Browse files
committed
api: ensure backwards compatibility v2beta1
As we are (still) not making use of conversion webhooks, new fields can only be introduced by including them in all served API versions. As otherwise conversion will fail. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent 603d321 commit 0936633

File tree

3 files changed

+118
-0
lines changed

3 files changed

+118
-0
lines changed

api/v2beta1/helmrelease_types.go

+25
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ type HelmReleaseSpec struct {
156156
// +optional
157157
PersistentClient *bool `json:"persistentClient,omitempty"`
158158

159+
// DriftDetection holds the configuration for detecting and handling
160+
// differences between the manifest in the Helm storage and the resources
161+
// currently existing in the cluster.
162+
//
163+
// Note: this field is provisional to the v2beta2 API, and not actively used
164+
// by v2beta1 HelmReleases.
165+
// +optional
166+
DriftDetection *v2beta2.DriftDetection `json:"driftDetection,omitempty"`
167+
159168
// Install holds the configuration for Helm install actions for this HelmRelease.
160169
// +optional
161170
Install *Install `json:"install,omitempty"`
@@ -947,6 +956,22 @@ type HelmReleaseStatus struct {
947956
// by v2beta1 HelmReleases.
948957
// +optional
949958
LastAttemptedReleaseAction string `json:"lastAttemptedReleaseAction,omitempty"`
959+
960+
// LastHandledForceAt holds the value of the most recent force request
961+
// value, so a change of the annotation value can be detected.
962+
//
963+
// Note: this field is provisional to the v2beta2 API, and not actively used
964+
// by v2beta1 HelmReleases.
965+
// +optional
966+
LastHandledForceAt string `json:"lastHandledForceAt,omitempty"`
967+
968+
// LastHandledResetAt holds the value of the most recent reset request
969+
// value, so a change of the annotation value can be detected.
970+
//
971+
// Note: this field is provisional to the v2beta2 API, and not actively used
972+
// by v2beta1 HelmReleases.
973+
// +optional
974+
LastHandledResetAt string `json:"lastHandledResetAt,omitempty"`
950975
}
951976

952977
// GetHelmChart returns the namespace and name of the HelmChart.

api/v2beta1/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+88
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,82 @@ spec:
199199
- name
200200
type: object
201201
type: array
202+
driftDetection:
203+
description: "DriftDetection holds the configuration for detecting
204+
and handling differences between the manifest in the Helm storage
205+
and the resources currently existing in the cluster. \n Note: this
206+
field is provisional to the v2beta2 API, and not actively used by
207+
v2beta1 HelmReleases."
208+
properties:
209+
ignore:
210+
description: Ignore contains a list of rules for specifying which
211+
changes to ignore during diffing.
212+
items:
213+
description: IgnoreRule defines a rule to selectively disregard
214+
specific changes during the drift detection process.
215+
properties:
216+
paths:
217+
description: Paths is a list of JSON Pointer (RFC 6901)
218+
paths to be excluded from consideration in a Kubernetes
219+
object.
220+
items:
221+
type: string
222+
type: array
223+
target:
224+
description: Target is a selector for specifying Kubernetes
225+
objects to which this rule applies. If Target is not set,
226+
the Paths will be ignored for all Kubernetes objects within
227+
the manifest of the Helm release.
228+
properties:
229+
annotationSelector:
230+
description: AnnotationSelector is a string that follows
231+
the label selection expression https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
232+
It matches with the resource annotations.
233+
type: string
234+
group:
235+
description: Group is the API group to select resources
236+
from. Together with Version and Kind it is capable
237+
of unambiguously identifying and/or selecting resources.
238+
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
239+
type: string
240+
kind:
241+
description: Kind of the API Group to select resources
242+
from. Together with Group and Version it is capable
243+
of unambiguously identifying and/or selecting resources.
244+
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
245+
type: string
246+
labelSelector:
247+
description: LabelSelector is a string that follows
248+
the label selection expression https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
249+
It matches with the resource labels.
250+
type: string
251+
name:
252+
description: Name to match resources with.
253+
type: string
254+
namespace:
255+
description: Namespace to select resources from.
256+
type: string
257+
version:
258+
description: Version of the API Group to select resources
259+
from. Together with Group and Kind it is capable of
260+
unambiguously identifying and/or selecting resources.
261+
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
262+
type: string
263+
type: object
264+
required:
265+
- paths
266+
type: object
267+
type: array
268+
mode:
269+
description: Mode defines how differences should be handled between
270+
the Helm manifest and the manifest currently applied to the
271+
cluster. If not explicitly set, it defaults to DiffModeDisabled.
272+
enum:
273+
- enabled
274+
- warn
275+
- disabled
276+
type: string
277+
type: object
202278
install:
203279
description: Install holds the configuration for Helm install actions
204280
for this HelmRelease.
@@ -1011,11 +1087,23 @@ spec:
10111087
description: LastAttemptedValuesChecksum is the SHA1 checksum of the
10121088
values of the last reconciliation attempt.
10131089
type: string
1090+
lastHandledForceAt:
1091+
description: "LastHandledForceAt holds the value of the most recent
1092+
force request value, so a change of the annotation value can be
1093+
detected. \n Note: this field is provisional to the v2beta2 API,
1094+
and not actively used by v2beta1 HelmReleases."
1095+
type: string
10141096
lastHandledReconcileAt:
10151097
description: LastHandledReconcileAt holds the value of the most recent
10161098
reconcile request value, so a change of the annotation value can
10171099
be detected.
10181100
type: string
1101+
lastHandledResetAt:
1102+
description: "LastHandledResetAt holds the value of the most recent
1103+
reset request value, so a change of the annotation value can be
1104+
detected. \n Note: this field is provisional to the v2beta2 API,
1105+
and not actively used by v2beta1 HelmReleases."
1106+
type: string
10191107
lastReleaseRevision:
10201108
description: LastReleaseRevision is the revision of the last successful
10211109
Helm release.

0 commit comments

Comments
 (0)