7
7
"github.com/stretchr/testify/require"
8
8
"k8s.io/apimachinery/pkg/runtime"
9
9
10
+ "github.com/mongodb/mongodb-atlas-kubernetes/v2/api"
10
11
"github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1/common"
11
12
"github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/cel"
12
13
)
@@ -28,8 +29,10 @@ func TestIntegrationCELChecks(t *testing.T) {
28
29
Spec : AtlasThirdPartyIntegrationSpec {
29
30
Type : "DATADOG" ,
30
31
Datadog : & DatadogIntegration {
31
- APIKeySecret : "api-key-secretname" ,
32
- Region : "US" ,
32
+ APIKeySecret : api.LocalObjectReference {
33
+ Name : "api-key-secretname" ,
34
+ },
35
+ Region : "US" ,
33
36
},
34
37
},
35
38
},
@@ -40,7 +43,9 @@ func TestIntegrationCELChecks(t *testing.T) {
40
43
Spec : AtlasThirdPartyIntegrationSpec {
41
44
Type : "MICROSOFT_TEAMS" ,
42
45
MicrosoftTeams : & MicrosoftTeamsIntegration {
43
- URLSecret : "url-secretname" ,
46
+ URLSecret : api.LocalObjectReference {
47
+ Name : "url-secretname" ,
48
+ },
44
49
},
45
50
},
46
51
},
@@ -51,7 +56,9 @@ func TestIntegrationCELChecks(t *testing.T) {
51
56
Spec : AtlasThirdPartyIntegrationSpec {
52
57
Type : "NEW_RELIC" ,
53
58
NewRelic : & NewRelicIntegration {
54
- CredentialsSecret : "credentials-secretname" ,
59
+ CredentialsSecret : api.LocalObjectReference {
60
+ Name : "credentials-secretname" ,
61
+ },
55
62
},
56
63
},
57
64
},
@@ -62,8 +69,10 @@ func TestIntegrationCELChecks(t *testing.T) {
62
69
Spec : AtlasThirdPartyIntegrationSpec {
63
70
Type : "OPS_GENIE" ,
64
71
OpsGenie : & OpsGenieIntegration {
65
- APIKeySecret : "api-key-secretname" ,
66
- Region : "US" ,
72
+ APIKeySecret : api.LocalObjectReference {
73
+ Name : "api-key-secretname" ,
74
+ },
75
+ Region : "US" ,
67
76
},
68
77
},
69
78
},
@@ -74,8 +83,10 @@ func TestIntegrationCELChecks(t *testing.T) {
74
83
Spec : AtlasThirdPartyIntegrationSpec {
75
84
Type : "PAGER_DUTY" ,
76
85
PagerDuty : & PagerDutyIntegration {
77
- ServiceKeySecret : "service-key-secretname" ,
78
- Region : "US" ,
86
+ ServiceKeySecret : api.LocalObjectReference {
87
+ Name : "service-key-secretname" ,
88
+ },
89
+ Region : "US" ,
79
90
},
80
91
},
81
92
},
@@ -86,8 +97,10 @@ func TestIntegrationCELChecks(t *testing.T) {
86
97
Spec : AtlasThirdPartyIntegrationSpec {
87
98
Type : "PROMETHEUS" ,
88
99
Prometheus : & PrometheusIntegration {
89
- PrometheusCredentials : "prometheus-credentials" ,
90
- ServiceDiscovery : "http" ,
100
+ PrometheusCredentials : api.LocalObjectReference {
101
+ Name : "prometheus-credentials" ,
102
+ },
103
+ ServiceDiscovery : "http" ,
91
104
},
92
105
},
93
106
},
@@ -98,9 +111,11 @@ func TestIntegrationCELChecks(t *testing.T) {
98
111
Spec : AtlasThirdPartyIntegrationSpec {
99
112
Type : "SLACK" ,
100
113
Slack : & SlackIntegration {
101
- APITokenSecret : "api-tooken-secretname" ,
102
- ChannelName : "channel" ,
103
- TeamName : "team" ,
114
+ APITokenSecret : api.LocalObjectReference {
115
+ Name : "api-tooken-secretname" ,
116
+ },
117
+ ChannelName : "channel" ,
118
+ TeamName : "team" ,
104
119
},
105
120
},
106
121
},
@@ -111,7 +126,9 @@ func TestIntegrationCELChecks(t *testing.T) {
111
126
Spec : AtlasThirdPartyIntegrationSpec {
112
127
Type : "VICTOR_OPS" ,
113
128
VictorOps : & VictorOpsIntegration {
114
- RoutingKey : "routing-key" ,
129
+ RoutingKey : api.LocalObjectReference {
130
+ Name : "routing-key" ,
131
+ },
115
132
APIKeySecret : "keys-secetname" ,
116
133
},
117
134
},
@@ -123,7 +140,9 @@ func TestIntegrationCELChecks(t *testing.T) {
123
140
Spec : AtlasThirdPartyIntegrationSpec {
124
141
Type : "WEBHOOK" ,
125
142
Webhook : & WebhookIntegration {
126
- URLSecret : "url-secretname" ,
143
+ URLSecret : api.LocalObjectReference {
144
+ Name : "url-secretname" ,
145
+ },
127
146
},
128
147
},
129
148
},
@@ -135,8 +154,10 @@ func TestIntegrationCELChecks(t *testing.T) {
135
154
Type : "PAGER_DUTY" ,
136
155
PagerDuty : & PagerDutyIntegration {},
137
156
Prometheus : & PrometheusIntegration {
138
- PrometheusCredentials : "prometheus-credentials" ,
139
- ServiceDiscovery : "http" ,
157
+ PrometheusCredentials : api.LocalObjectReference {
158
+ Name : "prometheus-credentials" ,
159
+ },
160
+ ServiceDiscovery : "http" ,
140
161
},
141
162
},
142
163
},
@@ -148,11 +169,15 @@ func TestIntegrationCELChecks(t *testing.T) {
148
169
Spec : AtlasThirdPartyIntegrationSpec {
149
170
Type : "WEBHOOK" ,
150
171
Datadog : & DatadogIntegration {
151
- APIKeySecret : "api-key-secretname" ,
152
- Region : "US" ,
172
+ APIKeySecret : api.LocalObjectReference {
173
+ Name : "api-key-secretname" ,
174
+ },
175
+ Region : "US" ,
153
176
},
154
177
Webhook : & WebhookIntegration {
155
- URLSecret : "url-secretname" ,
178
+ URLSecret : api.LocalObjectReference {
179
+ Name : "url-secretname" ,
180
+ },
156
181
},
157
182
},
158
183
},
0 commit comments