Skip to content

Commit 52fa6f0

Browse files
committed
Fix flag types
1 parent 6abd7b0 commit 52fa6f0

4 files changed

+41
-23
lines changed

api/v1/atlasintegration_types.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,18 @@ type DatadogIntegration struct {
104104
// +kubebuilder:validation:Required
105105
Region string `json:"region"`
106106

107-
// SendCollectionLatencyMetrics flags whether or not to send collection latency metrics
108-
// +kubebuilder:validation:Required
109-
SendCollectionLatencyMetrics bool `json:"sendCollectionLatencyMetrics"`
107+
// SendCollectionLatencyMetrics toggles sending collection latency metrics
108+
// +kubebuilder:validation:Optional
109+
// +kubebuilder:validation:Enum=enabled;disabled
110+
// +kubebuilder:default:=disabled
111+
SendCollectionLatencyMetrics *string `json:"sendCollectionLatencyMetrics"`
110112

111-
// SendDatabaseMetrics flags whether or not to send database metrics
112-
// +kubebuilder:validation:Required
113-
SendDatabaseMetrics bool `json:"sendDatabaseMetrics"`
113+
// SendDatabaseMetrics toggles sending database metrics,
114+
// including database and collection names
115+
// +kubebuilder:validation:Optional
116+
// +kubebuilder:validation:Enum=enabled;disabled
117+
// +kubebuilder:default:=disabled
118+
SendDatabaseMetrics *string `json:"sendDatabaseMetrics"`
114119
}
115120

116121
type MicrosoftTeamsIntegration struct {

api/v1/atlasintegration_types_test.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ func TestIntegrationCELChecks(t *testing.T) {
2828
Spec: AtlasThirdPartyIntegrationSpec{
2929
Type: "DATADOG",
3030
Datadog: &DatadogIntegration{
31-
APIKeySecret: "api-key-secretname",
32-
Region: "US",
33-
SendCollectionLatencyMetrics: false,
34-
SendDatabaseMetrics: false,
31+
APIKeySecret: "api-key-secretname",
32+
Region: "US",
3533
},
3634
},
3735
},
@@ -151,10 +149,8 @@ func TestIntegrationCELChecks(t *testing.T) {
151149
Spec: AtlasThirdPartyIntegrationSpec{
152150
Type: "WEBHOOK",
153151
Datadog: &DatadogIntegration{
154-
APIKeySecret: "api-key-secretname",
155-
Region: "US",
156-
SendCollectionLatencyMetrics: false,
157-
SendDatabaseMetrics: false,
152+
APIKeySecret: "api-key-secretname",
153+
Region: "US",
158154
},
159155
Webhook: &WebhookIntegration{
160156
URLSecret: "url-secretname",

api/v1/zz_generated.deepcopy.go

+11-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/atlas.mongodb.com_atlasthirdpartyintegrations.yaml

+15-8
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,25 @@ spec:
6464
description: Region is the Datadog region
6565
type: string
6666
sendCollectionLatencyMetrics:
67-
description: SendCollectionLatencyMetrics flags whether or not
68-
to send collection latency metrics
69-
type: boolean
67+
default: disabled
68+
description: SendCollectionLatencyMetrics toggles sending collection
69+
latency metrics
70+
enum:
71+
- enabled
72+
- disabled
73+
type: string
7074
sendDatabaseMetrics:
71-
description: SendDatabaseMetrics flags whether or not to send
72-
database metrics
73-
type: boolean
75+
default: disabled
76+
description: |-
77+
SendDatabaseMetrics toggles sending database metrics,
78+
including database and collection names
79+
enum:
80+
- enabled
81+
- disabled
82+
type: string
7483
required:
7584
- apiKeySecret
7685
- region
77-
- sendCollectionLatencyMetrics
78-
- sendDatabaseMetrics
7986
type: object
8087
externalProjectRef:
8188
description: |-

0 commit comments

Comments
 (0)