Skip to content

Commit 378fcc8

Browse files
committed
Check for node IP
1 parent 03291ca commit 378fcc8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/proxy/winkernel/proxier.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ func (proxier *Proxier) syncProxyRules() {
10761076
klog.V(4).Infof("====Applying Policy for %s====", svcName)
10771077
// Create Remote endpoints for every endpoint, corresponding to the service
10781078
containsPublicIP := false
1079+
containsNodeIP := false
10791080

10801081
for _, ep := range proxier.endpointsMap[svcName] {
10811082
var newHnsEndpoint *endpointsInfo
@@ -1126,13 +1127,15 @@ func (proxier *Proxier) syncProxyRules() {
11261127
}
11271128
if ep.ip == rs.providerAddress {
11281129
providerAddress = rs.providerAddress
1130+
containsNodeIP = true
11291131
}
11301132
}
11311133
if len(providerAddress) == 0 {
1132-
klog.Errorf("Could not find provider address for %s", ep.ip)
1134+
klog.Infof("Could not find provider address for %s. Assuming it is a public IP", ep.ip)
11331135
providerAddress = proxier.nodeIP.String()
11341136
containsPublicIP = true
11351137
}
1138+
11361139
hnsEndpoint := &endpointsInfo{
11371140
ip: ep.ip,
11381141
isLocal: false,
@@ -1186,7 +1189,7 @@ func (proxier *Proxier) syncProxyRules() {
11861189
klog.V(4).Infof("Trying to Apply Policies for service %s", spew.Sdump(svcInfo))
11871190
var hnsLoadBalancer *loadBalancerInfo
11881191
var sourceVip = proxier.sourceVip
1189-
if containsPublicIP {
1192+
if containsPublicIP || containsNodeIP {
11901193
sourceVip = proxier.nodeIP.String()
11911194
}
11921195
hnsLoadBalancer, err := hns.getLoadBalancer(

0 commit comments

Comments
 (0)