code: func (g *Cloud) DiskIsAttached(diskName string, nodeName types.NodeName) (bool, error) {
  	instanceName := mapNodeNameToInstanceName(nodeName)
  	instance, err := g.getInstanceByName(instanceName)
  	if err != nil {
  		if err == cloudprovider.InstanceNotFound {
  			// If instance no longer exists, safe to assume volume is not attached.
  			klog.Warningf(
  				"Instance %q does not exist. DiskIsAttached will assume PD %q is not attached to it.",
  				instanceName,
  				diskName)
  			return false, nil
  		}
  
  		return false, err
  	}
  
  	for _, disk := range instance.Disks {
  		if disk.DeviceName == diskName {
  			// Disk is still attached to node
  			return true, nil
  		}
  	}
  
  	return false, nil
  }
docs: // DiskIsAttached checks if a disk is attached to the node with the specified NodeName.