Skip to content

Commit

Permalink
fix: don't extract nil IPs in the GCP platform
Browse files Browse the repository at this point in the history
This fix is same as #4152.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
smira committed Aug 26, 2021
1 parent ba169c6 commit c4048e2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func (g *GCP) ExternalIPs(ctx context.Context) (addrs []net.IP, err error) {

for _, networkInterface := range m {
for _, accessConfig := range networkInterface.AccessConfigs {
addrs = append(addrs, net.ParseIP(accessConfig.ExternalIP))
if addr := net.ParseIP(accessConfig.ExternalIP); addr != nil {
addrs = append(addrs, addr)
}
}
}

Expand Down

0 comments on commit c4048e2

Please sign in to comment.