code: func (l *SSHTunnelList) Update(addrs []string) {
  	haveAddrsMap := make(map[string]bool)
  	wantAddrsMap := make(map[string]bool)
  	func() {
  		l.tunnelsLock.Lock()
  		defer l.tunnelsLock.Unlock()
  		// Build a map of what we currently have.
  		for i := range l.entries {
  			haveAddrsMap[l.entries[i].Address] = true
  		}
  		// Determine any necessary additions.
  		for i := range addrs {
  			// Add tunnel if it is not in l.entries or l.adding
  			if _, ok := haveAddrsMap[addrs[i]]; !ok {
  				if _, ok := l.adding[addrs[i]]; !ok {
  					l.adding[addrs[i]] = true
  					addr := addrs[i]
  					go func() {
  						defer runtime.HandleCrash()
  						// Actually adding tunnel to list will block until lock
  						// is released after deletions.
  						l.createAndAddTunnel(addr)
  					}()
  				}
  			}
  			wantAddrsMap[addrs[i]] = true
  		}
  		// Determine any necessary deletions.
  		var newEntries []sshTunnelEntry
  		for i := range l.entries {
  			if _, ok := wantAddrsMap[l.entries[i].Address]; !ok {
  				tunnelEntry := l.entries[i]
  				klog.Infof("Removing tunnel to deleted node at %q", tunnelEntry.Address)
  				go func() {
  					defer runtime.HandleCrash()
  					if err := tunnelEntry.Tunnel.Close(); err != nil {
  						klog.Errorf("Failed to close tunnel to %q: %v", tunnelEntry.Address, err)
  					}
  				}()
  			} else {
  				newEntries = append(newEntries, l.entries[i])
  			}
  		}
  		l.entries = newEntries
  	}()
  }
docs: // Update reconciles the list's entries with the specified addresses. Existing
  // tunnels that are not in addresses are removed from entries and closed in a
  // background goroutine. New tunnels specified in addresses are opened in a
  // background goroutine and then added to entries.