@@ -60,7 +60,7 @@ type inputModel struct {
6060 Id string
6161 Name * string
6262 DiskFormat * string
63- Labels * map [string ]string
63+ Labels map [string ]any
6464 Config * imageConfig
6565 MinDiskSize * int64
6666 MinRam * int64
@@ -134,7 +134,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
134134 projectLabel = model .ProjectId
135135 }
136136
137- imageLabel , err := iaasUtils .GetImageName (ctx , apiClient , model .ProjectId , model .Region , model .Id )
137+ imageLabel , err := iaasUtils .GetImageName (ctx , apiClient . DefaultAPI , model .ProjectId , model .Region , model .Id )
138138 if err != nil {
139139 params .Printer .Debug (print .WarningLevel , "cannot retrieve image name: %v" , err )
140140 imageLabel = model .Id
@@ -153,7 +153,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
153153 if err != nil {
154154 return fmt .Errorf ("update image: %w" , err )
155155 }
156- params .Printer .Info ("Updated image \" %v\" for %q\n " , utils . PtrString ( resp .Name ) , projectLabel )
156+ params .Printer .Info ("Updated image \" %v\" for %q\n " , resp .Name , projectLabel )
157157
158158 return nil
159159 },
@@ -203,7 +203,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, cliArgs []string) (*inputM
203203 Name : flags .FlagToStringPointer (p , cmd , nameFlag ),
204204
205205 DiskFormat : flags .FlagToStringPointer (p , cmd , diskFormatFlag ),
206- Labels : flags .FlagToStringToStringPointer (p , cmd , labelsFlag ),
206+ Labels : flags .FlagToStringToAny (p , cmd , labelsFlag ),
207207 Config : & imageConfig {
208208 Architecture : flags .FlagToStringPointer (p , cmd , architectureFlag ),
209209 BootMenu : flags .FlagToBoolPointer (p , cmd , bootMenuFlag ),
@@ -238,12 +238,12 @@ func parseInput(p *print.Printer, cmd *cobra.Command, cliArgs []string) (*inputM
238238}
239239
240240func buildRequest (ctx context.Context , model * inputModel , apiClient * iaas.APIClient ) iaas.ApiUpdateImageRequest {
241- request := apiClient .UpdateImage (ctx , model .ProjectId , model .Region , model .Id )
241+ request := apiClient .DefaultAPI . UpdateImage (ctx , model .ProjectId , model .Region , model .Id )
242242 payload := iaas .NewUpdateImagePayload ()
243243
244244 // Config *ImageConfig `json:"config,omitempty"`
245245 payload .DiskFormat = model .DiskFormat
246- payload .Labels = utils . ConvertStringMapToInterfaceMap ( model .Labels )
246+ payload .Labels = model .Labels
247247 payload .MinDiskSize = model .MinDiskSize
248248 payload .MinRam = model .MinRam
249249 payload .Name = model .Name
@@ -256,28 +256,28 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
256256 payload .Config .BootMenu = model .Config .BootMenu
257257 }
258258 if model .Config .CdromBus != nil {
259- payload .Config .CdromBus = iaas .NewNullableString (model .Config .CdromBus )
259+ payload .Config .CdromBus = * iaas .NewNullableString (model .Config .CdromBus )
260260 }
261261 if model .Config .DiskBus != nil {
262- payload .Config .DiskBus = iaas .NewNullableString (model .Config .DiskBus )
262+ payload .Config .DiskBus = * iaas .NewNullableString (model .Config .DiskBus )
263263 }
264264 if model .Config .NicModel != nil {
265- payload .Config .NicModel = iaas .NewNullableString (model .Config .NicModel )
265+ payload .Config .NicModel = * iaas .NewNullableString (model .Config .NicModel )
266266 }
267267 if model .Config .OperatingSystem != nil {
268268 payload .Config .OperatingSystem = model .Config .OperatingSystem
269269 }
270270 if model .Config .OperatingSystemDistro != nil {
271- payload .Config .OperatingSystemDistro = iaas .NewNullableString (model .Config .OperatingSystemDistro )
271+ payload .Config .OperatingSystemDistro = * iaas .NewNullableString (model .Config .OperatingSystemDistro )
272272 }
273273 if model .Config .OperatingSystemVersion != nil {
274- payload .Config .OperatingSystemVersion = iaas .NewNullableString (model .Config .OperatingSystemVersion )
274+ payload .Config .OperatingSystemVersion = * iaas .NewNullableString (model .Config .OperatingSystemVersion )
275275 }
276276 if model .Config .RescueBus != nil {
277- payload .Config .RescueBus = iaas .NewNullableString (model .Config .RescueBus )
277+ payload .Config .RescueBus = * iaas .NewNullableString (model .Config .RescueBus )
278278 }
279279 if model .Config .RescueDevice != nil {
280- payload .Config .RescueDevice = iaas .NewNullableString (model .Config .RescueDevice )
280+ payload .Config .RescueDevice = * iaas .NewNullableString (model .Config .RescueDevice )
281281 }
282282 if model .Config .SecureBoot != nil {
283283 payload .Config .SecureBoot = model .Config .SecureBoot
@@ -286,7 +286,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
286286 payload .Config .Uefi = model .Config .Uefi
287287 }
288288 if model .Config .VideoModel != nil {
289- payload .Config .VideoModel = iaas .NewNullableString (model .Config .VideoModel )
289+ payload .Config .VideoModel = * iaas .NewNullableString (model .Config .VideoModel )
290290 }
291291 if model .Config .VirtioScsi != nil {
292292 payload .Config .VirtioScsi = model .Config .VirtioScsi
0 commit comments