Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.24] Deprecate numberOfProbes and adopt ProbeThreshold to address a probe issue in nrp #3658

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/provider/azure_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,7 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port
return nil, fmt.Errorf("total probe should be less than 120, please adjust interval and number of probe accordingly")
}
properties.IntervalInSeconds = probeInterval
properties.NumberOfProbes = numberOfProbes
properties.ProbeThreshold = numberOfProbes
probe := &network.Probe{
Name: &lbrule,
ProbePropertiesFormat: properties,
Expand Down Expand Up @@ -2296,7 +2296,7 @@ func (az *Cloud) getExpectedLBRules(
Protocol: network.ProbeProtocolHTTP,
Port: pointer.Int32(podPresencePort),
IntervalInSeconds: pointer.Int32(consts.HealthProbeDefaultProbeInterval),
NumberOfProbes: pointer.Int32(consts.HealthProbeDefaultNumOfProbe),
ProbeThreshold: pointer.Int32(consts.HealthProbeDefaultNumOfProbe),
},
}
expectedProbes = append(expectedProbes, *nodeEndpointHealthprobe)
Expand Down Expand Up @@ -3259,7 +3259,7 @@ func findProbe(probes []network.Probe, probe network.Probe) bool {
strings.EqualFold(string(existingProbe.Protocol), string(probe.Protocol)) &&
strings.EqualFold(pointer.StringDeref(existingProbe.RequestPath, ""), pointer.StringDeref(probe.RequestPath, "")) &&
pointer.Int32Deref(existingProbe.IntervalInSeconds, 0) == pointer.Int32Deref(probe.IntervalInSeconds, 0) &&
pointer.Int32Deref(existingProbe.NumberOfProbes, 0) == pointer.Int32Deref(probe.NumberOfProbes, 0) {
pointer.Int32Deref(existingProbe.ProbeThreshold, 0) == pointer.Int32Deref(probe.ProbeThreshold, 0) {
return true
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/provider/azure_loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2654,7 +2654,7 @@ func getTestProbe(protocol, path string, interval, servicePort, probePort, numOf
Protocol: network.ProbeProtocol(protocol),
Port: probePort,
IntervalInSeconds: interval,
NumberOfProbes: numOfProbe,
ProbeThreshold: numOfProbe,
},
}
if (strings.EqualFold(protocol, "Http") || strings.EqualFold(protocol, "Https")) && len(strings.TrimSpace(path)) > 0 {
Expand Down Expand Up @@ -2799,7 +2799,7 @@ func getTestLoadBalancer(name, rgName, clusterName, identifier *string, service
Port: pointer.Int32(10080),
Protocol: network.ProbeProtocolTCP,
IntervalInSeconds: pointer.Int32(5),
NumberOfProbes: pointer.Int32(2),
ProbeThreshold: pointer.Int32(2),
},
},
},
Expand Down Expand Up @@ -3072,7 +3072,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
RequestPath: pointer.String("/healthz"),
Protocol: network.ProbeProtocolHTTP,
IntervalInSeconds: pointer.Int32(5),
NumberOfProbes: pointer.Int32(2),
ProbeThreshold: pointer.Int32(2),
},
},
}
Expand Down Expand Up @@ -3100,7 +3100,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
Port: pointer.Int32(10080),
Protocol: network.ProbeProtocolTCP,
IntervalInSeconds: pointer.Int32(5),
NumberOfProbes: pointer.Int32(2),
ProbeThreshold: pointer.Int32(2),
},
},
}
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/network/service_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ var _ = Describe("Service with annotation", Label(utils.TestSuiteLabelServiceAnn
By("Validating health probe configs")
var numberOfProbes *int32
for _, probe := range targetProbes {
if probe.NumberOfProbes != nil {
numberOfProbes = probe.NumberOfProbes
if probe.ProbeThreshold != nil {
numberOfProbes = probe.ProbeThreshold
}
}
Expect(*numberOfProbes).To(Equal(int32(3)))
Expand Down Expand Up @@ -663,8 +663,8 @@ var _ = Describe("Service with annotation", Label(utils.TestSuiteLabelServiceAnn
var numberOfProbes *int32
var intervalInSeconds *int32
for _, probe := range targetProbes {
if probe.NumberOfProbes != nil {
numberOfProbes = probe.NumberOfProbes
if probe.ProbeThreshold != nil {
numberOfProbes = probe.ProbeThreshold
}
if probe.IntervalInSeconds != nil {
intervalInSeconds = probe.IntervalInSeconds
Expand Down