Merge pull request #109782 from danwinship/no-local-endpoints-metric

Don't increment "no local endpoints" metric when there are no remote endpoints
This commit is contained in:
Kubernetes Prow Robot
2022-05-05 05:02:20 -07:00
committed by GitHub
4 changed files with 32 additions and 21 deletions

View File

@@ -7743,6 +7743,14 @@ func TestNoEndpointsMetric(t *testing.T) {
expectedSyncProxyRulesNoLocalEndpointsTotalInternal: 1,
expectedSyncProxyRulesNoLocalEndpointsTotalExternal: 1,
},
{
name: "both policies are set and there are no endpoints at all",
internalTrafficPolicy: &internalTrafficPolicyLocal,
externalTrafficPolicy: externalTrafficPolicyLocal,
endpoints: []endpoint{},
expectedSyncProxyRulesNoLocalEndpointsTotalInternal: 0,
expectedSyncProxyRulesNoLocalEndpointsTotalExternal: 0,
},
}
for _, tc := range testCases {