Skip to content

Commit

Permalink
fix: don't default datadog aggregator (#3643)
Browse files Browse the repository at this point in the history
* fix: don't default datadog aggregator

Signed-off-by: Zach Aller <[email protected]>

* codegen

Signed-off-by: Zach Aller <[email protected]>

* fix: don't default datadog aggregator

Signed-off-by: Zach Aller <[email protected]>

---------

Signed-off-by: Zach Aller <[email protected]>
  • Loading branch information
zachaller committed Jun 17, 2024
1 parent 0e304fb commit e472955
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 21 deletions.
3 changes: 0 additions & 3 deletions docs/features/kustomize/rollout_cr_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@
"datadog": {
"properties": {
"aggregator": {
"default": "last",
"enum": [
"avg",
"min",
Expand Down Expand Up @@ -5082,7 +5081,6 @@
"datadog": {
"properties": {
"aggregator": {
"default": "last",
"enum": [
"avg",
"min",
Expand Down Expand Up @@ -9933,7 +9931,6 @@
"datadog": {
"properties": {
"aggregator": {
"default": "last",
"enum": [
"avg",
"min",
Expand Down
1 change: 0 additions & 1 deletion manifests/crds/analysis-run-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ spec:
datadog:
properties:
aggregator:
default: last
enum:
- avg
- min
Expand Down
1 change: 0 additions & 1 deletion manifests/crds/analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ spec:
datadog:
properties:
aggregator:
default: last
enum:
- avg
- min
Expand Down
1 change: 0 additions & 1 deletion manifests/crds/cluster-analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ spec:
datadog:
properties:
aggregator:
default: last
enum:
- avg
- min
Expand Down
3 changes: 0 additions & 3 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ spec:
datadog:
properties:
aggregator:
default: last
enum:
- avg
- min
Expand Down Expand Up @@ -3470,7 +3469,6 @@ spec:
datadog:
properties:
aggregator:
default: last
enum:
- avg
- min
Expand Down Expand Up @@ -6638,7 +6636,6 @@ spec:
datadog:
properties:
aggregator:
default: last
enum:
- avg
- min
Expand Down
6 changes: 0 additions & 6 deletions metricproviders/datadog/datadog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ func TestDatadogSpecDefaults(t *testing.T) {
assert.Equal(t, "\"l2norm\"", string(aggregatorEnums[7].Raw), "\"l2norm\" expected, got %s", string(aggregatorEnums[7].Raw))
assert.Equal(t, "\"area\"", string(aggregatorEnums[8].Raw), "\"area\" expected, got %s", string(aggregatorEnums[8].Raw))
})

t.Run("aggregator: Validate default is last", func(t *testing.T) {
defaultAggregator := string(ddSpec.Properties["aggregator"].Default.Raw)
assert.Equal(t, "\"last\"", defaultAggregator, "Default aggregator should be \"last\" ")
})

}

func TestValidateIncomingProps(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiclient/rollout/rollout.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@
},
"aggregator": {
"type": "string",
"title": "+kubebuilder:default=\"last\"\n+kubebuilder:validation:Enum=avg;min;max;sum;last;percentile;mean;l2norm;area\nAggregator is a type of aggregator to use for metrics-based queries (default: last). Used for v2"
"title": "+kubebuilder:validation:Enum=avg;min;max;sum;last;percentile;mean;l2norm;area\nAggregator is a type of aggregator to use for metrics-based queries (default: \"\"). Used for v2"
}
}
},
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/rollouts/v1alpha1/analysis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,7 @@ type DatadogMetric struct {
// +kubebuilder:validation:Enum=v1;v2
// +kubebuilder:default=v1
ApiVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"`
// +kubebuilder:default="last"
// +kubebuilder:validation:Enum=avg;min;max;sum;last;percentile;mean;l2norm;area
// Aggregator is a type of aggregator to use for metrics-based queries (default: last). Used for v2
// Aggregator is a type of aggregator to use for metrics-based queries (default: ""). Used for v2
Aggregator string `json:"aggregator,omitempty" protobuf:"bytes,6,opt,name=aggregator"`
}
3 changes: 1 addition & 2 deletions pkg/apis/rollouts/v1alpha1/generated.proto

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

2 changes: 1 addition & 1 deletion pkg/apis/rollouts/v1alpha1/openapi_generated.go

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

0 comments on commit e472955

Please sign in to comment.