@@ -32,7 +32,6 @@ import (
3232
3333 "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
3434 "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources"
35- "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
3635 "github.com/Azure/go-autorest/autorest/date"
3736 "github.com/Azure/go-autorest/autorest/to"
3837 "github.com/stretchr/testify/assert"
@@ -409,19 +408,6 @@ func TestDeleteInstances(t *testing.T) {
409408 err = as .DeleteInstances (instances )
410409 expectedErr = fmt .Errorf ("cannot delete instance (%s) which don't belong to the same node pool (\" as\" )" , testValidProviderID1 )
411410 assert .Equal (t , expectedErr , err )
412-
413- instances = []* azureRef {
414- {Name : testValidProviderID0 },
415- }
416- mockVMClient .EXPECT ().Get (gomock .Any (), as .manager .config .ResourceGroup , "as-vm-0" , gomock .Any ()).Return (getExpectedVMs ()[0 ], nil )
417- mockVMClient .EXPECT ().Delete (gomock .Any (), as .manager .config .ResourceGroup , "as-vm-0" ).Return (nil )
418- mockSAClient .EXPECT ().ListKeys (gomock .Any (), as .manager .config .SubscriptionID , as .manager .config .ResourceGroup , "foo" ).Return (storage.AccountListKeysResult {
419- Keys : & []storage.AccountKey {
420- {Value : to .StringPtr ("dmFsdWUK" )},
421- },
422- }, nil )
423- err = as .DeleteInstances (instances )
424- assert .Error (t , err )
425411}
426412
427413func TestAgentPoolDeleteNodes (t * testing.T ) {
@@ -462,22 +448,6 @@ func TestAgentPoolDeleteNodes(t *testing.T) {
462448 expectedErr = fmt .Errorf ("node belongs to a different asg than as" )
463449 assert .Equal (t , expectedErr , err )
464450
465- as .manager .azureCache .instanceToNodeGroup [azureRef {Name : testValidProviderID0 }] = as
466- mockVMClient .EXPECT ().Get (gomock .Any (), as .manager .config .ResourceGroup , "as-vm-0" , gomock .Any ()).Return (getExpectedVMs ()[0 ], nil )
467- mockVMClient .EXPECT ().Delete (gomock .Any (), as .manager .config .ResourceGroup , "as-vm-0" ).Return (nil )
468- mockSAClient .EXPECT ().ListKeys (gomock .Any (), as .manager .config .SubscriptionID , as .manager .config .ResourceGroup , "foo" ).Return (storage.AccountListKeysResult {
469- Keys : & []storage.AccountKey {
470- {Value : to .StringPtr ("dmFsdWUK" )},
471- },
472- }, nil )
473- err = as .DeleteNodes ([]* apiv1.Node {
474- {
475- Spec : apiv1.NodeSpec {ProviderID : testValidProviderID0 },
476- ObjectMeta : v1.ObjectMeta {Name : "node" },
477- },
478- })
479- assert .Error (t , err )
480-
481451 as .minSize = 3
482452 err = as .DeleteNodes ([]* apiv1.Node {})
483453 expectedErr = fmt .Errorf ("min size reached, nodes will not be deleted" )
0 commit comments