detect listener config conflicts#2389
Conversation
| return nil | ||
| } | ||
|
|
||
| func (s *Site) CheckLeadListeners(listener *skupperv2alpha1.Listener) bool { |
There was a problem hiding this comment.
Should we only add a listener to leadListeners if that host/port isn’t already claimed? Right now both colliding listeners get added in the first pass, so in the second pass neither is marked as colliding in CheckListener.
There was a problem hiding this comment.
Today when a Listener is created, the resulting Kubernetes Service is labeled with internal.skupper.io/listener = <listener-name>. Actually this is already inefficient today because a Kubernetes service can result of one or more listeners (with same hosts, but different ports).
But the label above has the benefit of determining the source(s) of a service.
Maybe we could, instead, enhance this existing label and store a CSV like: listener1:port1,listener2:port2.
This would help preserving the same state we had before the controller is restarted.
fgiorgetti
left a comment
There was a problem hiding this comment.
Works fine.
Just a suggestion to consider indexing the leadListeners map by host/port instead, to make it simpler. But no objection to the current approach.
fixes #2379