fix: correct init volume gatherer in openstack (#11481)
This commit is contained in:
parent
4766d0cbaf
commit
c984cd87fe
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue