code: func primeAggregatedClusterRoles(clusterRolesToAggregate map[string]string, clusterRoleClient rbacv1client.ClusterRolesGetter) error {
  	for oldName, newName := range clusterRolesToAggregate {
  		_, err := clusterRoleClient.ClusterRoles().Get(newName, metav1.GetOptions{})
  		if err == nil {
  			continue
  		}
  		if !apierrors.IsNotFound(err) {
  			return err
  		}
  
  		existingRole, err := clusterRoleClient.ClusterRoles().Get(oldName, metav1.GetOptions{})
  		if apierrors.IsNotFound(err) {
  			continue
  		}
  		if err != nil {
  			return err
  		}
  		if existingRole.AggregationRule != nil {
  			// the old role already moved to an aggregated role, so there are no custom rules to migrate at this point
  			return nil
  		}
  		klog.V(1).Infof("migrating %v to %v", existingRole.Name, newName)
  		existingRole.Name = newName
  		existingRole.ResourceVersion = "" // clear this so the object can be created.
  		if _, err := clusterRoleClient.ClusterRoles().Create(existingRole); err != nil && !apierrors.IsAlreadyExists(err) {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // primeAggregatedClusterRoles copies roles that have transitioned to aggregated roles and may need to pick up changes
  // that were done to the legacy roles.