Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jbartosik committed Jan 29, 2025
1 parent c0e8fcd commit eb18115
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
30 changes: 15 additions & 15 deletions api/datadoghq/v1alpha2/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// name: test
// owner: local
// remoteVersion: 1
// actuation:
// applyPolicy:
// mode: Apply | Preview
// update:
// strategy: Auto|Disabled
Expand Down Expand Up @@ -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"
)

Expand All @@ -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.
Expand All @@ -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"`
Expand Down
14 changes: 7 additions & 7 deletions api/datadoghq/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit eb18115

Please sign in to comment.