Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't default datadog aggregator #3643

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading