driver

package
v0.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package driver provides the CSI driver

Index

Constants

View Source
const (
	DefaultDriverName = "block.csi.vultr.com"
)

Variables

This section is empty.

Functions

func GRPCLogger

func GRPCLogger(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

GRPCLogger provides better error handling for gRPC calls

func NewMounter

func NewMounter(log *logrus.Entry) *mounter

NewMounter initializes the mounter

Types

type FakeInstance

type FakeInstance struct {
	// contains filtered or unexported fields
}

FakeInstance returns the client

func (*FakeInstance) AttachISO

func (f *FakeInstance) AttachISO(_ context.Context, _, _ string) (*http.Response, error)

AttachISO attaches ISO to instance

func (*FakeInstance) AttachPrivateNetwork

func (f *FakeInstance) AttachPrivateNetwork(_ context.Context, _, _ string) error

AttachPrivateNetwork attches private networks

func (*FakeInstance) AttachVPC

func (f *FakeInstance) AttachVPC(ctx context.Context, instanceID, networkID string) error

AttachVPC is not implemented

func (*FakeInstance) AttachVPC2 added in v0.10.0

func (f *FakeInstance) AttachVPC2(ctx context.Context, instanceID string, vpc2Req *govultr.AttachVPC2Req) error

AttachVPC2 is not implemented

func (*FakeInstance) Create

func (f *FakeInstance) Create(ctx context.Context, instanceReq *govultr.InstanceCreateReq) (*govultr.Instance, *http.Response, error)

Create is not implemented

func (*FakeInstance) CreateIPv4

func (f *FakeInstance) CreateIPv4(_ context.Context, _ string, _ *bool) (*govultr.IPv4, *http.Response, error)

CreateIPv4 creates an IPv4 association to instance

func (*FakeInstance) CreateReverseIPv4

func (f *FakeInstance) CreateReverseIPv4(ctx context.Context, instanceID string, reverseReq *govultr.ReverseIP) error

CreateReverseIPv4 is not implemented

func (*FakeInstance) CreateReverseIPv6

func (f *FakeInstance) CreateReverseIPv6(ctx context.Context, instanceID string, reverseReq *govultr.ReverseIP) error

CreateReverseIPv6 is not implemented

func (*FakeInstance) DefaultReverseIPv4

func (f *FakeInstance) DefaultReverseIPv4(ctx context.Context, instanceID, ip string) error

DefaultReverseIPv4 is not implemented

func (*FakeInstance) Delete

func (f *FakeInstance) Delete(ctx context.Context, instanceID string) error

Delete jis not implemented

func (*FakeInstance) DeleteIPv4

func (f *FakeInstance) DeleteIPv4(ctx context.Context, instanceID, ip string) error

DeleteIPv4 is not implemented

func (*FakeInstance) DeleteReverseIPv6

func (f *FakeInstance) DeleteReverseIPv6(ctx context.Context, instanceID, ip string) error

DeleteReverseIPv6 is not implemented

func (*FakeInstance) DetachISO

func (f *FakeInstance) DetachISO(_ context.Context, _ string) (*http.Response, error)

DetachISO detaches ISO from instance

func (*FakeInstance) DetachPrivateNetwork

func (f *FakeInstance) DetachPrivateNetwork(_ context.Context, _, _ string) error

DetachPrivateNetwork detaches private network from instance

func (*FakeInstance) DetachVPC

func (f *FakeInstance) DetachVPC(ctx context.Context, instanceID, networkID string) error

DetachVPC is not implemented

func (*FakeInstance) DetachVPC2 added in v0.10.0

func (f *FakeInstance) DetachVPC2(ctx context.Context, instanceID, vpcID string) error

DetachVPC2 is not implemented

func (*FakeInstance) Get

func (f *FakeInstance) Get(ctx context.Context, instanceID string) (*govultr.Instance, *http.Response, error)

Get returns an instance struct

func (*FakeInstance) GetBackupSchedule

func (f *FakeInstance) GetBackupSchedule(_ context.Context, _ string) (*govultr.BackupSchedule, *http.Response, error)

GetBackupSchedule gets instance backup stchedule

func (*FakeInstance) GetBandwidth

func (f *FakeInstance) GetBandwidth(_ context.Context, _ string) (*govultr.Bandwidth, *http.Response, error)

GetBandwidth gets bandwidth for an instance

func (*FakeInstance) GetNeighbors

func (f *FakeInstance) GetNeighbors(_ context.Context, _ string) (*govultr.Neighbors, *http.Response, error)

GetNeighbors gets neighors for an instance

func (*FakeInstance) GetUpgrades

func (f *FakeInstance) GetUpgrades(_ context.Context, _ string) (*govultr.Upgrades, *http.Response, error)

GetUpgrades gets instance upgade

func (*FakeInstance) GetUserData

func (f *FakeInstance) GetUserData(_ context.Context, _ string) (*govultr.UserData, *http.Response, error)

GetUserData returns instance userdata

func (*FakeInstance) Halt

func (f *FakeInstance) Halt(ctx context.Context, instanceID string) error

Halt is not implemented

func (*FakeInstance) ISOStatus

func (f *FakeInstance) ISOStatus(_ context.Context, _ string) (*govultr.Iso, *http.Response, error)

ISOStatus gets ISO status from instance

func (*FakeInstance) List

func (f *FakeInstance) List(ctx context.Context, options *govultr.ListOptions) ([]govultr.Instance, *govultr.Meta, *http.Response, error)

List is not implemented

func (*FakeInstance) ListIPv4

func (f *FakeInstance) ListIPv4(_ context.Context, _ string, _ *govultr.ListOptions) ([]govultr.IPv4, *govultr.Meta, *http.Response, error)

ListIPv4 gets IPv4 addresses associated with instance

func (*FakeInstance) ListIPv6

func (f *FakeInstance) ListIPv6(_ context.Context, _ string, _ *govultr.ListOptions) ([]govultr.IPv6, *govultr.Meta, *http.Response, error)

ListIPv6 lists IPv6 addresses associated with instance

func (*FakeInstance) ListPrivateNetworks

func (f *FakeInstance) ListPrivateNetworks(_ context.Context, _ string, _ *govultr.ListOptions) ([]govultr.PrivateNetwork, *govultr.Meta, *http.Response, error)

ListPrivateNetworks gets private networks

func (*FakeInstance) ListReverseIPv6

func (f *FakeInstance) ListReverseIPv6(_ context.Context, _ string) ([]govultr.ReverseIP, *http.Response, error)

ListReverseIPv6 gets reverse IP for IPv6 on instance

func (*FakeInstance) ListVPC2Info added in v0.10.0

func (f *FakeInstance) ListVPC2Info(ctx context.Context, instanceID string, options *govultr.ListOptions) ([]govultr.VPC2Info, *govultr.Meta, *http.Response, error)

ListVPC2Info is not implemented

func (*FakeInstance) ListVPCInfo

func (f *FakeInstance) ListVPCInfo(ctx context.Context, instanceID string, options *govultr.ListOptions) ([]govultr.VPCInfo, *govultr.Meta, *http.Response, error)

ListVPCInfo is not implemented

func (*FakeInstance) MassHalt

func (f *FakeInstance) MassHalt(ctx context.Context, instanceList []string) error

MassHalt is not implemented

func (*FakeInstance) MassReboot

func (f *FakeInstance) MassReboot(ctx context.Context, instanceList []string) error

MassReboot is not implemented

func (*FakeInstance) MassStart

func (f *FakeInstance) MassStart(ctx context.Context, instanceList []string) error

MassStart is not implemented

func (*FakeInstance) Reboot

func (f *FakeInstance) Reboot(ctx context.Context, instanceID string) error

Reboot is not implemented

func (*FakeInstance) Reinstall

func (f *FakeInstance) Reinstall(_ context.Context, _ string, _ *govultr.ReinstallReq) (*govultr.Instance, *http.Response, error)

Reinstall reinstalls an instance

func (*FakeInstance) Restore

func (f *FakeInstance) Restore(_ context.Context, _ string, _ *govultr.RestoreReq) (*http.Response, error)

Restore restores an instance

func (*FakeInstance) SetBackupSchedule

func (f *FakeInstance) SetBackupSchedule(_ context.Context, _ string, _ *govultr.BackupScheduleReq) (*http.Response, error)

SetBackupSchedule sets instance backup schedule

func (*FakeInstance) Start

func (f *FakeInstance) Start(ctx context.Context, instanceID string) error

Start is not implemented

func (*FakeInstance) Update

func (f *FakeInstance) Update(_ context.Context, _ string, _ *govultr.InstanceUpdateReq) (*govultr.Instance, *http.Response, error)

Update updates and instance

type Mounter

type Mounter interface {
	Format(source, fs string) error
	IsFormatted(source string) (bool, error)
	Mount(source, target, fs string, opts ...string) error
	IsMounted(target string) (bool, error)
	UnMount(target string) error
	GetStatistics(target string) (volumeStatistics, error)
	IsBlockDevice(target string) (bool, error)
}

Mounter is the type interface for the mounter

type NonBlockingGRPCServer

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer)
	// Waits for the service to stop
	Wait()
	// Stops the service gracefully
	Stop()
	// Stops the service forcefully
	ForceStop()
}

