Skip to content

Commit

Permalink
deprecate numberOfProbes and adopt ProbeThreshold to address a probe …
Browse files Browse the repository at this point in the history
…issue in nrp
  • Loading branch information
MartinForReal committed Mar 23, 2023
1 parent 3232c34 commit 2c0aba3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pkg/provider/azure_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,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 @@ -2280,7 +2280,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 @@ -3243,7 +3243,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
4 changes: 2 additions & 2 deletions tests/e2e/network/service_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,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
git if probe.ProbeThreshold != nil {
numberOfProbes = probe.ProbeThreshold
}
if probe.IntervalInSeconds != nil {
intervalInSeconds = probe.IntervalInSeconds
Expand Down

0 comments on commit 2c0aba3

Please sign in to comment.