@@ -84,8 +84,8 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
8484 return flagValues
8585}
8686
87- func parseLabels (labelstring string ) map [string ]string {
88- labels := map [string ]string {}
87+ func parseLabels (labelstring string ) map [string ]any {
88+ labels := map [string ]any {}
8989 for _ , part := range strings .Split (labelstring , "," ) {
9090 v := strings .Split (part , "=" )
9191 labels [v [0 ]] = v [1 ]
@@ -104,7 +104,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
104104 Name : testName ,
105105 DiskFormat : testDiskFormat ,
106106 LocalFilePath : testLocalImagePath ,
107- Labels : utils . Ptr ( parseLabels (testLabels ) ),
107+ Labels : parseLabels (testLabels ),
108108 Config : & imageConfig {
109109 Architecture : utils .Ptr (testArchitecture ),
110110 BootMenu : utils .Ptr (testBootmenu ),
@@ -136,28 +136,28 @@ func fixtureCreatePayload(mods ...func(payload *iaas.CreateImagePayload)) (paylo
136136 Config : & iaas.ImageConfig {
137137 Architecture : utils .Ptr (testArchitecture ),
138138 BootMenu : utils .Ptr (testBootmenu ),
139- CdromBus : iaas .NewNullableString (utils .Ptr (testCdRomBus )),
140- DiskBus : iaas .NewNullableString (utils .Ptr (testDiskBus )),
141- NicModel : iaas .NewNullableString (utils .Ptr (testNicModel )),
139+ CdromBus : * iaas .NewNullableString (utils .Ptr (testCdRomBus )),
140+ DiskBus : * iaas .NewNullableString (utils .Ptr (testDiskBus )),
141+ NicModel : * iaas .NewNullableString (utils .Ptr (testNicModel )),
142142 OperatingSystem : utils .Ptr (testOperatingSystem ),
143- OperatingSystemDistro : iaas .NewNullableString (utils .Ptr (testOperatingSystemDistro )),
144- OperatingSystemVersion : iaas .NewNullableString (utils .Ptr (testOperatingSystemVersion )),
145- RescueBus : iaas .NewNullableString (utils .Ptr (testRescueBus )),
146- RescueDevice : iaas .NewNullableString (utils .Ptr (testRescueDevice )),
143+ OperatingSystemDistro : * iaas .NewNullableString (utils .Ptr (testOperatingSystemDistro )),
144+ OperatingSystemVersion : * iaas .NewNullableString (utils .Ptr (testOperatingSystemVersion )),
145+ RescueBus : * iaas .NewNullableString (utils .Ptr (testRescueBus )),
146+ RescueDevice : * iaas .NewNullableString (utils .Ptr (testRescueDevice )),
147147 SecureBoot : utils .Ptr (testSecureBoot ),
148148 Uefi : utils .Ptr (testUefi ),
149- VideoModel : iaas .NewNullableString (utils .Ptr (testVideoModel )),
149+ VideoModel : * iaas .NewNullableString (utils .Ptr (testVideoModel )),
150150 VirtioScsi : utils .Ptr (testVirtioScsi ),
151151 },
152- DiskFormat : utils . Ptr ( testDiskFormat ) ,
153- Labels : & map [string ]interface {} {
152+ DiskFormat : testDiskFormat ,
153+ Labels : map [string ]any {
154154 "foo" : "FOO" ,
155155 "bar" : "BAR" ,
156156 "baz" : "BAZ" ,
157157 },
158158 MinDiskSize : utils .Ptr (testDiskSize ),
159159 MinRam : utils .Ptr (testRamSize ),
160- Name : utils . Ptr ( testName ) ,
160+ Name : testName ,
161161 Protected : utils .Ptr (testProtected ),
162162 }
163163 for _ , mod := range mods {
@@ -167,7 +167,7 @@ func fixtureCreatePayload(mods ...func(payload *iaas.CreateImagePayload)) (paylo
167167}
168168
169169func fixtureRequest (mods ... func (request * iaas.ApiCreateImageRequest )) iaas.ApiCreateImageRequest {
170- request := testClient .CreateImage (testCtx , testProjectId , testRegion )
170+ request := testClient .DefaultAPI . CreateImage (testCtx , testProjectId , testRegion )
171171
172172 request = request .CreateImagePayload (fixtureCreatePayload ())
173173
@@ -241,7 +241,7 @@ func TestParseInput(t *testing.T) {
241241 }),
242242 isValid : true ,
243243 expectedModel : fixtureInputModel (func (model * inputModel ) {
244- model .Labels = & map [string ]string {
244+ model .Labels = map [string ]any {
245245 "foo" : "bar" ,
246246 }
247247 }),
@@ -320,7 +320,7 @@ func TestBuildRequest(t *testing.T) {
320320 }),
321321 expectedRequest : fixtureRequest (func (request * iaas.ApiCreateImageRequest ) {
322322 * request = (* request ).CreateImagePayload (fixtureCreatePayload (func (payload * iaas.CreateImagePayload ) {
323- payload .Config .CdromBus = iaas .NewNullableString (utils .Ptr ("foobar" ))
323+ payload .Config .CdromBus = * iaas .NewNullableString (utils .Ptr ("foobar" ))
324324 }))
325325 }),
326326 },
@@ -342,7 +342,7 @@ func TestBuildRequest(t *testing.T) {
342342 request := buildRequest (testCtx , tt .model , testClient )
343343 diff := cmp .Diff (request , tt .expectedRequest ,
344344 cmp .AllowUnexported (tt .expectedRequest ),
345- cmpopts .EquateComparable (testCtx ),
345+ cmpopts .EquateComparable (testCtx , iaas. DefaultAPIService {} ),
346346 cmp .AllowUnexported (iaas.NullableString {}),
347347 )
348348 if diff != "" {
0 commit comments