NonBlockingGRPCServer defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

NewNonBlockingGRPCServer provides the non-blocking GRPC server

type VultrControllerServer

type VultrControllerServer struct {
	Driver *VultrDriver
}

VultrControllerServer is the struct type for the VultrDriver

func NewVultrControllerServer

func NewVultrControllerServer(driver *VultrDriver) *VultrControllerServer

NewVultrControllerServer returns a VultrControllerServer

func (*VultrControllerServer) ControllerExpandVolume

ControllerExpandVolume provides the expand volume

func (*VultrControllerServer) ControllerGetCapabilities

ControllerGetCapabilities get capabilities of the controller

func (*VultrControllerServer) ControllerGetVolume

ControllerGetVolume This relates to being able to get health checks on a PV. We do not have this

func (*VultrControllerServer) ControllerModifyVolume added in v0.11.0

ControllerModifyVolume is unimplemented

func (*VultrControllerServer) ControllerPublishVolume

ControllerPublishVolume performs the volume publish for the controller

func (*VultrControllerServer) ControllerUnpublishVolume

ControllerUnpublishVolume performs the volume un-publish

func (*VultrControllerServer) CreateSnapshot

CreateSnapshot provides snapshot creation

func (*VultrControllerServer) CreateVolume

CreateVolume provisions a new volume on behalf of the user

