driver

package
v1.25.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package driver is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCredentials is the error when a secret is enabled but not passed in the request.
	ErrNoCredentials = errors.New("secret must be provided")
	// ErrAuthFailed is the error when the secret is incorrect.
	ErrAuthFailed = errors.New("authentication failed")
)

Functions

This section is empty.

Types

type CSICreds

type CSICreds struct {
	CreateVolumeSecret                         string
	DeleteVolumeSecret                         string
	ControllerPublishVolumeSecret              string
	ControllerUnpublishVolumeSecret            string
	NodeStageVolumeSecret                      string
	NodePublishVolumeSecret                    string
	CreateSnapshotSecret                       string
	DeleteSnapshotSecret                       string
	ControllerValidateVolumeCapabilitiesSecret string
}

CSICreds is a driver specific secret type. Drivers can have a key-val pair of secrets. This mock driver has a single string secret with secretField as the key.

type CSIDriver

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

func NewCSIDriver

func NewCSIDriver(servers *CSIDriverServers) *CSIDriver

func (*CSIDriver) Address

func (c *CSIDriver) Address() string

func (*CSIDriver) Close

func (c *CSIDriver) Close()

func (*CSIDriver) IsRunning

func (c *CSIDriver) IsRunning() bool

func (*CSIDriver) SetDefaultCreds

func (c *CSIDriver) SetDefaultCreds()

SetDefaultCreds sets the default secrets for CSI creds.

func (*CSIDriver) Start

func (c *CSIDriver) Start(l net.Listener, interceptor grpc.UnaryServerInterceptor) error

Start runs a gRPC server with all enabled services. If an interceptor is give, then it will be used. Otherwise, an interceptor which handles simple credential checks and logs gRPC calls in JSON format will be used.

func (*CSIDriver) Stop

func (c *CSIDriver) Stop()

type CSIDriverServers

type CSIDriverServers struct {
	Controller csi.ControllerServer
	Identity   csi.IdentityServer
	Node       csi.NodeServer
}

CSIDriverServers is a unified driver component with both Controller and Node services.

type LogGRPC

type LogGRPC func(method string, request, reply interface{}, err error)

type MockCSIDriver

type MockCSIDriver struct {
	CSIDriver
	// contains filtered or unexported fields
}

func NewMockCSIDriver

func NewMockCSIDriver(servers *MockCSIDriverServers, interceptor grpc.UnaryServerInterceptor) *MockCSIDriver

func (*MockCSIDriver) Close

func (m *MockCSIDriver) Close()

func (*MockCSIDriver) Start

func (m *MockCSIDriver) Start() error

Start starts a new gRPC server listening on a random TCP loopback port.

func (*MockCSIDriver) StartOnAddress

func (m *MockCSIDriver) StartOnAddress(network, address string) error

StartOnAddress starts a new gRPC server listening on given address.

type MockCSIDriverServers

type MockCSIDriverServers struct {
	Controller *MockControllerServer
	Identity   *MockIdentityServer
	Node       *MockNodeServer
}

type MockControllerServer

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

MockControllerServer is a mock of ControllerServer interface.

func NewMockControllerServer

func NewMockControllerServer(ctrl *gomock.Controller) *MockControllerServer

NewMockControllerServer creates a new mock instance.

func (*MockControllerServer) ControllerExpandVolume

ControllerExpandVolume mocks base method.

func (*MockControllerServer) ControllerGetCapabilities

ControllerGetCapabilities mocks base method.

func (*MockControllerServer) ControllerGetVolume

ControllerGetVolume mocks base method.

func (*MockControllerServer) ControllerPublishVolume

ControllerPublishVolume mocks base method.

func (*MockControllerServer) ControllerUnpublishVolume

ControllerUnpublishVolume mocks base method.

func (*MockControllerServer) CreateSnapshot

CreateSnapshot mocks base method.

func (*MockControllerServer) CreateVolume

CreateVolume mocks base method.

func (*MockControllerServer) DeleteSnapshot

DeleteSnapshot mocks base method.

func (*MockControllerServer) DeleteVolume

DeleteVolume mocks base method.

func (*MockControllerServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockControllerServer) GetCapacity

GetCapacity mocks base method.

func (*MockControllerServer) ListSnapshots

