@@ -283,6 +283,7 @@ func TestDeleteSecurityGroups(t *testing.T) {
283283 })
284284 s .ResourceGroup ().AnyTimes ().Return ("my-rg" )
285285 s .V (gomock .AssignableToTypeOf (2 )).AnyTimes ().Return (klogr .New ())
286+ s .IsVnetManaged ().Return (true )
286287 m .Delete (gomockinternal .AContext (), "my-rg" , "nsg-one" )
287288 m .Delete (gomockinternal .AContext (), "my-rg" , "nsg-two" )
288289 },
@@ -302,11 +303,19 @@ func TestDeleteSecurityGroups(t *testing.T) {
302303 })
303304 s .ResourceGroup ().AnyTimes ().Return ("my-rg" )
304305 s .V (gomock .AssignableToTypeOf (2 )).AnyTimes ().Return (klogr .New ())
306+ s .IsVnetManaged ().Return (true )
305307 m .Delete (gomockinternal .AContext (), "my-rg" , "nsg-one" ).
306308 Return (autorest .NewErrorWithResponse ("" , "" , & http.Response {StatusCode : 404 }, "Not found" ))
307309 m .Delete (gomockinternal .AContext (), "my-rg" , "nsg-two" )
308310 },
309311 },
312+ {
313+ name : "skipping network security group delete in custom VNet mode" ,
314+ expect : func (s * mock_securitygroups.MockNSGScopeMockRecorder , m * mock_securitygroups.MockclientMockRecorder ) {
315+ s .IsVnetManaged ().Return (false )
316+ s .V (gomock .AssignableToTypeOf (2 )).AnyTimes ().Return (klogr .New ())
317+ },
318+ },
310319 }
311320 for _ , tc := range testcases {
312321 tc := tc
0 commit comments