fix: correct init volume gatherer in openstack (#11481)

This commit is contained in:
Joshua Powers 2022-07-18 13:03:41 -06:00 committed by GitHub
parent 4766d0cbaf
commit c984cd87fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ Collects the metrics from following services of OpenStack:
At present this plugin requires the following APIs:
* blockstorage v2
* blockstorage v3
* compute v2
* identity v3
* networking v2

View File

@ -23,7 +23,7 @@ import (
"github.com/gophercloud/gophercloud/openstack"
"github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/schedulerstats"
"github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/volumetenants"
"github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
"github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/aggregates"
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/diagnostics"
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/hypervisors"
@ -185,9 +185,9 @@ func (o *OpenStack) Init() error {
}
// The Cinder volume storage service is optional
if o.containsService("volumev2") {
if o.volume, err = openstack.NewBlockStorageV2(provider, gophercloud.EndpointOpts{}); err != nil {
return fmt.Errorf("unable to create V2 volume client %v", err)
if o.containsService("volumev3") {
if o.volume, err = openstack.NewBlockStorageV3(provider, gophercloud.EndpointOpts{}); err != nil {
return fmt.Errorf("unable to create V3 volume client %v", err)
}
}