ListSnapshots mocks base method.

func (*MockControllerServer) ListVolumes

ListVolumes mocks base method.

func (*MockControllerServer) ValidateVolumeCapabilities

ValidateVolumeCapabilities mocks base method.

type MockControllerServerMockRecorder

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

MockControllerServerMockRecorder is the mock recorder for MockControllerServer.

func (*MockControllerServerMockRecorder) ControllerExpandVolume

func (mr *MockControllerServerMockRecorder) ControllerExpandVolume(arg0, arg1 interface{}) *gomock.Call

ControllerExpandVolume indicates an expected call of ControllerExpandVolume.

func (*MockControllerServerMockRecorder) ControllerGetCapabilities

func (mr *MockControllerServerMockRecorder) ControllerGetCapabilities(arg0, arg1 interface{}) *gomock.Call

ControllerGetCapabilities indicates an expected call of ControllerGetCapabilities.

func (*MockControllerServerMockRecorder) ControllerGetVolume

func (mr *MockControllerServerMockRecorder) ControllerGetVolume(arg0, arg1 interface{}) *gomock.Call

ControllerGetVolume indicates an expected call of ControllerGetVolume.

func (*MockControllerServerMockRecorder) ControllerPublishVolume

func (mr *MockControllerServerMockRecorder) ControllerPublishVolume(arg0, arg1 interface{}) *gomock.Call

ControllerPublishVolume indicates an expected call of ControllerPublishVolume.

func (*MockControllerServerMockRecorder) ControllerUnpublishVolume

func (mr *MockControllerServerMockRecorder) ControllerUnpublishVolume(arg0, arg1 interface{}) *gomock.Call

ControllerUnpublishVolume indicates an expected call of ControllerUnpublishVolume.

func (*MockControllerServerMockRecorder) CreateSnapshot

func (mr *MockControllerServerMockRecorder) CreateSnapshot(arg0, arg1 interface{}) *gomock.Call

CreateSnapshot indicates an expected call of CreateSnapshot.

func (*MockControllerServerMockRecorder) CreateVolume

func (mr *MockControllerServerMockRecorder) CreateVolume(arg0, arg1 interface{}) *gomock.Call

CreateVolume indicates an expected call of CreateVolume.

func (*MockControllerServerMockRecorder) DeleteSnapshot

func (mr *MockControllerServerMockRecorder) DeleteSnapshot(arg0, arg1 interface{}) *gomock.Call

DeleteSnapshot indicates an expected call of DeleteSnapshot.

func (*MockControllerServerMockRecorder) DeleteVolume

func (mr *MockControllerServerMockRecorder) DeleteVolume(arg0, arg1 interface{}) *gomock.Call

DeleteVolume indicates an expected call of DeleteVolume.

func (*MockControllerServerMockRecorder) GetCapacity

func (mr *MockControllerServerMockRecorder) GetCapacity(arg0, arg1 interface{}) *gomock.Call

GetCapacity indicates an expected call of GetCapacity.

func (*MockControllerServerMockRecorder) ListSnapshots

func (mr *MockControllerServerMockRecorder) ListSnapshots(arg0, arg1 interface{}) *gomock.Call

ListSnapshots indicates an expected call of ListSnapshots.

func (*MockControllerServerMockRecorder) ListVolumes

func (mr *MockControllerServerMockRecorder) ListVolumes(arg0, arg1 interface{}) *gomock.Call

ListVolumes indicates an expected call of ListVolumes.

func (*MockControllerServerMockRecorder) ValidateVolumeCapabilities

func (mr *MockControllerServerMockRecorder) ValidateVolumeCapabilities(arg0, arg1 interface{}) *gomock.Call

ValidateVolumeCapabilities indicates an expected call of ValidateVolumeCapabilities.

type MockIdentityServer

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

MockIdentityServer is a mock of IdentityServer interface.

func NewMockIdentityServer

func NewMockIdentityServer(ctrl *gomock.Controller) *MockIdentityServer

NewMockIdentityServer creates a new mock instance.

func (*MockIdentityServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIdentityServer) GetPluginCapabilities

GetPluginCapabilities mocks base method.

func (*MockIdentityServer) GetPluginInfo

GetPluginInfo mocks base method.

func (*MockIdentityServer) Probe

