// Invocation: <driver executable> mount <mount dir> <json options>
// mount persist meta data generated from jsonOptions into a tag file in target dir.
 mount  
mount persist meta data generated from jsonOptions into a tag file in target dir.
// Invocation : <driver executable > mount <mount dir > <json options > // mount persist meta data generated from jsonOptions into a tag file in target dir .
func (d *FlexVolumeDriver) mount(targetMountDir, jsonOptions string) (map[string]interface{}, error) {
	if err := d.initFlexVolumeDriverForMount(jsonOptions); err != nil {
		return nil, err
	}
	if err := attachDisk(d.project, d.zone, d.volId); err != nil {
		return nil, err
	}
	if err := formatDisk(d.volId, d.fsType); err != nil {
		detachDiskLogError(d)
		return nil, err
	}
	optsData := &flexvolume.FlexVolumeOptsData{
		GCEPDData: d.generateOptionsData(),
	}
	if err := flexvolume.WriteJsonOptsFile(targetMountDir, optsData); err != nil {
		os.Remove(targetMountDir)
		detachDiskLogError(d)
		return nil, err
	}
	glog.V(5).Infof("[Mount] GCE PD tag file is created in: %s with data: %s", targetMountDir, optsData)
	return nil, nil
}
func ( d * FlexVolumeDriver ) mount ( targetMountDir , jsonOptions string ) ( map [ string ] interface { } , error ) { if err := d . initFlexVolumeDriverForMount ( jsonOptions ) ; err != nil { return nil , err } if err := attachDisk ( d . project , d . zone , d . volId ) ; err != nil { return nil , err } if err := formatDisk ( d . volId , d . fsType ) ; err != nil { detachDiskLogError ( d ) return nil , err } optsData := & flexvolume . FlexVolumeOptsData { GCEPDData : d . generateOptionsData ( ) , } if err := flexvolume . WriteJsonOptsFile ( targetMountDir , optsData ) ; err != nil { os . Remove ( targetMountDir ) detachDiskLogError ( d ) return nil , err } glog . V ( 5 ) . Infof ( " " , targetMountDir , optsData ) return nil , nil }
mount
mount persist meta data generated from jsonOptions into a tag file in target dir.
mount mount persist meta data generated from jsonOptions into a tag file in target dir .
// Step 1: Attach GCE PD to the instance. // Step 2: Format the device. // Step 3: Create a json file and write metadata into the it.