code: func (node *OsdnNode) watchSubnets() {
  	subnets := make(map[string]*osapi.HostSubnet)
  	eventQueue := node.registry.RunEventQueue(HostSubnets)
  
  	for {
  		eventType, obj, err := eventQueue.Pop()
  		if err != nil {
  			utilruntime.HandleError(fmt.Errorf("EventQueue failed for subnets: %v", err))
  			return
  		}
  		hs := obj.(*osapi.HostSubnet)
  
  		if hs.HostIP == node.localIP {
  			continue
  		}
  
  		log.V(5).Infof("Watch %s event for HostSubnet %q", strings.Title(string(eventType)), hs.ObjectMeta.Name)
  		switch eventType {
  		case watch.Added, watch.Modified:
  			oldSubnet, exists := subnets[string(hs.UID)]
  			if exists {
  				if oldSubnet.HostIP == hs.HostIP {
  					continue
  				} else {
  					// Delete old subnet rules
  					if err := node.DeleteHostSubnetRules(oldSubnet); err != nil {
  						log.Error(err)
  					}
  				}
  			}
  			if err := node.registry.ValidateNodeIP(hs.HostIP); err != nil {
  				log.Errorf("Ignoring invalid subnet for node %s: %v", hs.HostIP, err)
  				continue
  			}
  
  			if err := node.AddHostSubnetRules(hs); err != nil {
  				log.Error(err)
  				continue
  			}
  			subnets[string(hs.UID)] = hs
  		case watch.Deleted:
  			delete(subnets, string(hs.UID))
  
  			if err := node.DeleteHostSubnetRules(hs); err != nil {
  				log.Error(err)
  			}
  		}
  	}
  }
docs: // Only run on the nodes