Probe mocks base method.

type MockIdentityServerMockRecorder

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

MockIdentityServerMockRecorder is the mock recorder for MockIdentityServer.

func (*MockIdentityServerMockRecorder) GetPluginCapabilities

func (mr *MockIdentityServerMockRecorder) GetPluginCapabilities(arg0, arg1 interface{}) *gomock.Call

GetPluginCapabilities indicates an expected call of GetPluginCapabilities.

func (*MockIdentityServerMockRecorder) GetPluginInfo

func (mr *MockIdentityServerMockRecorder) GetPluginInfo(arg0, arg1 interface{}) *gomock.Call

GetPluginInfo indicates an expected call of GetPluginInfo.

func (*MockIdentityServerMockRecorder) Probe

func (mr *MockIdentityServerMockRecorder) Probe(arg0, arg1 interface{}) *gomock.Call

Probe indicates an expected call of Probe.

type MockNodeServer

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

MockNodeServer is a mock of NodeServer interface.

func NewMockNodeServer

func NewMockNodeServer(ctrl *gomock.Controller) *MockNodeServer

NewMockNodeServer creates a new mock instance.

func (*MockNodeServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockNodeServer) NodeExpandVolume

NodeExpandVolume mocks base method.

func (*MockNodeServer) NodeGetCapabilities

NodeGetCapabilities mocks base method.

func (*MockNodeServer) NodeGetInfo

NodeGetInfo mocks base method.

func (*MockNodeServer) NodeGetVolumeStats

NodeGetVolumeStats mocks base method.

func (*MockNodeServer) NodePublishVolume

NodePublishVolume mocks base method.

func (*MockNodeServer) NodeStageVolume

NodeStageVolume mocks base method.

func (*MockNodeServer) NodeUnpublishVolume

NodeUnpublishVolume mocks base method.

func (*MockNodeServer) NodeUnstageVolume

NodeUnstageVolume mocks base method.

type MockNodeServerMockRecorder

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

MockNodeServerMockRecorder is the mock recorder for MockNodeServer.

func (*MockNodeServerMockRecorder) NodeExpandVolume

func (mr *MockNodeServerMockRecorder) NodeExpandVolume(arg0, arg1 interface{}) *gomock.Call

NodeExpandVolume indicates an expected call of NodeExpandVolume.

func (*MockNodeServerMockRecorder) NodeGetCapabilities

func (mr *MockNodeServerMockRecorder) NodeGetCapabilities(arg0, arg1 interface{}) *gomock.Call

NodeGetCapabilities indicates an expected call of NodeGetCapabilities.

func (*MockNodeServerMockRecorder) NodeGetInfo

func (mr *MockNodeServerMockRecorder) NodeGetInfo(arg0, arg1 interface{}) *gomock.Call

NodeGetInfo indicates an expected call of NodeGetInfo.

func (*MockNodeServerMockRecorder) NodeGetVolumeStats

func (mr *MockNodeServerMockRecorder) NodeGetVolumeStats(arg0, arg1 interface{}) *gomock.Call

NodeGetVolumeStats indicates an expected call of NodeGetVolumeStats.

func (*MockNodeServerMockRecorder) NodePublishVolume

func (mr *MockNodeServerMockRecorder) NodePublishVolume(arg0, arg1 interface{}) *gomock.Call

NodePublishVolume indicates an expected call of NodePublishVolume.

func (*MockNodeServerMockRecorder) NodeStageVolume

func (mr *MockNodeServerMockRecorder) NodeStageVolume(arg0, arg1 interface{}) *gomock.Call

NodeStageVolume indicates an expected call of NodeStageVolume.

func (*MockNodeServerMockRecorder) NodeUnpublishVolume

func (mr *MockNodeServerMockRecorder) NodeUnpublishVolume(arg0, arg1 interface{}) *gomock.Call

NodeUnpublishVolume indicates an expected call of NodeUnpublishVolume.

func (*MockNodeServerMockRecorder) NodeUnstageVolume

func (mr *MockNodeServerMockRecorder) NodeUnstageVolume(arg0, arg1 interface{}) *gomock.Call

NodeUnstageVolume indicates an expected call of NodeUnstageVolume.

Jump to

Keyboard shortcuts

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