Documentation ¶
Overview ¶
fake is a package that includes fake implementations of public interfaces from the CSI package for testing.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ConfigSchema() (*hclspec.Spec, error)
- func (c *Client) ControllerCreateSnapshot(ctx context.Context, req *csi.ControllerCreateSnapshotRequest, ...) (*csi.ControllerCreateSnapshotResponse, error)
- func (c *Client) ControllerCreateVolume(ctx context.Context, in *csi.ControllerCreateVolumeRequest, ...) (*csi.ControllerCreateVolumeResponse, error)
- func (c *Client) ControllerDeleteSnapshot(ctx context.Context, req *csi.ControllerDeleteSnapshotRequest, ...) error
- func (c *Client) ControllerDeleteVolume(ctx context.Context, req *csi.ControllerDeleteVolumeRequest, ...) error
- func (c *Client) ControllerGetCapabilities(ctx context.Context) (*csi.ControllerCapabilitySet, error)
- func (c *Client) ControllerListSnapshots(ctx context.Context, req *csi.ControllerListSnapshotsRequest, ...) (*csi.ControllerListSnapshotsResponse, error)
- func (c *Client) ControllerListVolumes(ctx context.Context, req *csi.ControllerListVolumesRequest, ...) (*csi.ControllerListVolumesResponse, error)
- func (c *Client) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest, ...) (*csi.ControllerPublishVolumeResponse, error)
- func (c *Client) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest, ...) (*csi.ControllerUnpublishVolumeResponse, error)
- func (c *Client) ControllerValidateCapabilities(ctx context.Context, req *csi.ControllerValidateVolumeRequest, ...) error
- func (c *Client) NodeGetCapabilities(ctx context.Context) (*csi.NodeCapabilitySet, error)
- func (c *Client) NodeGetInfo(ctx context.Context) (*csi.NodeGetInfoResponse, error)
- func (c *Client) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest, ...) error
- func (c *Client) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest, opts ...grpc.CallOption) error
- func (c *Client) NodeUnpublishVolume(ctx context.Context, volumeID, targetPath string, opts ...grpc.CallOption) error
- func (c *Client) NodeUnstageVolume(ctx context.Context, volumeID string, stagingTargetPath string, ...) error
- func (c *Client) PluginGetCapabilities(ctx context.Context) (*csi.PluginCapabilitySet, error)
- func (c *Client) PluginGetInfo(ctx context.Context) (string, string, error)
- func (c *Client) PluginInfo() (*base.PluginInfoResponse, error)
- func (c *Client) PluginProbe(ctx context.Context) (bool, error)
- func (c *Client) SetConfig(a *base.Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Mu sync.RWMutex NextPluginInfoResponse *base.PluginInfoResponse NextPluginInfoErr error PluginInfoCallCount int64 NextPluginProbeResponse bool NextPluginProbeErr error PluginProbeCallCount int64 NextPluginGetInfoNameResponse string NextPluginGetInfoVersionResponse string NextPluginGetInfoErr error PluginGetInfoCallCount int64 NextPluginGetCapabilitiesResponse *csi.PluginCapabilitySet NextPluginGetCapabilitiesErr error PluginGetCapabilitiesCallCount int64 NextControllerGetCapabilitiesResponse *csi.ControllerCapabilitySet NextControllerGetCapabilitiesErr error ControllerGetCapabilitiesCallCount int64 NextControllerPublishVolumeResponse *csi.ControllerPublishVolumeResponse NextControllerPublishVolumeErr error ControllerPublishVolumeCallCount int64 NextControllerUnpublishVolumeResponse *csi.ControllerUnpublishVolumeResponse NextControllerUnpublishVolumeErr error ControllerUnpublishVolumeCallCount int64 NextControllerCreateVolumeResponse *csi.ControllerCreateVolumeResponse NextControllerCreateVolumeErr error ControllerCreateVolumeCallCount int64 NextControllerDeleteVolumeErr error ControllerDeleteVolumeCallCount int64 NextControllerListVolumesResponse *csi.ControllerListVolumesResponse NextControllerListVolumesErr error ControllerListVolumesCallCount int64 NextControllerValidateVolumeErr error ControllerValidateVolumeCallCount int64 NextControllerCreateSnapshotResponse *csi.ControllerCreateSnapshotResponse NextControllerCreateSnapshotErr error ControllerCreateSnapshotCallCount int64 NextControllerDeleteSnapshotErr error ControllerDeleteSnapshotCallCount int64 NextControllerListSnapshotsResponse *csi.ControllerListSnapshotsResponse NextControllerListSnapshotsErr error ControllerListSnapshotsCallCount int64 NextNodeGetCapabilitiesResponse *csi.NodeCapabilitySet NextNodeGetCapabilitiesErr error NodeGetCapabilitiesCallCount int64 NextNodeGetInfoResponse *csi.NodeGetInfoResponse NextNodeGetInfoErr error NodeGetInfoCallCount int64 NextNodeStageVolumeErr error NodeStageVolumeCallCount int64 NextNodeUnstageVolumeErr error NodeUnstageVolumeCallCount int64 PrevVolumeCapability *csi.VolumeCapability NextNodePublishVolumeErr error NodePublishVolumeCallCount int64 NextNodeUnpublishVolumeErr error NodeUnpublishVolumeCallCount int64 }
Client is a mock implementation of the csi.CSIPlugin interface for use in testing external components
func (*Client) ConfigSchema ¶
ConfigSchema returns the schema for parsing the plugins configuration.
func (*Client) ControllerCreateSnapshot ¶ added in v1.1.0
func (c *Client) ControllerCreateSnapshot(ctx context.Context, req *csi.ControllerCreateSnapshotRequest, opts ...grpc.CallOption) (*csi.ControllerCreateSnapshotResponse, error)
func (*Client) ControllerCreateVolume ¶ added in v1.1.0
func (c *Client) ControllerCreateVolume(ctx context.Context, in *csi.ControllerCreateVolumeRequest, opts ...grpc.CallOption) (*csi.ControllerCreateVolumeResponse, error)
func (*Client) ControllerDeleteSnapshot ¶ added in v1.1.0
func (c *Client) ControllerDeleteSnapshot(ctx context.Context, req *csi.ControllerDeleteSnapshotRequest, opts ...grpc.CallOption) error
func (*Client) ControllerDeleteVolume ¶ added in v1.1.0
func (c *Client) ControllerDeleteVolume(ctx context.Context, req *csi.ControllerDeleteVolumeRequest, opts ...grpc.CallOption) error
func (*Client) ControllerGetCapabilities ¶
func (*Client) ControllerListSnapshots ¶ added in v1.1.0
func (c *Client) ControllerListSnapshots(ctx context.Context, req *csi.ControllerListSnapshotsRequest, opts ...grpc.CallOption) (*csi.ControllerListSnapshotsResponse, error)
func (*Client) ControllerListVolumes ¶ added in v1.1.0
func (c *Client) ControllerListVolumes(ctx context.Context, req *csi.ControllerListVolumesRequest, opts ...grpc.CallOption) (*csi.ControllerListVolumesResponse, error)
func (*Client) ControllerPublishVolume ¶
func (c *Client) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest, opts ...grpc.CallOption) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume is used to attach a remote volume to a node
func (*Client) ControllerUnpublishVolume ¶
func (c *Client) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest, opts ...grpc.CallOption) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume is used to attach a remote volume to a node
func (*Client) ControllerValidateCapabilities ¶
func (c *Client) ControllerValidateCapabilities(ctx context.Context, req *csi.ControllerValidateVolumeRequest, opts ...grpc.CallOption) error
func (*Client) NodeGetCapabilities ¶
func (*Client) NodeGetInfo ¶
NodeGetInfo is used to return semantic data about the current node in respect to the SP.
func (*Client) NodePublishVolume ¶
func (c *Client) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest, opts ...grpc.CallOption) error
func (*Client) NodeStageVolume ¶
func (c *Client) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest, opts ...grpc.CallOption) error
NodeStageVolume is used when a plugin has the STAGE_UNSTAGE volume capability to prepare a volume for usage on a host. If err == nil, the response should be assumed to be successful.
func (*Client) NodeUnpublishVolume ¶
func (*Client) NodeUnstageVolume ¶
func (c *Client) NodeUnstageVolume(ctx context.Context, volumeID string, stagingTargetPath string, opts ...grpc.CallOption) error
NodeUnstageVolume is used when a plugin has the STAGE_UNSTAGE volume capability to undo the work performed by NodeStageVolume. If a volume has been staged, this RPC must be called before freeing the volume.
If err == nil, the response should be assumed to be successful.
func (*Client) PluginGetCapabilities ¶
PluginGetCapabilities is used to return the available capabilities from the identity service. This currently only looks for the CONTROLLER_SERVICE and Accessible Topology Support
func (*Client) PluginGetInfo ¶
PluginGetInfo is used to return semantic data about the plugin. Response:
- string: name, the name of the plugin in domain notation format.
func (*Client) PluginInfo ¶
func (c *Client) PluginInfo() (*base.PluginInfoResponse, error)
PluginInfo describes the type and version of a plugin.
func (*Client) PluginProbe ¶
PluginProbe is used to verify that the plugin is in a healthy state