code: func (ssc *StatefulSetController) adoptOrphanRevisions(set *apps.StatefulSet) error {
  	revisions, err := ssc.control.ListRevisions(set)
  	if err != nil {
  		return err
  	}
  	hasOrphans := false
  	for i := range revisions {
  		if metav1.GetControllerOf(revisions[i]) == nil {
  			hasOrphans = true
  			break
  		}
  	}
  	if hasOrphans {
  		fresh, err := ssc.kubeClient.AppsV1().StatefulSets(set.Namespace).Get(set.Name, metav1.GetOptions{})
  		if err != nil {
  			return err
  		}
  		if fresh.UID != set.UID {
  			return fmt.Errorf("original StatefulSet %v/%v is gone: got uid %v, wanted %v", set.Namespace, set.Name, fresh.UID, set.UID)
  		}
  		return ssc.control.AdoptOrphanRevisions(set, revisions)
  	}
  	return nil
  }
docs: // adoptOrphanRevisions adopts any orphaned ControllerRevisions matched by set's Selector.