Merge pull request #30904 from rootfs/cinder-prov2

Automatic merge from submit-queue

support storage class in Cinder provisioner

replace #30876

@kubernetes/sig-storage @jsafrane
This commit is contained in:
Kubernetes Submit Queue 2016-08-22 11:06:45 -07:00 committed by GitHub
commit 2f1889a7be
2 changed files with 6 additions and 4 deletions

View File

@ -268,7 +268,7 @@ func TestVolumes(t *testing.T) {
tags := map[string]string{
"test": "value",
}
vol, err := os.CreateVolume("kubernetes-test-volume-"+rand.String(10), 1, &tags)
vol, err := os.CreateVolume("kubernetes-test-volume-"+rand.String(10), 1, "", "", &tags)
if err != nil {
t.Fatalf("Cannot create a new Cinder volume: %v", err)
}

View File

@ -136,7 +136,7 @@ func (os *OpenStack) getVolume(diskName string) (volumes.Volume, error) {
}
// Create a volume of given size (in GiB)
func (os *OpenStack) CreateVolume(name string, size int, tags *map[string]string) (volumeName string, err error) {
func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (volumeName string, err error) {
sClient, err := openstack.NewBlockStorageV1(os.provider, gophercloud.EndpointOpts{
Region: os.region,
@ -148,8 +148,10 @@ func (os *OpenStack) CreateVolume(name string, size int, tags *map[string]string
}
opts := volumes.CreateOpts{
Name: name,
Size: size,
Name: name,
Size: size,
VolumeType: vtype,
Availability: availability,
}
if tags != nil {
opts.Metadata = *tags