Skip to content

Commit f507a03

Browse files
committed
refactor: replace net.ParseIP("0.0.0.0") with net.IPv4zero
Signed-off-by: Oleksandr Redko <[email protected]>
1 parent 38b8280 commit f507a03

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/guestagent/kubernetesservice/kubernetesservice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (s *ServiceWatcher) GetPorts() []Entry {
149149

150150
entries = append(entries, Entry{
151151
Protocol: Protocol(strings.ToLower(string(portEntry.Protocol))),
152-
IP: net.ParseIP("0.0.0.0"),
152+
IP: net.IPv4zero,
153153
Port: uint16(port),
154154
})
155155
}

pkg/guestagent/kubernetesservice/kubernetesservice_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestGetPorts(t *testing.T) {
6363
},
6464
want: []Entry{{
6565
Protocol: TCP,
66-
IP: net.ParseIP("0.0.0.0"),
66+
IP: net.IPv4zero,
6767
Port: 8080,
6868
}},
6969
},
@@ -85,7 +85,7 @@ func TestGetPorts(t *testing.T) {
8585
},
8686
want: []Entry{{
8787
Protocol: TCP,
88-
IP: net.ParseIP("0.0.0.0"),
88+
IP: net.IPv4zero,
8989
Port: 8081,
9090
}},
9191
},

0 commit comments

Comments
 (0)