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>
(cherry picked from commit c4048e2)
  • Loading branch information
smira committed Aug 27, 2021
1 parent 3a38f0d commit eba0072
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 eba0072

Please sign in to comment.