csi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

CSIDriverConfigGetter provides access to retrieve a CSIDriverConfig by name. Both atelisters.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

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

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

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

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

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

SupportsControllerCapability reports whether the driver supports the given controller RPC.

func (*Plugin) SupportsNodeCapability

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