code: func (h *hostportSyncer) OpenPodHostportsAndSync(newPortMapping *PodPortMapping, natInterfaceName string, activePodPortMappings []*PodPortMapping) error {
  	// try to open pod host port if specified
  	if err := h.openHostports(newPortMapping); err != nil {
  		return err
  	}
  
  	// Add the new pod to active pods if it's not present.
  	var found bool
  	for _, pm := range activePodPortMappings {
  		if pm.Namespace == newPortMapping.Namespace && pm.Name == newPortMapping.Name {
  			found = true
  			break
  		}
  	}
  	if !found {
  		activePodPortMappings = append(activePodPortMappings, newPortMapping)
  	}
  
  	return h.SyncHostports(natInterfaceName, activePodPortMappings)
  }
docs: // OpenPodHostportsAndSync opens hostports for a new PodPortMapping, gathers all hostports on
  // node, sets up iptables rules enable them. And finally clean up stale hostports.
  // 'newPortMapping' must also be present in 'activePodPortMappings'.