Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pkg/infrastructure/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,15 @@ func (p *Provider) PostDestroy(ctx context.Context, in clusterapi.PostDestroyerI
if err != nil {
return fmt.Errorf("failed to delete security rule: %w", err)
}

}
_, err = networkClientFactory.NewInboundNatRulesClient().Get(
ctx,
resourceGroupName,
in.Metadata.InfraID,
sshRuleName,
nil,
)
if err == nil {
err = deleteInboundNatRule(ctx, &inboundNatRuleInput{
resourceGroupName: resourceGroupName,
loadBalancerName: in.Metadata.InfraID,
Expand All @@ -652,7 +660,6 @@ func (p *Provider) PostDestroy(ctx context.Context, in clusterapi.PostDestroyerI
return fmt.Errorf("failed to delete inbound nat rule: %w", err)
}
}

return nil
}

Expand Down