// createVolume creates a ZFS dataset and returns its mount path
createVolume creates a ZFS dataset and returns its mount path
// createVolume creates a ZFS dataset and returns its mount path
func (p ZFSProvisioner) createVolume(options controller.VolumeOptions) (string, error) {
	zfsPath := p.parent.Name + "/" + options.PVName
	properties := make(map[string]string)
	properties["sharenfs"] = p.shareOptions
	storageRequest := options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
	storageRequestBytes := strconv.FormatInt(storageRequest.Value(), 10)
	properties["refquota"] = storageRequestBytes
	properties["refreservation"] = storageRequestBytes
	dataset, err := zfs.CreateFilesystem(zfsPath, properties)
	if err != nil {
		return "", fmt.Errorf("Creating ZFS dataset failed with: %v", err.Error())
	}
	return dataset.Mountpoint, nil
}
func ( p ZFSProvisioner ) createVolume ( options controller . VolumeOptions ) ( string , error ) { zfsPath := p . parent . Name + " " + options . PVName properties := make ( map [ string ] string ) properties [ " " ] = p . shareOptions storageRequest := options . PVC . Spec . Resources . Requests [ v1 . ResourceName ( v1 . ResourceStorage ) ] storageRequestBytes := strconv . FormatInt ( storageRequest . Value ( ) , 10 ) properties [ " " ] = storageRequestBytes properties [ " " ] = storageRequestBytes dataset , err := zfs . CreateFilesystem ( zfsPath , properties ) if err != nil { return " " , fmt . Errorf ( " " , err . Error ( ) ) } return dataset . Mountpoint , nil }
createVolume creates a ZFS dataset and returns its mount path
createVolume creates a ZFS dataset and returns its mount path