Skip to content

Commit babfac4

Browse files
committed
apis: conformance: add more conflict condition on asymetrical traffic
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
1 parent a93ef01 commit babfac4

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
@@ -214,9 +214,12 @@ func testClusterIPServiceImport() {
214214
}
215215
})
216216

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

220+
t.awaitServiceExportCondition(&clients[0], v1alpha1.ServiceExportConditionConflict, metav1.ConditionTrue)
221+
t.awaitServiceExportCondition(&clients[1], v1alpha1.ServiceExportConditionConflict, metav1.ConditionTrue)
222+
220223
t.awaitServiceImport(&clients[0], t.helloService.Name, false,
221224
func(g Gomega, serviceImport *v1alpha1.ServiceImport) {
222225
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
@@ -265,6 +263,13 @@ const (
265263
// annotations.
266264
ServiceExportReasonAnnotationsConflict ServiceExportConditionReason = "AnnotationsConflict"
267265

266+
// ServiceExportReasonIPFamilyConflict is used with the "Conflict" condition
267+
// when the exported service has a conflict related to IPFamilies conflicting.
268+
// IPFamilies handling is implemnetation specific but implementations may
269+
// used when conflicting IPFamily may result in network traffic reaching
270+
// only a subset of the backends depending on the IP protocol used.
271+
ServiceExportReasonIPFamilyConflict ServiceExportConditionReason = "IPFamilyConflict"
272+
268273
// ServiceExportReasonNoConflicts is used with the "Conflict" condition
269274
// when the condition is False.
270275
ServiceExportReasonNoConflicts ServiceExportConditionReason = "NoConflicts"

0 commit comments

Comments
 (0)