Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply review comments
Browse files Browse the repository at this point in the history
jbartosik committed Jan 27, 2025
1 parent 2027122 commit 8685f5e
Showing 6 changed files with 111 additions and 123 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -87,6 +87,6 @@ resources:
domain: com
group: datadoghq
kind: DatadogPodAutoscaler
path: github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1
path: github.com/DataDog/datadog-operator/api/datadoghq/v1alpha2
version: v2alpha1
version: "3"
2 changes: 1 addition & 1 deletion api/datadoghq/v1alpha1/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ type DatadogPodAutoscalerPolicy struct {
// - All: Apply all recommendations (regular and manual).
// - Manual: Apply only manual recommendations (recommendations manually validated by user in the Datadog app).
// - None: Prevent the controller to apply any recommendations.
// It's also possible to selectively deactivate upscale, downscale or update actions thanks to the `Upscale`, `Downscale` and `Update` fields.
// It's also possible to selectively deactivate upscale, downscale or update actions thanks to the `ScaleUp`, `ScaleDown` and `Update` fields.
// +optional
// +kubebuilder:default=All
ApplyMode DatadogPodAutoscalerApplyMode `json:"applyMode"`
Original file line number Diff line number Diff line change
@@ -3,13 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package v2alpha1
package v1alpha2

import (
autoscalingv2 "k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
)

// spec:
@@ -115,22 +117,21 @@ const (
// DatadogPodAutoscalerActuation defines how recommendations should be applied.
type DatadogPodAutoscalerActuation struct {
// Mode determines recommendations that should be applied by the controller:
// - All: Apply all recommendations (regular and manual).
// - Manual: Apply only manual recommendations (recommendations manually validated by user in the Datadog app).
// - All: Apply all recommendations.
// - None: Prevent the controller to apply any recommendations.
// It's also possible to selectively deactivate upscale, downscale or update actions thanks to the `Upscale`, `Downscale` and `Update` fields.
// 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:"applyMode"`
Mode DatadogPodAutoscalerActuationMode `json:"mode"`

// Update defines the policy to update target resource.
Update *DatadogPodAutoscalerUpdatePolicy `json:"update,omitempty"`

// Upscale defines the policy to scale up the target resource.
Upscale *DatadogPodAutoscalerScalingPolicy `json:"upscale,omitempty"`
// ScaleUp defines the policy to scale up the target resource.
ScaleUp *DatadogPodAutoscalerScalingPolicy `json:"scaleup,omitempty"`

// Downscale defines the policy to scale down the target resource.
Downscale *DatadogPodAutoscalerScalingPolicy `json:"downscale,omitempty"`
// ScaleDown defines the policy to scale down the target resource.
ScaleDown *DatadogPodAutoscalerScalingPolicy `json:"scaledown,omitempty"`
}

// DatadogPodAutoscalerUpdateStrategy defines the mode of the update policy.
@@ -556,5 +557,5 @@ type DatadogPodAutoscalerList struct {
}

func init() {
SchemeBuilder.Register(&DatadogPodAutoscaler{}, &DatadogPodAutoscalerList{})
v2alpha1.SchemeBuilder.Register(&DatadogPodAutoscaler{}, &DatadogPodAutoscalerList{})
}
194 changes: 98 additions & 96 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -13,9 +13,3 @@ resources:
# - metrics_reader_role.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization# For each CRD, "Editor" and "Viewer" roles are scaffolded by
# default, aiding admins in cluster management. Those roles are
# not used by the Project itself. You can comment the following lines
# if you do not want those helpers be installed with your Project.
- datadoghq_datadogpodautoscaler_editor_role.yaml
- datadoghq_datadogpodautoscaler_viewer_role.yaml

9 changes: 0 additions & 9 deletions config/samples/datadoghq_v2alpha1_datadogpodautoscaler.yaml

This file was deleted.

0 comments on commit 8685f5e

Please sign in to comment.