Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion conformance/service_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 9 additions & 4 deletions pkg/apis/v1alpha1/serviceexport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down