mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +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 == "" {
|
||||
probeProtocol = string(network.ProbeProtocolHTTP)
|
||||
}
|
||||
if requestPath == "" {
|
||||
|
||||
needRequestPath := strings.EqualFold(probeProtocol, string(network.ProbeProtocolHTTP)) || strings.EqualFold(probeProtocol, string(network.ProbeProtocolHTTPS))
|
||||
if requestPath == "" && needRequestPath {
|
||||
requestPath = podPresencePath
|
||||
}
|
||||
|
||||
|
@ -1726,6 +1726,15 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
|
||||
expectedProbes: getDefaultTestProbes("Tcp", ""),
|
||||
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 {
|
||||
az := GetTestCloud(ctrl)
|
||||
|
Loading…
Reference in New Issue
Block a user