Added test where both policies are set
This commit is contained in:
@@ -6087,6 +6087,16 @@ func TestNoEndpointsMetric(t *testing.T) {
|
||||
{"10.0.1.3", "host2"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "both policies are set and there is non-zero local endpoints",
|
||||
internalTrafficPolicy: &internalTrafficPolicyLocal,
|
||||
externalTrafficPolicy: externalTrafficPolicyLocal,
|
||||
endpoints: []endpoint{
|
||||
{"10.0.1.1", testHostname},
|
||||
{"10.0.1.2", "host1"},
|
||||
{"10.0.1.3", "host2"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "internalTrafficPolicy is set and there is zero local endpoint",
|
||||
internalTrafficPolicy: &internalTrafficPolicyLocal,
|
||||
@@ -6107,6 +6117,18 @@ func TestNoEndpointsMetric(t *testing.T) {
|
||||
},
|
||||
expectedSyncProxyRulesNoLocalEndpointsTotalExternal: 1,
|
||||
},
|
||||
{
|
||||
name: "both policies are set and there is zero local endpoint",
|
||||
internalTrafficPolicy: &internalTrafficPolicyLocal,
|
||||
externalTrafficPolicy: externalTrafficPolicyLocal,
|
||||
endpoints: []endpoint{
|
||||
{"10.0.1.1", "host0"},
|
||||
{"10.0.1.2", "host1"},
|
||||
{"10.0.1.3", "host2"},
|
||||
},
|
||||
expectedSyncProxyRulesNoLocalEndpointsTotalInternal: 1,
|
||||
expectedSyncProxyRulesNoLocalEndpointsTotalExternal: 1,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
Reference in New Issue
Block a user