@@ -29,18 +29,18 @@ import (
2929)
3030
3131// Create OpenstackBaremetalSet in k8s and test that no errors occur
32- func CreateBaremetalSet (name types.NamespacedName , spec map [string ]interface {} ) * unstructured.Unstructured {
32+ func CreateBaremetalSet (name types.NamespacedName , spec map [string ]any ) * unstructured.Unstructured {
3333 instance := DefaultBaremetalSetTemplate (name , spec )
3434 return th .CreateUnstructured (instance )
3535}
3636
3737// Build OpenStackBaremetalSet struct and fill it with preset values
38- func DefaultBaremetalSetTemplate (name types.NamespacedName , spec map [string ]interface {} ) map [string ]interface {} {
39- return map [string ]interface {} {
38+ func DefaultBaremetalSetTemplate (name types.NamespacedName , spec map [string ]any ) map [string ]any {
39+ return map [string ]any {
4040
4141 "apiVersion" : "baremetal.openstack.org/v1beta1" ,
4242 "kind" : "OpenStackBaremetalSet" ,
43- "metadata" : map [string ]interface {} {
43+ "metadata" : map [string ]any {
4444 "name" : name .Name ,
4545 "namespace" : name .Namespace ,
4646 },
@@ -49,10 +49,10 @@ func DefaultBaremetalSetTemplate(name types.NamespacedName, spec map[string]inte
4949}
5050
5151// Build BaremetalSetSpec struct and fill it with preset values
52- func DefaultBaremetalSetSpec (name types.NamespacedName , withProvInterface bool ) map [string ]interface {} {
53- spec := map [string ]interface {} {
54- "baremetalHosts" : map [string ]interface {} {
55- "compute-0" : map [string ]interface {} {
52+ func DefaultBaremetalSetSpec (name types.NamespacedName , withProvInterface bool ) map [string ]any {
53+ spec := map [string ]any {
54+ "baremetalHosts" : map [string ]any {
55+ "compute-0" : map [string ]any {
5656 "ctlPlaneIP" : "10.0.0.1" ,
5757 },
5858 },
@@ -74,13 +74,13 @@ func DefaultBaremetalSetSpec(name types.NamespacedName, withProvInterface bool)
7474}
7575
7676// Build BaremetalSetSpec struct for two nodes
77- func TwoNodeBaremetalSetSpec (namespace string ) map [string ]interface {} {
78- spec := map [string ]interface {} {
79- "baremetalHosts" : map [string ]interface {} {
80- "compute-0" : map [string ]interface {} {
77+ func TwoNodeBaremetalSetSpec (namespace string ) map [string ]any {
78+ spec := map [string ]any {
79+ "baremetalHosts" : map [string ]any {
80+ "compute-0" : map [string ]any {
8181 "ctlPlaneIP" : "10.0.0.1" ,
8282 },
83- "compute-1" : map [string ]interface {} {
83+ "compute-1" : map [string ]any {
8484 "ctlPlaneIP" : "10.0.0.1" ,
8585 },
8686 },
@@ -92,14 +92,14 @@ func TwoNodeBaremetalSetSpec(namespace string) map[string]interface{} {
9292 return spec
9393}
9494
95- func TwoNodeBaremetalSetSpecWithNodeLabel (namespace string ) map [string ]interface {} {
96- spec := map [string ]interface {} {
97- "baremetalHosts" : map [string ]interface {} {
98- "compute-0" : map [string ]interface {} {
95+ func TwoNodeBaremetalSetSpecWithNodeLabel (namespace string ) map [string ]any {
96+ spec := map [string ]any {
97+ "baremetalHosts" : map [string ]any {
98+ "compute-0" : map [string ]any {
9999 "ctlPlaneIP" : "10.0.0.1" ,
100100 "bmhLabelSelector" : map [string ]string {"nodeName" : "compute-0" },
101101 },
102- "compute-1" : map [string ]interface {} {
102+ "compute-1" : map [string ]any {
103103 "ctlPlaneIP" : "10.0.0.1" ,
104104 "bmhLabelSelector" : map [string ]string {"nodeName" : "compute-1" },
105105 },
@@ -112,14 +112,14 @@ func TwoNodeBaremetalSetSpecWithNodeLabel(namespace string) map[string]interface
112112 return spec
113113}
114114
115- func TwoNodeBaremetalSetSpecWithWrongNodeLabel (namespace string ) map [string ]interface {} {
116- spec := map [string ]interface {} {
117- "baremetalHosts" : map [string ]interface {} {
118- "compute-0" : map [string ]interface {} {
115+ func TwoNodeBaremetalSetSpecWithWrongNodeLabel (namespace string ) map [string ]any {
116+ spec := map [string ]any {
117+ "baremetalHosts" : map [string ]any {
118+ "compute-0" : map [string ]any {
119119 "ctlPlaneIP" : "10.0.0.1" ,
120120 "bmhLabelSelector" : map [string ]string {"nodeName" : "compute-0" },
121121 },
122- "compute-1" : map [string ]interface {} {
122+ "compute-1" : map [string ]any {
123123 "ctlPlaneIP" : "10.0.0.1" ,
124124 "bmhLabelSelector" : map [string ]string {"nodeName" : "compute-2" },
125125 },
@@ -132,18 +132,18 @@ func TwoNodeBaremetalSetSpecWithWrongNodeLabel(namespace string) map[string]inte
132132 return spec
133133}
134134
135- func MultiNodeBaremetalSetSpecWithSameNodeLabel (namespace string ) map [string ]interface {} {
136- spec := map [string ]interface {} {
137- "baremetalHosts" : map [string ]interface {} {
138- "compute-0" : map [string ]interface {} {
135+ func MultiNodeBaremetalSetSpecWithSameNodeLabel (namespace string ) map [string ]any {
136+ spec := map [string ]any {
137+ "baremetalHosts" : map [string ]any {
138+ "compute-0" : map [string ]any {
139139 "ctlPlaneIP" : "10.0.0.1" ,
140140 "bmhLabelSelector" : map [string ]string {"nodeType" : "compute" },
141141 },
142- "compute-1" : map [string ]interface {} {
142+ "compute-1" : map [string ]any {
143143 "ctlPlaneIP" : "10.0.0.2" ,
144144 "bmhLabelSelector" : map [string ]string {"nodeType" : "compute" },
145145 },
146- "compute-2" : map [string ]interface {} {
146+ "compute-2" : map [string ]any {
147147 "ctlPlaneIP" : "10.0.0.3" ,
148148 "bmhLabelSelector" : map [string ]string {"nodeType" : "compute" },
149149 },
@@ -156,18 +156,18 @@ func MultiNodeBaremetalSetSpecWithSameNodeLabel(namespace string) map[string]int
156156 return spec
157157}
158158
159- func MultiNodeBaremetalSetSpecWithOverlappingNodeLabels (namespace string ) map [string ]interface {} {
160- spec := map [string ]interface {} {
161- "baremetalHosts" : map [string ]interface {} {
162- "compute-0" : map [string ]interface {} {
159+ func MultiNodeBaremetalSetSpecWithOverlappingNodeLabels (namespace string ) map [string ]any {
160+ spec := map [string ]any {
161+ "baremetalHosts" : map [string ]any {
162+ "compute-0" : map [string ]any {
163163 "ctlPlaneIP" : "10.0.0.1" ,
164164 "bmhLabelSelector" : map [string ]string {"nodeType" : "compute" , "dummyLabel" : "dummy" },
165165 },
166- "compute-1" : map [string ]interface {} {
166+ "compute-1" : map [string ]any {
167167 "ctlPlaneIP" : "10.0.0.2" ,
168168 "bmhLabelSelector" : map [string ]string {"nodeType" : "compute" , "nodeName" : "compute-1" },
169169 },
170- "compute-2" : map [string ]interface {} {
170+ "compute-2" : map [string ]any {
171171 "ctlPlaneIP" : "10.0.0.3" ,
172172 "bmhLabelSelector" : map [string ]string {"nodeType" : "compute" , "dummyLabel" : "dummy" },
173173 },
@@ -181,22 +181,22 @@ func MultiNodeBaremetalSetSpecWithOverlappingNodeLabels(namespace string) map[st
181181}
182182
183183// Default BMH Template with preset values
184- func DefaultBMHTemplate (name types.NamespacedName ) map [string ]interface {} {
185- return map [string ]interface {} {
184+ func DefaultBMHTemplate (name types.NamespacedName ) map [string ]any {
185+ return map [string ]any {
186186 "apiVersion" : "metal3.io/v1alpha1" ,
187187 "kind" : "BareMetalHost" ,
188- "metadata" : map [string ]interface {} {
188+ "metadata" : map [string ]any {
189189 "name" : name .Name ,
190190 "namespace" : name .Namespace ,
191191 "labels" : map [string ]string {
192192 "app" : "openstack" ,
193193 },
194- "annotations" : map [string ]interface {} {
194+ "annotations" : map [string ]any {
195195 "inspect.metal3.io" : "disabled" ,
196196 },
197197 },
198- "spec" : map [string ]interface {} {
199- "bmc" : map [string ]interface {} {
198+ "spec" : map [string ]any {
199+ "bmc" : map [string ]any {
200200 "address" : "fake_address" ,
201201 "credentialsName" : "fake_credential" ,
202202 },
@@ -208,21 +208,21 @@ func DefaultBMHTemplate(name types.NamespacedName) map[string]interface{} {
208208}
209209
210210// Default BMH Template with preset values
211- func BMHTemplateWithNodeLabels (name types.NamespacedName , nodeLabels map [string ]string ) map [string ]interface {} {
211+ func BMHTemplateWithNodeLabels (name types.NamespacedName , nodeLabels map [string ]string ) map [string ]any {
212212 labels := util .MergeMaps (map [string ]string {"app" : "openstack" }, nodeLabels )
213- return map [string ]interface {} {
213+ return map [string ]any {
214214 "apiVersion" : "metal3.io/v1alpha1" ,
215215 "kind" : "BareMetalHost" ,
216- "metadata" : map [string ]interface {} {
216+ "metadata" : map [string ]any {
217217 "name" : name .Name ,
218218 "namespace" : name .Namespace ,
219219 "labels" : labels ,
220- "annotations" : map [string ]interface {} {
220+ "annotations" : map [string ]any {
221221 "inspect.metal3.io" : "disabled" ,
222222 },
223223 },
224- "spec" : map [string ]interface {} {
225- "bmc" : map [string ]interface {} {
224+ "spec" : map [string ]any {
225+ "bmc" : map [string ]any {
226226 "address" : "fake_address" ,
227227 "credentialsName" : "fake_credential" ,
228228 },
0 commit comments