code: func (m *ReplicaSetControllerRefManager) AdoptReplicaSet(rs *apps.ReplicaSet) error {
  	if err := m.CanAdopt(); err != nil {
  		return fmt.Errorf("can't adopt ReplicaSet %v/%v (%v): %v", rs.Namespace, rs.Name, rs.UID, err)
  	}
  	// Note that ValidateOwnerReferences() will reject this patch if another
  	// OwnerReference exists with controller=true.
  	addControllerPatch := fmt.Sprintf(
  		`{"metadata":{"ownerReferences":[{"apiVersion":"%s","kind":"%s","name":"%s","uid":"%s","controller":true,"blockOwnerDeletion":true}],"uid":"%s"}}`,
  		m.controllerKind.GroupVersion(), m.controllerKind.Kind,
  		m.Controller.GetName(), m.Controller.GetUID(), rs.UID)
  	return m.rsControl.PatchReplicaSet(rs.Namespace, rs.Name, []byte(addControllerPatch))
  }
docs: // AdoptReplicaSet sends a patch to take control of the ReplicaSet. It returns
  // the error if the patching fails.