func (*VultrControllerServer) DeleteSnapshot

DeleteSnapshot provides snapshot deletion

func (*VultrControllerServer) DeleteVolume

DeleteVolume performs the volume deletion

func (*VultrControllerServer) GetCapacity

func (*VultrControllerServer) ListSnapshots

ListSnapshots provides the list snapshot

func (*VultrControllerServer) ListVolumes

ListVolumes performs the list volume function

func (*VultrControllerServer) ValidateVolumeCapabilities

ValidateVolumeCapabilities checks if requested capabilities are supported

type VultrDriver

type VultrDriver struct {
	// contains filtered or unexported fields
}

VultrDriver struct

func NewDriver

func NewDriver(endpoint, token, driverName, version, userAgent, apiURL string) (*VultrDriver, error)

func (*VultrDriver) Run

func (d *VultrDriver) Run()

type VultrIdentityServer

type VultrIdentityServer struct {
	Driver *VultrDriver
}

VultrIdentityServer provides the Driver

func NewVultrIdentityServer

func NewVultrIdentityServer(driver *VultrDriver) *VultrIdentityServer

NewVultrIdentityServer initializes the VultrIdentityServer

func (*VultrIdentityServer) GetPluginCapabilities

GetPluginCapabilities returns plugins available capabilities

func (*VultrIdentityServer) GetPluginInfo

GetPluginInfo returns basic plugin data

func (*VultrIdentityServer) Probe

func (vultrIdentity *VultrIdentityServer) Probe(_ context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

Probe logs the request

type VultrNodeServer

type VultrNodeServer struct {
	Driver *VultrDriver
}

VultrNodeServer type provides the VultrDriver

func NewVultrNodeDriver

func NewVultrNodeDriver(driver *VultrDriver) *VultrNodeServer

NewVultrNodeDriver provides a VultrNodeServer

func (*VultrNodeServer) NodeExpandVolume

NodeExpandVolume provides the node volume expansion

func (*VultrNodeServer) NodeGetCapabilities

NodeGetCapabilities provides the node capabilities

func (*VultrNodeServer) NodeGetInfo

NodeGetInfo provides the node info

func (*VultrNodeServer) NodeGetVolumeStats

NodeGetVolumeStats provides the volume stats

func (*VultrNodeServer) NodePublishVolume

NodePublishVolume allows the volume publish

func (*VultrNodeServer) NodeStageVolume

NodeStageVolume provides stages the node volume

func (*VultrNodeServer) NodeUnpublishVolume

NodeUnpublishVolume allows the volume to be unpublished

func (*VultrNodeServer) NodeUnstageVolume

NodeUnstageVolume provides the node volume unstage functionality

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL