csi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultClientCertPath is the path to the pod identity credential bundle.
	DefaultClientCertPath = "/run/podidentity.podcert.ate.dev/credential-bundle.pem"
	// DefaultCACertPath is the path to the servicedns trust bundle.
	DefaultCACertPath = "/run/servicedns.podcert.ate.dev/trust-bundle.pem"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the gRPC connection and the individual service clients for a CSI driver.

func NewCSIClient

func NewCSIClient(endpoint string, tlsCfg *tls.Config) (*Client, error)

NewCSIClient establishes a gRPC connection to the CSI driver over UDS or TCP and returns a client initialized with Identity, Controller, and Node service clients.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying gRPC connection to the CSI driver.

func (*Client) ControllerPublishVolume

ControllerPublishVolume attaches the volume to a node.

func (*Client) ControllerUnpublishVolume

ControllerUnpublishVolume detaches the volume from a node.

func (*Client) CreateVolume

func (c *Client) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)

CreateVolume provisions a new volume.

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)

DeleteVolume deprovisions a volume.

func (*Client) GetPluginCapabilities

GetPluginCapabilities returns the capabilities supported by the CSI plugin.

func (*Client) GetPluginInfo

func (c *Client) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

GetPluginInfo returns the metadata (name, version) of the CSI plugin.

func (*Client) NodePublishVolume

NodePublishVolume mounts the volume to the target path.

func (*Client) NodeStageVolume

NodeStageVolume performs initial setup (staging) of a volume (e.g., formatting).

func (*Client) NodeUnpublishVolume

NodeUnpublishVolume unmounts the volume.

func (*Client) NodeUnstageVolume

NodeUnstageVolume undoes NodeStageVolume.

func (*Client) Probe

func (c *Client) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

Probe checks the health/readiness status of the CSI plugin.

type Plugin

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

Plugin implements volume.VolumePluginWorkerPlane using the CSI Client.

func NewCSIPlugin

func NewCSIPlugin(ctx context.Context, lister listersv1alpha1.CSIDriverConfigLister, driverName string, isController bool) (*Plugin, error)

NewCSIPlugin establishes a CSI client and returns a verified Plugin instance.

func NewPlugin

func NewPlugin(client *Client) *Plugin

NewPlugin creates a new Plugin adapter.

func (*Plugin) AttachVolume

func (p *Plugin) AttachVolume(ctx context.Context, volumeID string, node string) error

AttachVolume maps to CSI Controller ControllerPublishVolume.

func (*Plugin) CreateVolume

func (p *Plugin) CreateVolume(ctx context.Context, name string, capacity string, driverName string, parameters map[string]string) (string, map[string]string, error)

CreateVolume maps to CSI Controller CreateVolume.

func (*Plugin) DeleteVolume

func (p *Plugin) DeleteVolume(ctx context.Context, volumeID string) error

DeleteVolume maps to CSI Controller DeleteVolume.

func (*Plugin) DetachVolume

func (p *Plugin) DetachVolume(ctx context.Context, volumeID string, node string) error

DetachVolume maps to CSI Controller ControllerUnpublishVolume.

func (*Plugin) DriverName

func (p *Plugin) DriverName(ctx context.Context) (string, error)

DriverName returns the driver name obtained from the CSI plugin.

func (*Plugin) MountVolume

func (p *Plugin) MountVolume(ctx context.Context, volumeID string, targetPath string, volumeContext map[string]string) error

MountVolume maps to CSI Node NodePublishVolume. It also handles NodeStageVolume staging if required by the driver.

func (*Plugin) UnmountVolume

func (p *Plugin) UnmountVolume(ctx context.Context, volumeID string, targetPath string) error

UnmountVolume maps to CSI Node NodeUnpublishVolume. It also handles NodeUnstageVolume if staging was used.

Jump to

Keyboard shortcuts

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