@@ -273,17 +273,13 @@ var _ = Describe("create", Label("machine", "create"), func() {
273273 ResizeInstanceDisk (ctx , 123 , 100 , 4262 ).
274274 After (getInstDisk ).
275275 Return (nil )
276- waitForInstDisk := mockLinodeClient .EXPECT ().
277- WaitForInstanceDiskStatus (ctx , 123 , 100 , linodego .DiskReady , defaultResizeWaitSeconds ).
278- After (resizeInstDisk ).
279- Return (nil , nil )
280276 createEtcdDisk := mockLinodeClient .EXPECT ().
281277 CreateInstanceDisk (ctx , 123 , linodego.InstanceDiskCreateOptions {
282278 Label : "etcd-data" ,
283279 Size : 10738 ,
284280 Filesystem : string (linodego .FilesystemExt4 ),
285281 }).
286- After (waitForInstDisk ).
282+ After (resizeInstDisk ).
287283 Return (& linodego.InstanceDisk {ID : 101 }, nil )
288284 listInstConfsForProfile := mockLinodeClient .EXPECT ().
289285 ListInstanceConfigs (ctx , 123 , gomock .Any ()).
@@ -398,10 +394,15 @@ var _ = Describe("create", Label("machine", "create"), func() {
398394 ResizeInstanceDisk (ctx , 123 , 100 , 4262 ).
399395 After (getInstDisk ).
400396 Return (nil )
401- mockLinodeClient .EXPECT ().
402- WaitForInstanceDiskStatus (ctx , 123 , 100 , linodego .DiskReady , defaultResizeWaitSeconds ).
397+
398+ createFailedEtcdDisk := mockLinodeClient .EXPECT ().
399+ CreateInstanceDisk (ctx , 123 , linodego.InstanceDiskCreateOptions {
400+ Label : "etcd-data" ,
401+ Size : 10738 ,
402+ Filesystem : string (linodego .FilesystemExt4 ),
403+ }).
403404 After (resizeInstDisk ).
404- Return (nil , errors . New ( "Waiting for Instance 123 Disk 100 status ready: not yet" ) )
405+ Return (nil , linodego. Error { Code : 400 } )
405406
406407 mScope := scope.MachineScope {
407408 Client : k8sClient ,
@@ -421,30 +422,19 @@ var _ = Describe("create", Label("machine", "create"), func() {
421422
422423 listInst = mockLinodeClient .EXPECT ().
423424 ListInstances (ctx , gomock .Any ()).
425+ After (createFailedEtcdDisk ).
424426 Return ([]linodego.Instance {{
425427 ID : 123 ,
426428 IPv4 : []* net.IP {ptr .To (net .IPv4 (192 , 168 , 0 , 2 ))},
427429 Status : linodego .InstanceOffline ,
428430 }}, nil )
429- listInstConfs = mockLinodeClient .EXPECT ().
430- ListInstanceConfigs (ctx , 123 , gomock .Any ()).
431- After (listInst ).
432- Return ([]linodego.InstanceConfig {{
433- Devices : & linodego.InstanceConfigDeviceMap {
434- SDA : & linodego.InstanceConfigDevice {DiskID : 100 },
435- },
436- }}, nil )
437- waitForInstDisk := mockLinodeClient .EXPECT ().
438- WaitForInstanceDiskStatus (ctx , 123 , 100 , linodego .DiskReady , defaultResizeWaitSeconds ).
439- After (listInstConfs ).
440- Return (nil , nil )
441431 createEtcdDisk := mockLinodeClient .EXPECT ().
442432 CreateInstanceDisk (ctx , 123 , linodego.InstanceDiskCreateOptions {
443433 Label : "etcd-data" ,
444434 Size : 10738 ,
445435 Filesystem : string (linodego .FilesystemExt4 ),
446436 }).
447- After (waitForInstDisk ).
437+ After (listInst ).
448438 Return (& linodego.InstanceDisk {ID : 101 }, nil )
449439 listInstConfsForProfile := mockLinodeClient .EXPECT ().
450440 ListInstanceConfigs (ctx , 123 , gomock .Any ()).
0 commit comments