diff --git a/conformance/service_import.go b/conformance/service_import.go index 53c9d0a..1486781 100644 --- a/conformance/service_import.go +++ b/conformance/service_import.go @@ -247,9 +247,12 @@ func testClusterIPServiceImport() { } }) - Specify("should expose the union of the constituent service ports", Label(RequiredLabel), func() { + Specify("should expose the union of the constituent service ports and raise a conflict", Label(RequiredLabel), func() { AddReportEntry(SpecRefReportEntry, "https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/1645-multi-cluster-services-api#service-port") + t.awaitServiceExportCondition(&clients[0], v1alpha1.ServiceExportConditionConflict, metav1.ConditionTrue) + t.awaitServiceExportCondition(&clients[1], v1alpha1.ServiceExportConditionConflict, metav1.ConditionTrue) + t.awaitServiceImport(&clients[0], t.helloService.Name, false, func(g Gomega, serviceImport *v1alpha1.ServiceImport) { g.Expect(sortMCSPorts(serviceImport.Spec.Ports)).To(Equal(toMCSPorts( diff --git a/pkg/apis/v1alpha1/serviceexport.go b/pkg/apis/v1alpha1/serviceexport.go index 94f0f64..4dc58f1 100644 --- a/pkg/apis/v1alpha1/serviceexport.go +++ b/pkg/apis/v1alpha1/serviceexport.go @@ -235,10 +235,8 @@ const ( ServiceExportConditionConflict ServiceExportConditionType = "Conflict" // ServiceExportReasonPortConflict is used with the "Conflict" condition - // when the exported service has a conflict related to port configuration. - // This includes when ports on resulting imported services would have - // duplicated names (including unnamed/empty name) or duplicated - // port/protocol pairs. + // when the exported service has a conflict related to port configuration + // if the ports are not identical in all the constituent Services. ServiceExportReasonPortConflict ServiceExportConditionReason = "PortConflict" // ServiceExportReasonTypeConflict is used with the "Conflict" condition @@ -273,6 +271,13 @@ const ( // condition when the exported service has a conflict related to traffic distribution. ServiceExportReasonTrafficDistributionConflict ServiceExportConditionReason = "TrafficDistributionConflict" + // ServiceExportReasonIPFamilyConflict is used with the "Conflict" condition + // when the exported service has a conflict related to IPFamilies. + // The handling of IP families is implementation-specific but this condition + // must be used if a conflicting IP family may result in network traffic reaching + // only a subset of the backends depending on the IP protocol used. + ServiceExportReasonIPFamilyConflict ServiceExportConditionReason = "IPFamilyConflict" + // ServiceExportReasonNoConflicts is used with the "Conflict" condition // when the condition is False. ServiceExportReasonNoConflicts ServiceExportConditionReason = "NoConflicts"