csi

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetDriverName returns driver name as discovered by GetPluginInfo()
	// gRPC call.
	GetDriverName(ctx context.Context) (string, error)

	// SupportsPluginControllerService return true if the CSI driver reports
	// CONTROLLER_SERVICE in GetPluginCapabilities() gRPC call.
	SupportsPluginControllerService(ctx context.Context) (bool, error)

	// SupportsControllerResize returns whether the CSI driver reports EXPAND_VOLUME
	// in ControllerGetCapabilities() gRPC call.
	SupportsControllerResize(ctx context.Context) (bool, error)

	// SupportsNodeResize returns whether the CSI driver reports EXPAND_VOLUME
	// in NodeGetCapabilities() gRPC call.
	SupportsNodeResize(ctx context.Context) (bool, error)

	// SupportsControllerModify returns whether the CSI driver reports MODIFY_VOLUME
	// in ControllerGetCapabilities() gRPC call.
	SupportsControllerModify(ctx context.Context) (bool, error)

	// SupportsControllerSingleNodeMultiWriter returns whether the CSI driver reports
	// SINGLE_NODE_MULTI_WRITER in ControllerGetCapabilities() gRPC call.
	SupportsControllerSingleNodeMultiWriter(ctx context.Context) (bool, error)

	// Expand expands the volume to a new size at least as big as requestBytes.
	// It returns the new size and whether the volume need expand operation on the node.
	Expand(ctx context.Context, volumeID string, requestBytes int64, secrets map[string]string, capability *csi.VolumeCapability) (int64, bool, error)

	//CloseConnection closes the gRPC connection established by the client
	CloseConnection()

	// Modify modifies the volume's mutable parameters
	Modify(ctx context.Context, volumeID string, secrets map[string]string, mutableParameters map[string]string) error
}

Client is a gRPC client connect to remote CSI driver and abstracts all CSI calls.

func New

func New(ctx context.Context, address string, timeout time.Duration, metricsManager metrics.CSIMetricsManager) (Client, error)

New creates a new CSI client.

type MockClient

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

func NewMockClient

func NewMockClient(
	name string,
	supportsNodeResize bool,
	supportsControllerResize bool,
	supportsControllerModify bool,
	supportsPluginControllerService bool,
	supportsControllerSingleNodeMultiWriter bool) *MockClient

func (*MockClient) CloseConnection added in v1.2.0

func (c *MockClient) CloseConnection()

func (*MockClient) Expand

func (c *MockClient) Expand(
	ctx context.Context,
	volumeID string,
	requestBytes int64,
	secrets map[string]string,
	capability *csi.VolumeCapability) (int64, bool, error)

func (*MockClient) GetCapability added in v0.5.0

func (c *MockClient) GetCapability() *csi.VolumeCapability

func (*MockClient) GetDriverName

func (c *MockClient) GetDriverName(context.Context) (string, error)

func (*MockClient) GetExpandCount added in v0.3.0

func (c *MockClient) GetExpandCount() int

func (*MockClient) GetModifyCount added in v1.10.0

func (c *MockClient) GetModifyCount() int

func (*MockClient) GetSecrets added in v0.2.0

func (c *MockClient) GetSecrets() map[string]string

GetSecrets returns secrets used for volume expansion

func (*MockClient) Modify added in v1.10.0

func (c *MockClient) Modify(
	ctx context.Context,
	volumeID string,
	secrets map[string]string,
	mutableParameters map[string]string) error

func (*MockClient) SetCheckMigratedLabel added in v1.2.0

func (c *MockClient) SetCheckMigratedLabel()

func (*MockClient) SetExpansionError added in v1.11.0

func (c *MockClient) SetExpansionError(err error)

func (*MockClient) SetModifyFailed added in v1.10.0

func (c *MockClient) SetModifyFailed()

func (*MockClient) SupportsControllerModify added in v1.10.0

func (c *MockClient) SupportsControllerModify(context.Context) (bool, error)

func (*MockClient) SupportsControllerResize

func (c *MockClient) SupportsControllerResize(context.Context) (bool, error)

func (*MockClient) SupportsControllerSingleNodeMultiWriter added in v1.3.0

func (c *MockClient) SupportsControllerSingleNodeMultiWriter(context.Context) (bool, error)

func (*MockClient) SupportsNodeResize

func (c *MockClient) SupportsNodeResize(context.Context) (bool, error)

func (*MockClient) SupportsPluginControllerService

func (c *MockClient) SupportsPluginControllerService(context.Context) (bool, error)

Jump to

Keyboard shortcuts

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