mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 18:37:15 +00:00
migrate proxy.UpdateServiceMap to be a method of ServiceMap
This commit is contained in:
@@ -292,15 +292,15 @@ type UpdateServiceMapResult struct {
|
||||
UDPStaleClusterIP sets.String
|
||||
}
|
||||
|
||||
// UpdateServiceMap updates ServiceMap based on the given changes.
|
||||
func UpdateServiceMap(serviceMap ServiceMap, changes *ServiceChangeTracker) (result UpdateServiceMapResult) {
|
||||
// Update updates ServiceMap base on the given changes.
|
||||
func (sm ServiceMap) Update(changes *ServiceChangeTracker) (result UpdateServiceMapResult) {
|
||||
result.UDPStaleClusterIP = sets.NewString()
|
||||
serviceMap.apply(changes, result.UDPStaleClusterIP)
|
||||
sm.apply(changes, result.UDPStaleClusterIP)
|
||||
|
||||
// TODO: If this will appear to be computationally expensive, consider
|
||||
// computing this incrementally similarly to serviceMap.
|
||||
result.HCServiceNodePorts = make(map[types.NamespacedName]uint16)
|
||||
for svcPortName, info := range serviceMap {
|
||||
for svcPortName, info := range sm {
|
||||
if info.HealthCheckNodePort() != 0 {
|
||||
result.HCServiceNodePorts[svcPortName.NamespacedName] = uint16(info.HealthCheckNodePort())
|
||||
}
|
||||
|
Reference in New Issue
Block a user