mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #105253 from nilo19/bug/cherry-pick-680
fix: leave the probe path empty for TCP probes
This commit is contained in:
commit
763e528e5b
@ -1643,7 +1643,9 @@ func (az *Cloud) reconcileLoadBalancerRule(
|
|||||||
if probeProtocol == "" {
|
if probeProtocol == "" {
|
||||||
probeProtocol = string(network.ProbeProtocolHTTP)
|
probeProtocol = string(network.ProbeProtocolHTTP)
|
||||||
}
|
}
|
||||||
if requestPath == "" {
|
|
||||||
|
needRequestPath := strings.EqualFold(probeProtocol, string(network.ProbeProtocolHTTP)) || strings.EqualFold(probeProtocol, string(network.ProbeProtocolHTTPS))
|
||||||
|
if requestPath == "" && needRequestPath {
|
||||||
requestPath = podPresencePath
|
requestPath = podPresencePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1726,6 +1726,15 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
|
|||||||
expectedProbes: getDefaultTestProbes("Tcp", ""),
|
expectedProbes: getDefaultTestProbes("Tcp", ""),
|
||||||
expectedRules: getHATestRules(true),
|
expectedRules: getHATestRules(true),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
desc: "reconcileLoadBalancerRule shall leave probe path empty when using TCP probe",
|
||||||
|
service: getTestService("test1", v1.ProtocolTCP, nil, false, 80),
|
||||||
|
loadBalancerSku: "standard",
|
||||||
|
wantLb: true,
|
||||||
|
probeProtocol: "Tcp",
|
||||||
|
expectedProbes: getDefaultTestProbes("Tcp", ""),
|
||||||
|
expectedRules: getDefaultTestRules(true),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for i, test := range testCases {
|
for i, test := range testCases {
|
||||||
az := GetTestCloud(ctrl)
|
az := GetTestCloud(ctrl)
|
||||||
|
Loading…
Reference in New Issue
Block a user