From eb181158f2357e597678275eb07e9c5e4981ba45 Mon Sep 17 00:00:00 2001 From: Joachim Bartosik Date: Wed, 29 Jan 2025 11:26:24 +0000 Subject: [PATCH] Update --- .../v1alpha2/datadogpodautoscaler_types.go | 30 +++++++++---------- .../v1alpha2/zz_generated.deepcopy.go | 14 ++++----- .../datadoghq.com_datadogpodautoscalers.yaml | 4 +-- ...hq.com_datadogpodautoscalers_v1alpha2.json | 4 +-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/api/datadoghq/v1alpha2/datadogpodautoscaler_types.go b/api/datadoghq/v1alpha2/datadogpodautoscaler_types.go index e47df5ef2..754344604 100644 --- a/api/datadoghq/v1alpha2/datadogpodautoscaler_types.go +++ b/api/datadoghq/v1alpha2/datadogpodautoscaler_types.go @@ -19,7 +19,7 @@ import ( // name: test // owner: local // remoteVersion: 1 -// actuation: +// applyPolicy: // mode: Apply | Preview // update: // strategy: Auto|Disabled @@ -68,7 +68,7 @@ const ( // DatadogPodAutoscalerLocalOwner states that this `DatadogPodAutoscaler` object is created/managed outside of Datadog app. DatadogPodAutoscalerLocalOwner DatadogPodAutoscalerOwner = "Local" - // DatadogPodAutoscalerLocalOwner states that this `DatadogPodAutoscaler` object is created/managed in Datadog app. + // DatadogPodAutoscalerRemoteOwner states that this `DatadogPodAutoscaler` object is created/managed in Datadog app. DatadogPodAutoscalerRemoteOwner DatadogPodAutoscalerOwner = "Remote" ) @@ -85,10 +85,10 @@ type DatadogPodAutoscalerSpec struct { // Only set if the owner is Remote. RemoteVersion *uint64 `json:"remoteVersion,omitempty"` - // Actuation defines how recommendations should be applied. + // ApplyPolicy defines how recommendations should be applied. // +optional // +kubebuilder:default={} - Actuation *DatadogPodAutoscalerActuation `json:"actuation,omitempty"` + ApplyPolicy *DatadogPodAutoscalerApplyPolicy `json:"applyPolicy,omitempty"` // Objectives are objectives to reach and maintain for the target resource. // Default to a single target to maintain 80% POD CPU utilization. @@ -100,27 +100,27 @@ type DatadogPodAutoscalerSpec struct { Constraints *DatadogPodAutoscalerConstraints `json:"constraints,omitempty"` } -// DatadogPodAutoscalerOwner defines the source of truth for this object (local or remote) -// +kubebuilder:validation:Enum:=All;Manual;None -type DatadogPodAutoscalerActuationMode string +// DatadogPodAutoscalerApplyMode specifies if the controller should apply recommendations. +// +kubebuilder:validation:Enum:=Apply;Preview +type DatadogPodAutoscalerApplyMode string const ( // DatadogPodAutoscalerApplyApplyMode allows the controller to apply all recommendations (regular and manual) - DatadogPodAutoscalerApplyApplyMode DatadogPodAutoscalerActuationMode = "Apply" + DatadogPodAutoscalerApplyModeApply DatadogPodAutoscalerApplyMode = "Apply" // DatadogPodAutoscalerPreviewApplyMode doesn't allow the controller to apply any recommendations - DatadogPodAutoscalerPreviewApplyMode DatadogPodAutoscalerActuationMode = "Preview" + DatadogPodAutoscalerApplyModePreview DatadogPodAutoscalerApplyMode = "Preview" ) -// DatadogPodAutoscalerActuation defines how recommendations should be applied. -type DatadogPodAutoscalerActuation struct { +// DatadogPodAutoscalerApplyPolicy defines how recommendations should be applied. +type DatadogPodAutoscalerApplyPolicy struct { // Mode determines recommendations that should be applied by the controller: - // - All: Apply all recommendations. - // - None: Prevent the controller to apply any recommendations. + // - Apply: Apply all recommendations. + // - Preview: Prevent the controller to apply any recommendations. // It's also possible to selectively deactivate upscale, downscale or update actions thanks to the `ScaleUp`, `ScaleDown` and `Update` fields. // +optional - // +kubebuilder:default=All - Mode DatadogPodAutoscalerActuationMode `json:"mode"` + // +kubebuilder:default=Apply + Mode DatadogPodAutoscalerApplyMode `json:"mode"` // Update defines the policy to update target resource. Update *DatadogPodAutoscalerUpdatePolicy `json:"update,omitempty"` diff --git a/api/datadoghq/v1alpha2/zz_generated.deepcopy.go b/api/datadoghq/v1alpha2/zz_generated.deepcopy.go index 7b1818858..351fdf936 100644 --- a/api/datadoghq/v1alpha2/zz_generated.deepcopy.go +++ b/api/datadoghq/v1alpha2/zz_generated.deepcopy.go @@ -42,7 +42,7 @@ func (in *DatadogPodAutoscaler) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DatadogPodAutoscalerActuation) DeepCopyInto(out *DatadogPodAutoscalerActuation) { +func (in *DatadogPodAutoscalerApplyPolicy) DeepCopyInto(out *DatadogPodAutoscalerApplyPolicy) { *out = *in if in.Update != nil { in, out := &in.Update, &out.Update @@ -61,12 +61,12 @@ func (in *DatadogPodAutoscalerActuation) DeepCopyInto(out *DatadogPodAutoscalerA } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatadogPodAutoscalerActuation. -func (in *DatadogPodAutoscalerActuation) DeepCopy() *DatadogPodAutoscalerActuation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatadogPodAutoscalerApplyPolicy. +func (in *DatadogPodAutoscalerApplyPolicy) DeepCopy() *DatadogPodAutoscalerApplyPolicy { if in == nil { return nil } - out := new(DatadogPodAutoscalerActuation) + out := new(DatadogPodAutoscalerApplyPolicy) in.DeepCopyInto(out) return out } @@ -404,9 +404,9 @@ func (in *DatadogPodAutoscalerSpec) DeepCopyInto(out *DatadogPodAutoscalerSpec) *out = new(uint64) **out = **in } - if in.Actuation != nil { - in, out := &in.Actuation, &out.Actuation - *out = new(DatadogPodAutoscalerActuation) + if in.ApplyPolicy != nil { + in, out := &in.ApplyPolicy, &out.ApplyPolicy + *out = new(DatadogPodAutoscalerApplyPolicy) (*in).DeepCopyInto(*out) } if in.Objectives != nil { diff --git a/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml b/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml index 2671c2da8..f4114f6ee 100644 --- a/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml +++ b/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml @@ -679,9 +679,9 @@ spec: spec: description: DatadogPodAutoscalerSpec defines the desired state of DatadogPodAutoscaler properties: - actuation: + applypolicy: default: {} - description: Actuation defines how recommendations should be applied. + description: ApplyPolicy defines how recommendations should be applied. properties: mode: default: All diff --git a/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers_v1alpha2.json b/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers_v1alpha2.json index b91d0da81..f131d6250 100644 --- a/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers_v1alpha2.json +++ b/config/crd/bases/v1/datadoghq.com_datadogpodautoscalers_v1alpha2.json @@ -17,10 +17,10 @@ "additionalProperties": false, "description": "DatadogPodAutoscalerSpec defines the desired state of DatadogPodAutoscaler", "properties": { - "actuation": { + "applypolicy": { "additionalProperties": false, "default": {}, - "description": "Actuation defines how recommendations should be applied.", + "description": "ApplyPolicy defines how recommendations should be applied.", "properties": { "mode": { "default": "All",