csi

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 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 CSIDriverConfigGetter added in v0.4.0

type CSIDriverConfigGetter interface {
	Get(name string) (*v1alpha1.CSIDriverConfig, error)
}

CSIDriverConfigGetter provides access to retrieve a CSIDriverConfig by name. Both listersv1alpha1.CSIDriverConfigLister and direct client getters implement this interface.

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) ControllerGetCapabilities added in v0.4.0

ControllerGetCapabilities returns the capabilities supported by the controller service.

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) NodeGetCapabilities added in v0.4.0

NodeGetCapabilities returns the capabilities supported by the node service.

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, getter CSIDriverConfigGetter, 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. Call InitControllerCapabilities or InitNodeCapabilities before use; until then, no optional RPC is reported as supported.

func (*Plugin) AttachVolume

AttachVolume maps to CSI Controller ControllerPublishVolume.

func (*Plugin) CreateVolume

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) InitControllerCapabilities added in v0.4.0

func (p *Plugin) InitControllerCapabilities(ctx context.Context)

InitControllerCapabilities queries and caches ControllerGetCapabilities from the driver. If the query fails or reports no capabilities, every controller RPC is assumed supported.

func (*Plugin) InitNodeCapabilities added in v0.4.0

func (p *Plugin) InitNodeCapabilities(ctx context.Context)

InitNodeCapabilities queries and caches NodeGetCapabilities from the driver. If the query fails or reports no capabilities, every node RPC is assumed supported.

func (*Plugin) MountVolume

func (p *Plugin) MountVolume(ctx context.Context, req volume.MountVolumeRequest) error

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

func (*Plugin) SupportsControllerCapability added in v0.4.0

func (p *Plugin) SupportsControllerCapability(rpc csi.ControllerServiceCapability_RPC_Type) bool

SupportsControllerCapability reports whether the driver supports the given controller RPC.

func (*Plugin) SupportsNodeCapability added in v0.4.0

func (p *Plugin) SupportsNodeCapability(rpc csi.NodeServiceCapability_RPC_Type) bool

SupportsNodeCapability reports whether the driver supports the given node RPC.

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