Skip to content

Commit 8f463b7

Browse files
committed
apis: conformance: add more conflict condition on asymetrical traffic
Signed-off-by: Arthur Outhenin-Chalandre <git@mrfreezeex.fr>
1 parent e481ae7 commit 8f463b7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

conformance/service_import.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,12 @@ func testClusterIPServiceImport() {
247247
}
248248
})
249249

250-
Specify("should expose the union of the constituent service ports", Label(RequiredLabel), func() {
250+
Specify("should expose the union of the constituent service ports and raise a conflict", Label(RequiredLabel), func() {
251251
AddReportEntry(SpecRefReportEntry, "https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/1645-multi-cluster-services-api#service-port")
252252

253+
t.awaitServiceExportCondition(&clients[0], v1alpha1.ServiceExportConditionConflict, metav1.ConditionTrue)
254+
t.awaitServiceExportCondition(&clients[1], v1alpha1.ServiceExportConditionConflict, metav1.ConditionTrue)
255+
253256
t.awaitServiceImport(&clients[0], t.helloService.Name, false,
254257
func(g Gomega, serviceImport *v1alpha1.ServiceImport) {
255258
g.Expect(sortMCSPorts(serviceImport.Spec.Ports)).To(Equal(toMCSPorts(

pkg/apis/v1alpha1/serviceexport.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,8 @@ const (
235235
ServiceExportConditionConflict ServiceExportConditionType = "Conflict"
236236

237237
// ServiceExportReasonPortConflict is used with the "Conflict" condition
238-
// when the exported service has a conflict related to port configuration.
239-
// This includes when ports on resulting imported services would have
240-
// duplicated names (including unnamed/empty name) or duplicated
241-
// port/protocol pairs.
238+
// when the exported service has a conflict related to port configuration
239+
// if the ports are not identical in all the constituent Services.
242240
ServiceExportReasonPortConflict ServiceExportConditionReason = "PortConflict"
243241

244242
// ServiceExportReasonTypeConflict is used with the "Conflict" condition
@@ -273,6 +271,13 @@ const (
273271
// condition when the exported service has a conflict related to traffic distribution.
274272
ServiceExportReasonTrafficDistributionConflict ServiceExportConditionReason = "TrafficDistributionConflict"
275273

274+
// ServiceExportReasonIPFamilyConflict is used with the "Conflict" condition
275+
// when the exported service has a conflict related to IPFamilies.
276+
// The handling of IP families is implementation-specific but this condition
277+
// must be used if a conflicting IP family may result in network traffic reaching
278+
// only a subset of the backends depending on the IP protocol used.
279+
ServiceExportReasonIPFamilyConflict ServiceExportConditionReason = "IPFamilyConflict"
280+
276281
// ServiceExportReasonNoConflicts is used with the "Conflict" condition
277282
// when the condition is False.
278283
ServiceExportReasonNoConflicts ServiceExportConditionReason = "NoConflicts"

0 commit comments

Comments
 (0)