@@ -67,19 +67,19 @@ func GlanceAPIConditionGetter(name types.NamespacedName) condition.Conditions {
6767}
6868
6969func CreateDefaultGlance (name types.NamespacedName ) client.Object {
70- raw := map [string ]interface {} {
70+ raw := map [string ]any {
7171 "apiVersion" : "glance.openstack.org/v1beta1" ,
7272 "kind" : "Glance" ,
73- "metadata" : map [string ]interface {} {
73+ "metadata" : map [string ]any {
7474 "name" : name .Name ,
7575 "namespace" : name .Namespace ,
7676 },
77- "spec" : map [string ]interface {} {
77+ "spec" : map [string ]any {
7878 "memcachedInstance" : "memcached" ,
7979 "keystoneEndpoint" : "default" ,
8080 "databaseInstance" : "openstack" ,
8181 "databaseAccount" : glanceTest .GlanceDatabaseAccount .Name ,
82- "storage" : map [string ]interface {} {
82+ "storage" : map [string ]any {
8383 "storageRequest" : glanceTest .GlancePVCSize ,
8484 },
8585 "glanceAPIs" : GetAPIList (),
@@ -90,44 +90,44 @@ func CreateDefaultGlance(name types.NamespacedName) client.Object {
9090
9191// GetGlanceEmptySpec - the resulting map is usually assigned to the top-level
9292// Glance spec
93- func GetGlanceEmptySpec () map [string ]interface {} {
94- return map [string ]interface {} {
93+ func GetGlanceEmptySpec () map [string ]any {
94+ return map [string ]any {
9595 "keystoneEndpoint" : "default" ,
9696 "notificationBusInstance" : glanceTest .NotificationsBusInstance ,
9797 "secret" : SecretName ,
9898 "databaseInstance" : "openstack" ,
99- "storage" : map [string ]interface {} {
99+ "storage" : map [string ]any {
100100 "storageRequest" : glanceTest .GlancePVCSize ,
101101 },
102- "glanceAPIs" : map [string ]interface {} {},
102+ "glanceAPIs" : map [string ]any {},
103103 }
104104}
105105
106- func GetGlanceDefaultSpec () map [string ]interface {} {
107- return map [string ]interface {} {
106+ func GetGlanceDefaultSpec () map [string ]any {
107+ return map [string ]any {
108108 "keystoneEndpoint" : "default" ,
109109 "databaseInstance" : "openstack" ,
110110 "databaseAccount" : glanceTest .GlanceDatabaseAccount .Name ,
111111 "serviceUser" : glanceName .Name ,
112112 "secret" : SecretName ,
113113 "notificationBusInstance" : glanceTest .NotificationsBusInstance ,
114114 "glanceAPIs" : GetAPIList (),
115- "storage" : map [string ]interface {} {
115+ "storage" : map [string ]any {
116116 "storageRequest" : glanceTest .GlancePVCSize ,
117117 },
118118 }
119119}
120120
121- func GetGlanceDefaultSpecWithQuota () map [string ]interface {} {
122- return map [string ]interface {} {
121+ func GetGlanceDefaultSpecWithQuota () map [string ]any {
122+ return map [string ]any {
123123 "keystoneEndpoint" : "default" ,
124124 "databaseInstance" : "openstack" ,
125125 "databaseAccount" : glanceTest .GlanceDatabaseAccount .Name ,
126126 "serviceUser" : glanceName .Name ,
127127 "notificationBusInstance" : glanceTest .NotificationsBusInstance ,
128128 "secret" : SecretName ,
129129 "glanceAPIs" : GetAPIList (),
130- "storage" : map [string ]interface {} {
130+ "storage" : map [string ]any {
131131 "storageRequest" : glanceTest .GlancePVCSize ,
132132 },
133133 "quotas" : glanceTest .GlanceQuotas ,
@@ -136,29 +136,29 @@ func GetGlanceDefaultSpecWithQuota() map[string]interface{} {
136136}
137137
138138// By default we're splitting here
139- func GetAPIList () map [string ]interface {} {
140- apiList := map [string ]interface {} {
139+ func GetAPIList () map [string ]any {
140+ apiList := map [string ]any {
141141 "default" : GetDefaultGlanceAPISpec (GlanceAPITypeSingle ),
142142 }
143143 return apiList
144144}
145145
146- func GetGlanceAPIDefaultSpec () map [string ]interface {} {
147- return map [string ]interface {} {
146+ func GetGlanceAPIDefaultSpec () map [string ]any {
147+ return map [string ]any {
148148 "replicas" : 1 ,
149- "storage" : map [string ]interface {} {
149+ "storage" : map [string ]any {
150150 "storageRequest" : glanceTest .GlancePVCSize ,
151151 },
152152 "databaseAccount" : glanceTest .GlanceDatabaseAccount .Name ,
153153 }
154154}
155155
156- func CreateGlance (name types.NamespacedName , spec map [string ]interface {} ) client.Object {
156+ func CreateGlance (name types.NamespacedName , spec map [string ]any ) client.Object {
157157
158- raw := map [string ]interface {} {
158+ raw := map [string ]any {
159159 "apiVersion" : "glance.openstack.org/v1beta1" ,
160160 "kind" : "Glance" ,
161- "metadata" : map [string ]interface {} {
161+ "metadata" : map [string ]any {
162162 "name" : name .Name ,
163163 "namespace" : name .Namespace ,
164164 },
@@ -167,12 +167,12 @@ func CreateGlance(name types.NamespacedName, spec map[string]interface{}) client
167167 return th .CreateUnstructured (raw )
168168}
169169
170- func CreateGlanceAPI (name types.NamespacedName , spec map [string ]interface {} ) client.Object {
171- raw := map [string ]interface {} {
170+ func CreateGlanceAPI (name types.NamespacedName , spec map [string ]any ) client.Object {
171+ raw := map [string ]any {
172172 "apiVersion" : "glance.openstack.org/v1beta1" ,
173173 "kind" : "GlanceAPI" ,
174- "metadata" : map [string ]interface {} {
175- "annotations" : map [string ]interface {} {
174+ "metadata" : map [string ]any {
175+ "annotations" : map [string ]any {
176176 "keystoneEndpoint" : "true" ,
177177 },
178178 "name" : name .Name ,
@@ -194,27 +194,27 @@ func CreateGlanceSecret(namespace string, name string) *corev1.Secret {
194194}
195195
196196// GetDefaultGlanceSpec - It returns a default API built for testing purposes
197- func GetDefaultGlanceSpec () map [string ]interface {} {
198- return map [string ]interface {} {
197+ func GetDefaultGlanceSpec () map [string ]any {
198+ return map [string ]any {
199199 "databaseInstance" : glanceTest .GlanceDatabaseName .Name ,
200200 "databaseAccount" : glanceTest .GlanceDatabaseAccount .Name ,
201201 "secret" : SecretName ,
202202 "customServiceConfig" : GlanceDummyBackend ,
203203 "notificationBusInstance" : glanceTest .NotificationsBusInstance ,
204204 "glanceAPIs" : GetAPIList (),
205- "storage" : map [string ]interface {} {
205+ "storage" : map [string ]any {
206206 "storageRequest" : glanceTest .GlancePVCSize ,
207207 },
208208 }
209209}
210210
211211// CreateGlanceAPISpec -
212- func CreateGlanceAPISpec (apiType APIType ) map [string ]interface {} {
213- spec := map [string ]interface {} {
212+ func CreateGlanceAPISpec (apiType APIType ) map [string ]any {
213+ spec := map [string ]any {
214214 "replicas" : 1 ,
215215 "serviceAccount" : glanceTest .GlanceSA .Name ,
216216 "containerImage" : glanceTest .ContainerImage ,
217- "storage" : map [string ]interface {} {
217+ "storage" : map [string ]any {
218218 "storageRequest" : glanceTest .GlancePVCSize ,
219219 },
220220 "apiType" : apiType ,
@@ -230,16 +230,16 @@ func CreateGlanceAPISpec(apiType APIType) map[string]interface{} {
230230// CreateGlanceAPIWithTopologySpec - It returns a GlanceAPISpec where a
231231// topology is referenced. It also overrides the top-level parameter of
232232// the top-level glance controller
233- func CreateGlanceAPIWithTopologySpec () map [string ]interface {} {
233+ func CreateGlanceAPIWithTopologySpec () map [string ]any {
234234 rawSpec := GetDefaultGlanceSpec ()
235235 // Add top-level topologyRef
236- rawSpec ["topologyRef" ] = map [string ]interface {} {
236+ rawSpec ["topologyRef" ] = map [string ]any {
237237 "name" : glanceTest .GlanceAPITopologies [0 ].Name ,
238238 }
239239 // Override topologyRef for the subCR
240- rawSpec ["glanceAPIs" ] = map [string ]interface {} {
241- "default" : map [string ]interface {} {
242- "topologyRef" : map [string ]interface {} {
240+ rawSpec ["glanceAPIs" ] = map [string ]any {
241+ "default" : map [string ]any {
242+ "topologyRef" : map [string ]any {
243243 "name" : glanceTest .GlanceAPITopologies [1 ].Name ,
244244 },
245245 },
@@ -248,12 +248,12 @@ func CreateGlanceAPIWithTopologySpec() map[string]interface{} {
248248}
249249
250250// GetDefaultGlanceAPISpec -
251- func GetDefaultGlanceAPISpec (apiType APIType ) map [string ]interface {} {
252- spec := map [string ]interface {} {
251+ func GetDefaultGlanceAPISpec (apiType APIType ) map [string ]any {
252+ spec := map [string ]any {
253253 "replicas" : 1 ,
254254 "containerImage" : glanceTest .ContainerImage ,
255255 "serviceAccount" : glanceTest .GlanceSA .Name ,
256- "storage" : map [string ]interface {} {
256+ "storage" : map [string ]any {
257257 "storageRequest" : glanceTest .GlancePVCSize ,
258258 },
259259 "type" : apiType ,
@@ -267,19 +267,19 @@ func GetDefaultGlanceAPISpec(apiType APIType) map[string]interface{} {
267267}
268268
269269// GetTLSGlanceAPISpec -
270- func GetTLSGlanceAPISpec (apiType APIType ) map [string ]interface {} {
270+ func GetTLSGlanceAPISpec (apiType APIType ) map [string ]any {
271271 spec := CreateGlanceAPISpec (apiType )
272- maps .Copy (spec , map [string ]interface {} {
272+ maps .Copy (spec , map [string ]any {
273273 "databaseHostname" : "openstack" ,
274274 "databaseAccount" : glanceTest .GlanceDatabaseAccount .Name ,
275275 "secret" : SecretName ,
276276 "notificationBusInstance" : glanceTest .NotificationsBusInstance ,
277- "tls" : map [string ]interface {} {
278- "api" : map [string ]interface {} {
279- "internal" : map [string ]interface {} {
277+ "tls" : map [string ]any {
278+ "api" : map [string ]any {
279+ "internal" : map [string ]any {
280280 "secretName" : InternalCertSecretName ,
281281 },
282- "public" : map [string ]interface {} {
282+ "public" : map [string ]any {
283283 "secretName" : PublicCertSecretName ,
284284 },
285285 },
@@ -346,26 +346,26 @@ func GetDummyBackend() string {
346346
347347// GetExtraMounts - Utility function that simulates extraMounts pointing
348348// to a Ceph secret
349- func GetExtraMounts () []map [string ]interface {} {
350- return []map [string ]interface {} {
349+ func GetExtraMounts () []map [string ]any {
350+ return []map [string ]any {
351351 {
352352 "name" : glanceTest .Instance .Name ,
353353 "region" : "az0" ,
354- "extraVol" : []map [string ]interface {} {
354+ "extraVol" : []map [string ]any {
355355 {
356356 "extraVolType" : GlanceCephExtraMountsSecretName ,
357357 "propagation" : []string {
358358 "GlanceAPI" ,
359359 },
360- "volumes" : []map [string ]interface {} {
360+ "volumes" : []map [string ]any {
361361 {
362362 "name" : GlanceCephExtraMountsSecretName ,
363- "secret" : map [string ]interface {} {
363+ "secret" : map [string ]any {
364364 "secretName" : GlanceCephExtraMountsSecretName ,
365365 },
366366 },
367367 },
368- "mounts" : []map [string ]interface {} {
368+ "mounts" : []map [string ]any {
369369 {
370370 "name" : GlanceCephExtraMountsSecretName ,
371371 "mountPath" : GlanceCephExtraMountsPath ,
@@ -389,16 +389,16 @@ func GetExtraMounts() []map[string]interface{} {
389389// multi AZ, which is not applicable in this context
390390func GetSampleTopologySpec (
391391 label string ,
392- ) (map [string ]interface {} , []corev1.TopologySpreadConstraint ) {
392+ ) (map [string ]any , []corev1.TopologySpreadConstraint ) {
393393 // Build the topology Spec
394- topologySpec := map [string ]interface {} {
395- "topologySpreadConstraints" : []map [string ]interface {} {
394+ topologySpec := map [string ]any {
395+ "topologySpreadConstraints" : []map [string ]any {
396396 {
397397 "maxSkew" : 1 ,
398398 "topologyKey" : corev1 .LabelHostname ,
399399 "whenUnsatisfiable" : "ScheduleAnyway" ,
400- "labelSelector" : map [string ]interface {} {
401- "matchLabels" : map [string ]interface {} {
400+ "labelSelector" : map [string ]any {
401+ "matchLabels" : map [string ]any {
402402 "component" : label ,
403403 },
404404 },
@@ -424,10 +424,10 @@ func GetSampleTopologySpec(
424424// CreateDefaultCinderInstance - Creates a default Cinder CR used as a
425425// dependency when a Cinder backend is defined in glance
426426func CreateDefaultCinderInstance (cinderName types.NamespacedName ) client.Object {
427- raw := map [string ]interface {} {
427+ raw := map [string ]any {
428428 "apiVersion" : "cinder.openstack.org/v1beta1" ,
429429 "kind" : "Cinder" ,
430- "metadata" : map [string ]interface {} {
430+ "metadata" : map [string ]any {
431431 "name" : cinderName .Name ,
432432 "namespace" : cinderName .Namespace ,
433433 },
@@ -440,7 +440,7 @@ func CreateGlanceMessageBusSecret(namespace string, name string) *corev1.Secret
440440 s := th .CreateSecret (
441441 types.NamespacedName {Namespace : namespace , Name : name },
442442 map [string ][]byte {
443- "transport_url" : [] byte ( fmt .Sprintf ( "rabbit://%s/fake" , name ) ),
443+ "transport_url" : fmt .Appendf ( nil , "rabbit://%s/fake" , name ),
444444 },
445445 )
446446 logger .Info ("Secret created" , "name" , name )
0 commit comments