code: func (dsc *DaemonSetsController) addHistory(obj interface{}) {
  	history := obj.(*apps.ControllerRevision)
  	if history.DeletionTimestamp != nil {
  		// On a restart of the controller manager, it's possible for an object to
  		// show up in a state that is already pending deletion.
  		dsc.deleteHistory(history)
  		return
  	}
  
  	// If it has a ControllerRef, that's all that matters.
  	if controllerRef := metav1.GetControllerOf(history); controllerRef != nil {
  		ds := dsc.resolveControllerRef(history.Namespace, controllerRef)
  		if ds == nil {
  			return
  		}
  		klog.V(4).Infof("ControllerRevision %s added.", history.Name)
  		return
  	}
  
  	// Otherwise, it's an orphan. Get a list of all matching DaemonSets and sync
  	// them to see if anyone wants to adopt it.
  	daemonSets := dsc.getDaemonSetsForHistory(history)
  	if len(daemonSets) == 0 {
  		return
  	}
  	klog.V(4).Infof("Orphan ControllerRevision %s added.", history.Name)
  	for _, ds := range daemonSets {
  		dsc.enqueueDaemonSet(ds)
  	}
  }
docs: // addHistory enqueues the DaemonSet that manages a ControllerRevision when the ControllerRevision is created
  // or when the controller manager is restarted.