Skip to content

Commit

Permalink
azure: Fix error messages in available IP code
Browse files Browse the repository at this point in the history
Fixing the error messages in the check for available IPs.
The error message is always empty since there was no error
but there are no IPs available.
  • Loading branch information
rna-afk committed Feb 24, 2025
1 parent 24d2481 commit 759b731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/asset/manifests/azure/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func getNextAvailableIP(ctx context.Context, installConfig *installconfig.Instal
}
}
if ipAvail.AvailableIPAddresses == nil || len(*ipAvail.AvailableIPAddresses) == 0 {
return "", fmt.Errorf("failed to get an available IP in given virtual network for LB: %w", err)
return "", fmt.Errorf("failed to get an available IP in given virtual network for LB: this error may be caused by lack of necessary permissions")
}
for _, ip := range *ipAvail.AvailableIPAddresses {
for _, cidrRange := range machineCidr {
Expand All @@ -296,5 +296,5 @@ func getNextAvailableIP(ctx context.Context, installConfig *installconfig.Instal
}
}
}
return "", fmt.Errorf("failed to get available IP in given machine network: %w", err)
return "", fmt.Errorf("failed to get available IP in given machine network: this error may be caused by lack of necessary permissions")
}

0 comments on commit 759b731

Please sign in to comment.