code: func (g *Cloud) AttachDisk(diskName string, nodeName types.NodeName, readOnly bool, regional bool) error {
  	instanceName := mapNodeNameToInstanceName(nodeName)
  	instance, err := g.getInstanceByName(instanceName)
  	if err != nil {
  		return fmt.Errorf("error getting instance %q", instanceName)
  	}
  
  	// Try fetching as regional PD
  	var disk *Disk
  	var mc *metricContext
  	if regional && utilfeature.DefaultFeatureGate.Enabled(cloudfeatures.GCERegionalPersistentDisk) {
  		disk, err = g.getRegionalDiskByName(diskName)
  		if err != nil {
  			return err
  		}
  		mc = newDiskMetricContextRegional("attach", g.region)
  	} else {
  		disk, err = g.getDiskByName(diskName, instance.Zone)
  		if err != nil {
  			return err
  		}
  		mc = newDiskMetricContextZonal("attach", g.region, instance.Zone)
  	}
  
  	readWrite := "READ_WRITE"
  	if readOnly {
  		readWrite = "READ_ONLY"
  	}
  
  	return mc.Observe(g.manager.AttachDiskOnCloudProvider(disk, readWrite, instance.Zone, instance.Name))
  }
docs: // AttachDisk attaches given disk to the node with the specified NodeName.
  // Current instance is used when instanceID is empty string.