@@ -32,8 +32,8 @@ import (
3232 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3333)
3434
35- func GetDefaultWatcherSpec () map [string ]interface {} {
36- return map [string ]interface {} {
35+ func GetDefaultWatcherSpec () map [string ]any {
36+ return map [string ]any {
3737 "databaseInstance" : "openstack" ,
3838 "secret" : SecretName ,
3939 }
@@ -97,36 +97,36 @@ func CreateInternalTopLevelSecretQuorum() *corev1.Secret {
9797}
9898
9999// Second Watcher Spec to test proper parameters substitution
100- func GetNonDefaultWatcherSpec () map [string ]interface {} {
101- return map [string ]interface {} {
100+ func GetNonDefaultWatcherSpec () map [string ]any {
101+ return map [string ]any {
102102 "apiContainerImageURL" : "fake-API-Container-URL" ,
103103 "secret" : SecretName ,
104104 "preserveJobs" : true ,
105105 "databaseInstance" : "fakeopenstack" ,
106106 "serviceUser" : "fakeuser" ,
107107 "customServiceConfig" : "# Global config" ,
108- "apiServiceTemplate" : map [string ]interface {} {
108+ "apiServiceTemplate" : map [string ]any {
109109 "replicas" : 2 ,
110110 "nodeSelector" : map [string ]string {"foo" : "bar" },
111111 "customServiceConfig" : "# Service config" ,
112- "tls" : map [string ]interface {} {
112+ "tls" : map [string ]any {
113113 "caBundleSecretName" : "combined-ca-bundle" ,
114114 },
115115 },
116116 "prometheusSecret" : "custom-prometheus-config" ,
117117 "applierContainerImageURL" : "fake-Applier-Container-URL" ,
118- "applierServiceTemplate" : map [string ]interface {} {
118+ "applierServiceTemplate" : map [string ]any {
119119 "replicas" : 1 ,
120120 "nodeSelector" : map [string ]string {"foo" : "bar" },
121121 "customServiceConfig" : "# Service config Applier" ,
122122 },
123123 "decisionengineContainerImageURL" : "fake-DecisionEngine-Container-URL" ,
124- "decisionengineServiceTemplate" : map [string ]interface {} {
124+ "decisionengineServiceTemplate" : map [string ]any {
125125 "replicas" : 1 ,
126126 "nodeSelector" : map [string ]string {"foo" : "bar" },
127127 "customServiceConfig" : "# Service config DecisionEngine" ,
128128 },
129- "dbPurge" : map [string ]interface {} {
129+ "dbPurge" : map [string ]any {
130130 "schedule" : "1 2 * * *" ,
131131 "purgeAge" : 1 ,
132132 },
@@ -135,14 +135,14 @@ func GetNonDefaultWatcherSpec() map[string]interface{} {
135135}
136136
137137// Watcher Spec to test TLSe
138- func GetTLSeWatcherSpec () map [string ]interface {} {
139- return map [string ]interface {} {
138+ func GetTLSeWatcherSpec () map [string ]any {
139+ return map [string ]any {
140140 "secret" : SecretName ,
141141 "databaseInstance" : "openstack" ,
142- "apiServiceTemplate" : map [string ]interface {} {
143- "tls" : map [string ]interface {} {
142+ "apiServiceTemplate" : map [string ]any {
143+ "tls" : map [string ]any {
144144 "caBundleSecretName" : "combined-ca-bundle" ,
145- "api" : map [string ]interface {} {
145+ "api" : map [string ]any {
146146 "internal" : map [string ]string {
147147 "secretName" : "cert-watcher-internal-svc" ,
148148 },
@@ -155,26 +155,26 @@ func GetTLSeWatcherSpec() map[string]interface{} {
155155 }
156156}
157157
158- func GetTLSIngressWatcherSpec () map [string ]interface {} {
159- return map [string ]interface {} {
158+ func GetTLSIngressWatcherSpec () map [string ]any {
159+ return map [string ]any {
160160 "secret" : SecretName ,
161161 "databaseInstance" : "openstack" ,
162- "apiServiceTemplate" : map [string ]interface {} {
163- "tls" : map [string ]interface {} {
162+ "apiServiceTemplate" : map [string ]any {
163+ "tls" : map [string ]any {
164164 "caBundleSecretName" : "combined-ca-bundle" ,
165165 },
166166 },
167167 }
168168}
169169
170- func GetTLSPodLevelWatcherSpec () map [string ]interface {} {
171- return map [string ]interface {} {
170+ func GetTLSPodLevelWatcherSpec () map [string ]any {
171+ return map [string ]any {
172172 "secret" : SecretName ,
173173 "databaseInstance" : "openstack" ,
174- "apiServiceTemplate" : map [string ]interface {} {
175- "tls" : map [string ]interface {} {
174+ "apiServiceTemplate" : map [string ]any {
175+ "tls" : map [string ]any {
176176 "caBundleSecretName" : "combined-ca-bundle" ,
177- "api" : map [string ]interface {} {
177+ "api" : map [string ]any {
178178 "internal" : map [string ]string {
179179 "secretName" : "cert-watcher-internal-svc" ,
180180 },
@@ -187,8 +187,8 @@ func GetTLSPodLevelWatcherSpec() map[string]interface{} {
187187 }
188188}
189189
190- func GetDefaultWatcherAPISpec () map [string ]interface {} {
191- return map [string ]interface {} {
190+ func GetDefaultWatcherAPISpec () map [string ]any {
191+ return map [string ]any {
192192 "databaseInstance" : "openstack" ,
193193 "secret" : SecretName ,
194194 "memcachedInstance" : "memcached" ,
@@ -197,14 +197,14 @@ func GetDefaultWatcherAPISpec() map[string]interface{} {
197197 }
198198}
199199
200- func GetTLSWatcherAPISpec () map [string ]interface {} {
201- return map [string ]interface {} {
200+ func GetTLSWatcherAPISpec () map [string ]any {
201+ return map [string ]any {
202202 "databaseInstance" : "openstack" ,
203203 "secret" : SecretName ,
204204 "containerImage" : "test://watcher" ,
205- "tls" : map [string ]interface {} {
205+ "tls" : map [string ]any {
206206 "caBundleSecretName" : "combined-ca-bundle" ,
207- "api" : map [string ]interface {} {
207+ "api" : map [string ]any {
208208 "internal" : map [string ]string {
209209 "secretName" : "cert-watcher-internal-svc" ,
210210 },
@@ -216,35 +216,35 @@ func GetTLSWatcherAPISpec() map[string]interface{} {
216216 }
217217
218218}
219- func GetTLSCaWatcherAPISpec () map [string ]interface {} {
220- return map [string ]interface {} {
219+ func GetTLSCaWatcherAPISpec () map [string ]any {
220+ return map [string ]any {
221221 "databaseInstance" : "openstack" ,
222222 "secret" : SecretName ,
223223 "containerImage" : "test://watcher" ,
224- "tls" : map [string ]interface {} {
224+ "tls" : map [string ]any {
225225 "caBundleSecretName" : "combined-ca-bundle" ,
226226 },
227227 }
228228}
229229
230- func GetServiceOverrideWatcherAPISpec () map [string ]interface {} {
231- return map [string ]interface {} {
230+ func GetServiceOverrideWatcherAPISpec () map [string ]any {
231+ return map [string ]any {
232232 "databaseInstance" : "openstack" ,
233233 "secret" : SecretName ,
234234 "memcachedInstance" : "memcached" ,
235235 "serviceAccount" : "watcher-sa" ,
236236 "containerImage" : "test://watcher" ,
237- "override" : map [string ]interface {} {
238- "service" : map [string ]interface {} {
239- "internal" : map [string ]interface {} {
240- "metadata" : map [string ]interface {} {
237+ "override" : map [string ]any {
238+ "service" : map [string ]any {
239+ "internal" : map [string ]any {
240+ "metadata" : map [string ]any {
241241 "annotations" : map [string ]string {
242242 "metallb.universe.tf/address-pool" : "osp-internalapi" ,
243243 "metallb.universe.tf/loadBalancerIPs" : "internal-lb-ip-1,internal-lb-ip-2" ,
244244 "metallb.universe.tf/allow-shared-ip" : "osp-internalapi" ,
245245 },
246246 },
247- "spec" : map [string ]interface {} {
247+ "spec" : map [string ]any {
248248 "type" : "LoadBalancer" ,
249249 },
250250 },
@@ -253,8 +253,8 @@ func GetServiceOverrideWatcherAPISpec() map[string]interface{} {
253253 }
254254}
255255
256- func GetDefaultWatcherApplierSpec () map [string ]interface {} {
257- return map [string ]interface {} {
256+ func GetDefaultWatcherApplierSpec () map [string ]any {
257+ return map [string ]any {
258258 "databaseInstance" : "openstack" ,
259259 "secret" : SecretName ,
260260 "memcachedInstance" : "memcached" ,
@@ -263,8 +263,8 @@ func GetDefaultWatcherApplierSpec() map[string]interface{} {
263263 }
264264}
265265
266- func GetDefaultWatcherDecisionEngineSpec () map [string ]interface {} {
267- return map [string ]interface {} {
266+ func GetDefaultWatcherDecisionEngineSpec () map [string ]any {
267+ return map [string ]any {
268268 "databaseInstance" : "openstack" ,
269269 "secret" : SecretName ,
270270 "memcachedInstance" : "memcached" ,
@@ -273,11 +273,11 @@ func GetDefaultWatcherDecisionEngineSpec() map[string]interface{} {
273273 }
274274}
275275
276- func CreateWatcher (name types.NamespacedName , spec map [string ]interface {} ) client.Object {
277- raw := map [string ]interface {} {
276+ func CreateWatcher (name types.NamespacedName , spec map [string ]any ) client.Object {
277+ raw := map [string ]any {
278278 "apiVersion" : "watcher.openstack.org/v1beta1" ,
279279 "kind" : "Watcher" ,
280- "metadata" : map [string ]interface {} {
280+ "metadata" : map [string ]any {
281281 "name" : name .Name ,
282282 "namespace" : name .Namespace ,
283283 },
@@ -299,11 +299,11 @@ func WatcherConditionGetter(name types.NamespacedName) condition.Conditions {
299299 return instance .Status .Conditions
300300}
301301
302- func CreateWatcherAPI (name types.NamespacedName , spec map [string ]interface {} ) client.Object {
303- raw := map [string ]interface {} {
302+ func CreateWatcherAPI (name types.NamespacedName , spec map [string ]any ) client.Object {
303+ raw := map [string ]any {
304304 "apiVersion" : "watcher.openstack.org/v1beta1" ,
305305 "kind" : "WatcherAPI" ,
306- "metadata" : map [string ]interface {} {
306+ "metadata" : map [string ]any {
307307 "name" : name .Name ,
308308 "namespace" : name .Namespace ,
309309 },
@@ -325,11 +325,11 @@ func WatcherAPIConditionGetter(name types.NamespacedName) condition.Conditions {
325325 return instance .Status .Conditions
326326}
327327
328- func CreateWatcherApplier (name types.NamespacedName , spec map [string ]interface {} ) client.Object {
329- raw := map [string ]interface {} {
328+ func CreateWatcherApplier (name types.NamespacedName , spec map [string ]any ) client.Object {
329+ raw := map [string ]any {
330330 "apiVersion" : "watcher.openstack.org/v1beta1" ,
331331 "kind" : "WatcherApplier" ,
332- "metadata" : map [string ]interface {} {
332+ "metadata" : map [string ]any {
333333 "name" : name .Name ,
334334 "namespace" : name .Namespace ,
335335 },
@@ -360,18 +360,18 @@ func CreateWatcherMessageBusSecret(namespace string, name string) *corev1.Secret
360360 s := th .CreateSecret (
361361 types.NamespacedName {Namespace : namespace , Name : name },
362362 map [string ][]byte {
363- "transport_url" : [] byte ( fmt .Sprintf ( "rabbit://%s/fake" , name ) ),
363+ "transport_url" : fmt .Appendf ( nil , "rabbit://%s/fake" , name ),
364364 },
365365 )
366366 logger .Info ("Secret created" , "name" , name )
367367 return s
368368}
369369
370- func CreateWatcherDecisionEngine (name types.NamespacedName , spec map [string ]interface {} ) client.Object {
371- raw := map [string ]interface {} {
370+ func CreateWatcherDecisionEngine (name types.NamespacedName , spec map [string ]any ) client.Object {
371+ raw := map [string ]any {
372372 "apiVersion" : "watcher.openstack.org/v1beta1" ,
373373 "kind" : "WatcherDecisionEngine" ,
374- "metadata" : map [string ]interface {} {
374+ "metadata" : map [string ]any {
375375 "name" : name .Name ,
376376 "namespace" : name .Namespace ,
377377 },
@@ -422,16 +422,16 @@ func CreateCertSecret(name types.NamespacedName) *corev1.Secret {
422422// test Watcher components. It returns both the user input representation
423423// in the form of map[string]string, and the Golang expected representation
424424// used in the test asserts.
425- func GetSampleTopologySpec (label string ) (map [string ]interface {} , []corev1.TopologySpreadConstraint ) {
425+ func GetSampleTopologySpec (label string ) (map [string ]any , []corev1.TopologySpreadConstraint ) {
426426 // Build the topology Spec yaml representation
427- topologySpec := map [string ]interface {} {
428- "topologySpreadConstraints" : []map [string ]interface {} {
427+ topologySpec := map [string ]any {
428+ "topologySpreadConstraints" : []map [string ]any {
429429 {
430430 "maxSkew" : 1 ,
431431 "topologyKey" : corev1 .LabelHostname ,
432432 "whenUnsatisfiable" : "ScheduleAnyway" ,
433- "labelSelector" : map [string ]interface {} {
434- "matchLabels" : map [string ]interface {} {
433+ "labelSelector" : map [string ]any {
434+ "matchLabels" : map [string ]any {
435435 "service" : label ,
436436 },
437437 },
0 commit comments