code: func (dc *DeploymentController) addReplicaSet(obj interface{}) {
  	rs := obj.(*apps.ReplicaSet)
  
  	if rs.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.
  		dc.deleteReplicaSet(rs)
  		return
  	}
  
  	// If it has a ControllerRef, that's all that matters.
  	if controllerRef := metav1.GetControllerOf(rs); controllerRef != nil {
  		d := dc.resolveControllerRef(rs.Namespace, controllerRef)
  		if d == nil {
  			return
  		}
  		klog.V(4).Infof("ReplicaSet %s added.", rs.Name)
  		dc.enqueueDeployment(d)
  		return
  	}
  
  	// Otherwise, it's an orphan. Get a list of all matching Deployments and sync
  	// them to see if anyone wants to adopt it.
  	ds := dc.getDeploymentsForReplicaSet(rs)
  	if len(ds) == 0 {
  		return
  	}
  	klog.V(4).Infof("Orphan ReplicaSet %s added.", rs.Name)
  	for _, d := range ds {
  		dc.enqueueDeployment(d)
  	}
  }
docs: // addReplicaSet enqueues the deployment that manages a ReplicaSet when the ReplicaSet is created.