From 7f5eea0a2e1280cbd9da934eeb0340a2d1d88a5c Mon Sep 17 00:00:00 2001 From: Sunny Date: Wed, 13 Dec 2023 09:29:04 +0000 Subject: [PATCH] Add .spec.interval in v1beta3 Provider For backwards compatibility with v1beta2 Provider, add .spec.interval with deprecation marker. Interval was an optional field in v1beta2 with internal default. Only the users who had explicitly set intervals would have encountered this incompatibility error after upgrade. Signed-off-by: Sunny --- api/v1beta3/provider_types.go | 9 ++++++ api/v1beta3/zz_generated.deepcopy.go | 5 ++++ ...ification.toolkit.fluxcd.io_providers.yaml | 5 ++++ docs/api/v1beta3/notification.md | 30 +++++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/api/v1beta3/provider_types.go b/api/v1beta3/provider_types.go index f449631..23e4ace 100644 --- a/api/v1beta3/provider_types.go +++ b/api/v1beta3/provider_types.go @@ -61,6 +61,15 @@ type ProviderSpec struct { // +required Type string `json:"type"` + // Interval at which to reconcile the Provider with its Secret references. + // Deprecated and not used in v1beta3. + // + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$" + // +optional + // +deprecated + Interval *metav1.Duration `json:"interval,omitempty"` + // Channel specifies the destination channel where events should be posted. // +kubebuilder:validation:MaxLength:=2048 // +optional diff --git a/api/v1beta3/zz_generated.deepcopy.go b/api/v1beta3/zz_generated.deepcopy.go index 8fe5985..ced9cac 100644 --- a/api/v1beta3/zz_generated.deepcopy.go +++ b/api/v1beta3/zz_generated.deepcopy.go @@ -187,6 +187,11 @@ func (in *ProviderList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { *out = *in + if in.Interval != nil { + in, out := &in.Interval, &out.Interval + *out = new(metav1.Duration) + **out = **in + } if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout *out = new(metav1.Duration) diff --git a/config/crd/bases/notification.toolkit.fluxcd.io_providers.yaml b/config/crd/bases/notification.toolkit.fluxcd.io_providers.yaml index 49c2101..5b7645c 100644 --- a/config/crd/bases/notification.toolkit.fluxcd.io_providers.yaml +++ b/config/crd/bases/notification.toolkit.fluxcd.io_providers.yaml @@ -457,6 +457,11 @@ spec: should be posted. maxLength: 2048 type: string + interval: + description: Interval at which to reconcile the Provider with its + Secret references. Deprecated and not used in v1beta3. + pattern: ^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$ + type: string proxy: description: Proxy the HTTP/S address of the proxy server. maxLength: 2048 diff --git a/docs/api/v1beta3/notification.md b/docs/api/v1beta3/notification.md index 2534fe2..cb972e6 100644 --- a/docs/api/v1beta3/notification.md +++ b/docs/api/v1beta3/notification.md @@ -254,6 +254,21 @@ string +interval
+ + +Kubernetes meta/v1.Duration + + + + +(Optional) +

Interval at which to reconcile the Provider with its Secret references. +Deprecated and not used in v1beta3.

+ + + + channel
string @@ -527,6 +542,21 @@ string +interval
+ + +Kubernetes meta/v1.Duration + + + + +(Optional) +

Interval at which to reconcile the Provider with its Secret references. +Deprecated and not used in v1beta3.

+ + + + channel
string