@@ -273,17 +273,13 @@ var _ = Describe("create", Label("machine", "create"), func() {
273
273
ResizeInstanceDisk (ctx , 123 , 100 , 4262 ).
274
274
After (getInstDisk ).
275
275
Return (nil )
276
- waitForInstDisk := mockLinodeClient .EXPECT ().
277
- WaitForInstanceDiskStatus (ctx , 123 , 100 , linodego .DiskReady , defaultResizeWaitSeconds ).
278
- After (resizeInstDisk ).
279
- Return (nil , nil )
280
276
createEtcdDisk := mockLinodeClient .EXPECT ().
281
277
CreateInstanceDisk (ctx , 123 , linodego.InstanceDiskCreateOptions {
282
278
Label : "etcd-data" ,
283
279
Size : 10738 ,
284
280
Filesystem : string (linodego .FilesystemExt4 ),
285
281
}).
286
- After (waitForInstDisk ).
282
+ After (resizeInstDisk ).
287
283
Return (& linodego.InstanceDisk {ID : 101 }, nil )
288
284
listInstConfsForProfile := mockLinodeClient .EXPECT ().
289
285
ListInstanceConfigs (ctx , 123 , gomock .Any ()).
@@ -398,10 +394,15 @@ var _ = Describe("create", Label("machine", "create"), func() {
398
394
ResizeInstanceDisk (ctx , 123 , 100 , 4262 ).
399
395
After (getInstDisk ).
400
396
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
+ }).
403
404
After (resizeInstDisk ).
404
- Return (nil , errors . New ( "Waiting for Instance 123 Disk 100 status ready: not yet" ) )
405
+ Return (nil , linodego. Error { Code : 400 } )
405
406
406
407
mScope := scope.MachineScope {
407
408
Client : k8sClient ,
@@ -421,30 +422,19 @@ var _ = Describe("create", Label("machine", "create"), func() {
421
422
422
423
listInst = mockLinodeClient .EXPECT ().
423
424
ListInstances (ctx , gomock .Any ()).
425
+ After (createFailedEtcdDisk ).
424
426
Return ([]linodego.Instance {{
425
427
ID : 123 ,
426
428
IPv4 : []* net.IP {ptr .To (net .IPv4 (192 , 168 , 0 , 2 ))},
427
429
Status : linodego .InstanceOffline ,
428
430
}}, 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 )
441
431
createEtcdDisk := mockLinodeClient .EXPECT ().
442
432
CreateInstanceDisk (ctx , 123 , linodego.InstanceDiskCreateOptions {
443
433
Label : "etcd-data" ,
444
434
Size : 10738 ,
445
435
Filesystem : string (linodego .FilesystemExt4 ),
446
436
}).
447
- After (waitForInstDisk ).
437
+ After (listInst ).
448
438
Return (& linodego.InstanceDisk {ID : 101 }, nil )
449
439
listInstConfsForProfile := mockLinodeClient .EXPECT ().
450
440
ListInstanceConfigs (ctx , 123 , gomock .Any ()).
0 commit comments