@@ -158,10 +158,10 @@ func getZonesFromNodes(kubeClient clientset.Interface) (sets.String, error) {
158158 return zones , nil
159159}
160160
161- func (util * CinderDiskUtil ) CreateVolume (c * cinderVolumeProvisioner ) (volumeID string , volumeSizeGB int , volumeLabels map [string ]string , err error ) {
161+ func (util * CinderDiskUtil ) CreateVolume (c * cinderVolumeProvisioner ) (volumeID string , volumeSizeGB int , volumeLabels map [string ]string , fstype string , err error ) {
162162 cloud , err := c .plugin .getCloudProvider ()
163163 if err != nil {
164- return "" , 0 , nil , err
164+ return "" , 0 , nil , "" , err
165165 }
166166
167167 capacity := c .options .PVC .Spec .Resources .Requests [v1 .ResourceName (v1 .ResourceStorage )]
@@ -179,21 +179,23 @@ func (util *CinderDiskUtil) CreateVolume(c *cinderVolumeProvisioner) (volumeID s
179179 vtype = v
180180 case "availability" :
181181 availability = v
182+ case volume .VolumeParameterFSType :
183+ fstype = v
182184 default :
183- return "" , 0 , nil , fmt .Errorf ("invalid option %q for volume plugin %s" , k , c .plugin .GetPluginName ())
185+ return "" , 0 , nil , "" , fmt .Errorf ("invalid option %q for volume plugin %s" , k , c .plugin .GetPluginName ())
184186 }
185187 }
186188 // TODO: implement PVC.Selector parsing
187189 if c .options .PVC .Spec .Selector != nil {
188- return "" , 0 , nil , fmt .Errorf ("claim.Spec.Selector is not supported for dynamic provisioning on Cinder" )
190+ return "" , 0 , nil , "" , fmt .Errorf ("claim.Spec.Selector is not supported for dynamic provisioning on Cinder" )
189191 }
190192
191193 if availability == "" {
192194 // No zone specified, choose one randomly in the same region
193195 zones , err := getZonesFromNodes (c .plugin .host .GetKubeClient ())
194196 if err != nil {
195197 glog .V (2 ).Infof ("error getting zone information: %v" , err )
196- return "" , 0 , nil , err
198+ return "" , 0 , nil , "" , err
197199 }
198200 // if we did not get any zones, lets leave it blank and gophercloud will
199201 // use zone "nova" as default
@@ -205,15 +207,15 @@ func (util *CinderDiskUtil) CreateVolume(c *cinderVolumeProvisioner) (volumeID s
205207 volumeID , volumeAZ , errr := cloud .CreateVolume (name , volSizeGB , vtype , availability , c .options .CloudTags )
206208 if errr != nil {
207209 glog .V (2 ).Infof ("Error creating cinder volume: %v" , errr )
208- return "" , 0 , nil , errr
210+ return "" , 0 , nil , "" , errr
209211 }
210212 glog .V (2 ).Infof ("Successfully created cinder volume %s" , volumeID )
211213
212214 // these are needed that pod is spawning to same AZ
213215 volumeLabels = make (map [string ]string )
214216 volumeLabels [kubeletapis .LabelZoneFailureDomain ] = volumeAZ
215217
216- return volumeID , volSizeGB , volumeLabels , nil
218+ return volumeID , volSizeGB , volumeLabels , fstype , nil
217219}
218220
219221func probeAttachedVolume () error {
0 commit comments