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:
commit
2f1889a7be
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue