Skip to content

Commit

Permalink
fix issue comparing empty lb backend pool list to NIC backend pool li…
Browse files Browse the repository at this point in the history
…st (#131)
  • Loading branch information
mbrat2005 authored Jan 6, 2025
1 parent 66d7ef9 commit 9b828b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzureBasicLoadBalancerUpgrade'

# Version number of this module.
ModuleVersion = '2.4.14'
ModuleVersion = '2.4.15'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -107,7 +107,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'Added support to retain AutomaticOSUpgrade setting when App Health extension is used instead of health probe.'
ReleaseNotes = 'Fix bug when comparing backend pool membership on empty LBs.'

# Prerelease string of this module
# Prerelease = 'beta'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,16 @@ Function Test-SupportedMigrationScenario {
## compare nic backend pool memberships to basicLBBackendIds
try {
$nicBackendPoolMembershipsIds = @()

$nicBackendPoolMembershipsIds += $basicLBVMNics.IpConfigurations.loadBalancerBackendAddressPools.id | Sort-Object | Get-Unique
$differentMembership = Compare-Object $nicBackendPoolMembershipsIds $basicLBBackendIds

If ([string]::IsNullOrEmpty($basicLBBackendIds)) {
# handle LBs with no backend pools
log -Message "[Test-SupportedMigrationScenario] No Basic Load Balancer backend pool IDs provided, so all NIC backend pool IDs must be on another LB (if any)." -Severity Debug
}
Else {
$differentMembership = Compare-Object -ReferenceObject $nicBackendPoolMembershipsIds -DifferenceObject $basicLBBackendIds
}
}
catch {
$message = "[Test-SupportedMigrationScenario] Error comparing NIC backend pool memberships ($($nicBackendPoolMembershipsIds -join ',')) to basicLBBackendIds ($($basicLBBackendIds -join ',')). Error: $($_.Exception.Message)"
Expand Down

0 comments on commit 9b828b1

Please sign in to comment.