Merge pull request #55601 from m1093782566/getlocalips
Automatic merge from submit-queue (batch tested with PRs 55009, 55532, 55601, 52569, 55533). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix ipvs/proxy getLocalIPs inconsistency with iptables/proxy **What this PR does / why we need it**: * Fix ipvs/proxy `getLocalIPs()` inconsistency with iptables/proxy * validate the ip address before pkg/proxy/util IPPart() return ip string. **Which issue(s) this PR fixes** : Fixes #55612 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
@@ -1281,6 +1281,14 @@ func Test_getLocalIPs(t *testing.T) {
|
||||
{Namespace: "ns2", Name: "ep2"}: sets.NewString("2.2.2.2", "2.2.2.22", "2.2.2.3"),
|
||||
{Namespace: "ns4", Name: "ep4"}: sets.NewString("4.4.4.4", "4.4.4.6"),
|
||||
},
|
||||
}, {
|
||||
// Case[5]: named port local and bad endpoints IP
|
||||
endpointsMap: map[proxy.ServicePortName][]*endpointsInfo{
|
||||
makeServicePortName("ns1", "ep1", "p11"): {
|
||||
{endpoint: "bad ip:11", isLocal: true},
|
||||
},
|
||||
},
|
||||
expected: map[types.NamespacedName]sets.String{},
|
||||
}}
|
||||
|
||||
for tci, tc := range testCases {
|
||||
|
Reference in New Issue
Block a user