mirror of https://github.com/kubernetes/kops.git
upgrade to cinder v3 to use api
This commit is contained in:
parent
5e4c48bbeb
commit
bdaeb6df36
|
|
@ -21,7 +21,7 @@ go_library(
|
||||||
"//pkg/resources:go_default_library",
|
"//pkg/resources:go_default_library",
|
||||||
"//upup/pkg/fi:go_default_library",
|
"//upup/pkg/fi:go_default_library",
|
||||||
"//upup/pkg/fi/cloudup/openstack:go_default_library",
|
"//upup/pkg/fi/cloudup/openstack:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/dns/v2/recordsets:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/dns/v2/recordsets:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/dns/v2/zones:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/dns/v2/zones:go_default_library",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
package openstack
|
package openstack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
|
cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
|
||||||
"k8s.io/kops/pkg/resources"
|
"k8s.io/kops/pkg/resources"
|
||||||
"k8s.io/kops/upup/pkg/fi"
|
"k8s.io/kops/upup/pkg/fi"
|
||||||
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
|
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ go_library(
|
||||||
"//vendor/github.com/denverdino/aliyungo/ecs:go_default_library",
|
"//vendor/github.com/denverdino/aliyungo/ecs:go_default_library",
|
||||||
"//vendor/github.com/denverdino/aliyungo/metadata:go_default_library",
|
"//vendor/github.com/denverdino/aliyungo/metadata:go_default_library",
|
||||||
"//vendor/github.com/digitalocean/godo:go_default_library",
|
"//vendor/github.com/digitalocean/godo:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach:go_default_library",
|
||||||
"//vendor/google.golang.org/api/compute/v1:go_default_library",
|
"//vendor/google.golang.org/api/compute/v1:go_default_library",
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
cinderv2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
|
cinderv3 "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
|
||||||
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach"
|
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
"k8s.io/kops/protokube/pkg/etcd"
|
"k8s.io/kops/protokube/pkg/etcd"
|
||||||
|
|
@ -192,7 +192,7 @@ func (a *OpenstackVolumes) discoverTags() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *OpenstackVolumes) buildOpenstackVolume(d *cinderv2.Volume) (*Volume, error) {
|
func (v *OpenstackVolumes) buildOpenstackVolume(d *cinderv3.Volume) (*Volume, error) {
|
||||||
volumeName := d.Name
|
volumeName := d.Name
|
||||||
vol := &Volume{
|
vol := &Volume{
|
||||||
ID: d.ID,
|
ID: d.ID,
|
||||||
|
|
@ -231,7 +231,7 @@ func (v *OpenstackVolumes) FindVolumes() ([]*Volume, error) {
|
||||||
|
|
||||||
klog.V(2).Infof("Listing Openstack disks in %s/%s", v.project, v.meta.AvailabilityZone)
|
klog.V(2).Infof("Listing Openstack disks in %s/%s", v.project, v.meta.AvailabilityZone)
|
||||||
|
|
||||||
vols, err := v.cloud.ListVolumes(cinderv2.ListOpts{
|
vols, err := v.cloud.ListVolumes(cinderv3.ListOpts{
|
||||||
TenantID: v.project,
|
TenantID: v.project,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ go_library(
|
||||||
"//util/pkg/vfs:go_default_library",
|
"//util/pkg/vfs:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs:go_default_library",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
"github.com/gophercloud/gophercloud"
|
"github.com/gophercloud/gophercloud"
|
||||||
os "github.com/gophercloud/gophercloud/openstack"
|
os "github.com/gophercloud/gophercloud/openstack"
|
||||||
cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
|
cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
|
||||||
az "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones"
|
az "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones"
|
||||||
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips"
|
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips"
|
||||||
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs"
|
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs"
|
||||||
|
|
@ -355,9 +355,8 @@ func NewOpenstackCloud(tags map[string]string, spec *kops.ClusterSpec) (Openstac
|
||||||
return nil, fmt.Errorf("error building openstack authenticated client: %v", err)
|
return nil, fmt.Errorf("error building openstack authenticated client: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: maybe try v2, and v3?
|
cinderClient, err := os.NewBlockStorageV3(provider, gophercloud.EndpointOpts{
|
||||||
cinderClient, err := os.NewBlockStorageV2(provider, gophercloud.EndpointOpts{
|
Type: "volumev3",
|
||||||
Type: "volumev2",
|
|
||||||
Region: region,
|
Region: region,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
cinderv2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
|
cinderv3 "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
"k8s.io/kops/pkg/apis/kops"
|
"k8s.io/kops/pkg/apis/kops"
|
||||||
"k8s.io/kops/protokube/pkg/etcd"
|
"k8s.io/kops/protokube/pkg/etcd"
|
||||||
|
|
@ -57,7 +57,7 @@ func (c *openstackCloud) FindClusterStatus(cluster *kops.Cluster) (*kops.Cluster
|
||||||
func findEtcdStatus(c *openstackCloud, cluster *kops.Cluster) ([]kops.EtcdClusterStatus, error) {
|
func findEtcdStatus(c *openstackCloud, cluster *kops.Cluster) ([]kops.EtcdClusterStatus, error) {
|
||||||
statusMap := make(map[string]*kops.EtcdClusterStatus)
|
statusMap := make(map[string]*kops.EtcdClusterStatus)
|
||||||
klog.V(2).Infof("Querying Openstack for etcd volumes")
|
klog.V(2).Infof("Querying Openstack for etcd volumes")
|
||||||
opt := cinderv2.ListOpts{
|
opt := cinderv3.ListOpts{
|
||||||
Metadata: c.tags,
|
Metadata: c.tags,
|
||||||
}
|
}
|
||||||
volumes, err := c.ListVolumes(opt)
|
volumes, err := c.ListVolumes(opt)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package openstack
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
|
cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
|
||||||
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach"
|
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ go_library(
|
||||||
"//upup/pkg/fi/cloudup/openstack:go_default_library",
|
"//upup/pkg/fi/cloudup/openstack:go_default_library",
|
||||||
"//util/pkg/vfs:go_default_library",
|
"//util/pkg/vfs:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/bootfromvolume:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/bootfromvolume:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips:go_default_library",
|
||||||
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs:go_default_library",
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package openstacktasks
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
cinderv2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
|
cinderv3 "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
"k8s.io/kops/upup/pkg/fi"
|
"k8s.io/kops/upup/pkg/fi"
|
||||||
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
|
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
|
||||||
|
|
@ -44,7 +44,7 @@ func (c *Volume) CompareWithID() *string {
|
||||||
|
|
||||||
func (c *Volume) Find(context *fi.Context) (*Volume, error) {
|
func (c *Volume) Find(context *fi.Context) (*Volume, error) {
|
||||||
cloud := context.Cloud.(openstack.OpenstackCloud)
|
cloud := context.Cloud.(openstack.OpenstackCloud)
|
||||||
opt := cinderv2.ListOpts{
|
opt := cinderv3.ListOpts{
|
||||||
Name: fi.StringValue(c.Name),
|
Name: fi.StringValue(c.Name),
|
||||||
Metadata: c.Tags,
|
Metadata: c.Tags,
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ func (_ *Volume) RenderOpenstack(t *openstack.OpenstackAPITarget, a, e, changes
|
||||||
return fmt.Errorf("Failed to get storage availability zone: %s", err)
|
return fmt.Errorf("Failed to get storage availability zone: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
opt := cinderv2.CreateOpts{
|
opt := cinderv3.CreateOpts{
|
||||||
Size: int(*e.SizeGB),
|
Size: int(*e.SizeGB),
|
||||||
AvailabilityZone: storageAZ.ZoneName,
|
AvailabilityZone: storageAZ.ZoneName,
|
||||||
Metadata: e.Tags,
|
Metadata: e.Tags,
|
||||||
|
|
|
||||||
5
vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/doc.go
generated
vendored
5
vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/doc.go
generated
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
// Package volumes provides information and interaction with volumes in the
|
|
||||||
// OpenStack Block Storage service. A volume is a detachable block storage
|
|
||||||
// device, akin to a USB hard drive. It can only be attached to one instance at
|
|
||||||
// a time.
|
|
||||||
package volumes
|
|
||||||
|
|
@ -9,8 +9,8 @@ go_library(
|
||||||
"urls.go",
|
"urls.go",
|
||||||
"util.go",
|
"util.go",
|
||||||
],
|
],
|
||||||
importmap = "k8s.io/kops/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes",
|
importmap = "k8s.io/kops/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes",
|
||||||
importpath = "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes",
|
importpath = "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
|
||||||
23
vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes/doc.go
generated
vendored
Normal file
23
vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
Package volumes provides information and interaction with volumes in the
|
||||||
|
OpenStack Block Storage service. A volume is a detachable block storage
|
||||||
|
device, akin to a USB hard drive. It can only be attached to one instance at
|
||||||
|
a time.
|
||||||
|
|
||||||
|
Example to create a Volume from a Backup
|
||||||
|
|
||||||
|
backupID := "20c792f0-bb03-434f-b653-06ef238e337e"
|
||||||
|
options := volumes.CreateOpts{
|
||||||
|
Name: "vol-001",
|
||||||
|
BackupID: &backupID,
|
||||||
|
}
|
||||||
|
|
||||||
|
client.Microversion = "3.47"
|
||||||
|
volume, err := volumes.Create(client, options).Extract()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(volume)
|
||||||
|
*/
|
||||||
|
package volumes
|
||||||
|
|
@ -16,7 +16,7 @@ type CreateOptsBuilder interface {
|
||||||
// see the Volume object.
|
// see the Volume object.
|
||||||
type CreateOpts struct {
|
type CreateOpts struct {
|
||||||
// The size of the volume, in GB
|
// The size of the volume, in GB
|
||||||
Size int `json:"size" required:"true"`
|
Size int `json:"size,omitempty"`
|
||||||
// The availability zone
|
// The availability zone
|
||||||
AvailabilityZone string `json:"availability_zone,omitempty"`
|
AvailabilityZone string `json:"availability_zone,omitempty"`
|
||||||
// ConsistencyGroupID is the ID of a consistency group
|
// ConsistencyGroupID is the ID of a consistency group
|
||||||
|
|
@ -36,8 +36,13 @@ type CreateOpts struct {
|
||||||
// The ID of the image from which you want to create the volume.
|
// The ID of the image from which you want to create the volume.
|
||||||
// Required to create a bootable volume.
|
// Required to create a bootable volume.
|
||||||
ImageID string `json:"imageRef,omitempty"`
|
ImageID string `json:"imageRef,omitempty"`
|
||||||
|
// Specifies the backup ID, from which you want to create the volume.
|
||||||
|
// Create a volume from a backup is supported since 3.47 microversion
|
||||||
|
BackupID string `json:"backup_id,omitempty"`
|
||||||
// The associated volume type
|
// The associated volume type
|
||||||
VolumeType string `json:"volume_type,omitempty"`
|
VolumeType string `json:"volume_type,omitempty"`
|
||||||
|
// Multiattach denotes if the volume is multi-attach capable.
|
||||||
|
Multiattach bool `json:"multiattach,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToVolumeCreateMap assembles a request body based on the contents of a
|
// ToVolumeCreateMap assembles a request body based on the contents of a
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"github.com/gophercloud/gophercloud/pagination"
|
"github.com/gophercloud/gophercloud/pagination"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Attachment represents a Volume Attachment record
|
||||||
type Attachment struct {
|
type Attachment struct {
|
||||||
AttachedAt time.Time `json:"-"`
|
AttachedAt time.Time `json:"-"`
|
||||||
AttachmentID string `json:"attachment_id"`
|
AttachmentID string `json:"attachment_id"`
|
||||||
|
|
@ -18,6 +19,7 @@ type Attachment struct {
|
||||||
VolumeID string `json:"volume_id"`
|
VolumeID string `json:"volume_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON is our unmarshalling helper
|
||||||
func (r *Attachment) UnmarshalJSON(b []byte) error {
|
func (r *Attachment) UnmarshalJSON(b []byte) error {
|
||||||
type tmp Attachment
|
type tmp Attachment
|
||||||
var s struct {
|
var s struct {
|
||||||
|
|
@ -61,6 +63,9 @@ type Volume struct {
|
||||||
SnapshotID string `json:"snapshot_id"`
|
SnapshotID string `json:"snapshot_id"`
|
||||||
// The ID of another block storage volume from which the current volume was created
|
// The ID of another block storage volume from which the current volume was created
|
||||||
SourceVolID string `json:"source_volid"`
|
SourceVolID string `json:"source_volid"`
|
||||||
|
// The backup ID, from which the volume was restored
|
||||||
|
// This field is supported since 3.47 microversion
|
||||||
|
BackupID *string `json:"backup_id"`
|
||||||
// Arbitrary key-value pairs defined by the user.
|
// Arbitrary key-value pairs defined by the user.
|
||||||
Metadata map[string]string `json:"metadata"`
|
Metadata map[string]string `json:"metadata"`
|
||||||
// UserID is the id of the user who created the volume.
|
// UserID is the id of the user who created the volume.
|
||||||
|
|
@ -75,8 +80,11 @@ type Volume struct {
|
||||||
ConsistencyGroupID string `json:"consistencygroup_id"`
|
ConsistencyGroupID string `json:"consistencygroup_id"`
|
||||||
// Multiattach denotes if the volume is multi-attach capable.
|
// Multiattach denotes if the volume is multi-attach capable.
|
||||||
Multiattach bool `json:"multiattach"`
|
Multiattach bool `json:"multiattach"`
|
||||||
|
// Image metadata entries, only included for volumes that were created from an image, or from a snapshot of a volume originally created from an image.
|
||||||
|
VolumeImageMetadata map[string]string `json:"volume_image_metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON another unmarshalling function
|
||||||
func (r *Volume) UnmarshalJSON(b []byte) error {
|
func (r *Volume) UnmarshalJSON(b []byte) error {
|
||||||
type tmp Volume
|
type tmp Volume
|
||||||
var s struct {
|
var s struct {
|
||||||
|
|
@ -107,13 +115,11 @@ func (r VolumePage) IsEmpty() (bool, error) {
|
||||||
return len(volumes) == 0, err
|
return len(volumes) == 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextPageURL uses the response's embedded link reference to navigate to the
|
func (page VolumePage) NextPageURL() (string, error) {
|
||||||
// next page of results.
|
|
||||||
func (r VolumePage) NextPageURL() (string, error) {
|
|
||||||
var s struct {
|
var s struct {
|
||||||
Links []gophercloud.Link `json:"volumes_links"`
|
Links []gophercloud.Link `json:"volumes_links"`
|
||||||
}
|
}
|
||||||
err := r.ExtractInto(&s)
|
err := page.ExtractInto(&s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
@ -138,10 +144,12 @@ func (r commonResult) Extract() (*Volume, error) {
|
||||||
return &s, err
|
return &s, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExtractInto converts our response data into a volume struct
|
||||||
func (r commonResult) ExtractInto(v interface{}) error {
|
func (r commonResult) ExtractInto(v interface{}) error {
|
||||||
return r.Result.ExtractIntoStructPtr(v, "volume")
|
return r.Result.ExtractIntoStructPtr(v, "volume")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExtractVolumesInto similar to ExtractInto but operates on a `list` of volumes
|
||||||
func ExtractVolumesInto(r pagination.Page, v interface{}) error {
|
func ExtractVolumesInto(r pagination.Page, v interface{}) error {
|
||||||
return r.(VolumePage).Result.ExtractIntoSlicePtr(v, "volumes")
|
return r.(VolumePage).Result.ExtractIntoSlicePtr(v, "volumes")
|
||||||
}
|
}
|
||||||
|
|
@ -255,7 +255,7 @@ github.com/googleapis/gnostic/extensions
|
||||||
github.com/gophercloud/gophercloud
|
github.com/gophercloud/gophercloud
|
||||||
github.com/gophercloud/gophercloud/internal
|
github.com/gophercloud/gophercloud/internal
|
||||||
github.com/gophercloud/gophercloud/openstack
|
github.com/gophercloud/gophercloud/openstack
|
||||||
github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes
|
github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes
|
||||||
github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones
|
github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones
|
||||||
github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/bootfromvolume
|
github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/bootfromvolume
|
||||||
github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips
|
github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue