code: func (op *updateOp) allocateRange(ctx context.Context, sync *NodeSync, node *v1.Node) error {
  	if sync.mode != SyncFromCluster {
  		sync.kubeAPI.EmitNodeWarningEvent(node.Name, InvalidModeEvent,
  			"Cannot allocate CIDRs in mode %q", sync.mode)
  		return fmt.Errorf("controller cannot allocate CIDRS in mode %q", sync.mode)
  	}
  
  	cidrRange, err := sync.set.AllocateNext()
  	if err != nil {
  		return err
  	}
  	// If addAlias returns a hard error, cidrRange will be leaked as there
  	// is no durable record of the range. The missing space will be
  	// recovered on the next restart of the controller.
  	if err := sync.cloudAlias.AddAlias(ctx, node.Name, cidrRange); err != nil {
  		klog.Errorf("Could not add alias %v for node %q: %v", cidrRange, node.Name, err)
  		return err
  	}
  
  	if err := sync.kubeAPI.UpdateNodePodCIDR(ctx, node, cidrRange); err != nil {
  		klog.Errorf("Could not update node %q PodCIDR to %v: %v", node.Name, cidrRange, err)
  		return err
  	}
  
  	if err := sync.kubeAPI.UpdateNodeNetworkUnavailable(node.Name, false); err != nil {
  		klog.Errorf("Could not update node NetworkUnavailable status to false: %v", err)
  		return err
  	}
  
  	klog.V(2).Infof("Allocated PodCIDR %v for node %q", cidrRange, node.Name)
  
  	return nil
  }
docs: // allocateRange allocates a new range and updates both the cloud
  // platform and the node allocation.