Handle conflicting service ports when merging per MCS spec #1645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The spec states that if the properties of service ports between clusters don't match, the clusterset service should expose the union of the ports. We're doing this however we're not properly handle conflicts as per the spec. If multiple clusters have a matching port by name but the other properties don't match, it should be considered a conflict and the conflict resolution policy should be applied, ie the port from the cluster with the oldest export timestamp should be used. When merging, we need to sort the ports by cluster timestamp and use just the port name when computing the union rather than all the port properties as we did before.
Also when checking for conflicts, we should also check the
AppProtocol
property.