Documentation
¶
Index ¶
- type AttachConfig
- type NodePlugin
- func (p *NodePlugin) GetPluginCapabilities(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (p *NodePlugin) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (p *NodePlugin) Mounts() int
- func (p *NodePlugin) NodeGetCapabilities(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (p *NodePlugin) NodeGetInfo(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (p *NodePlugin) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (p *NodePlugin) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (p *NodePlugin) Probe(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (p *NodePlugin) Serve(ctx context.Context, socket string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachConfig ¶ added in v0.45.0
AttachConfig lets a repos volume ask the control plane for an attach: the key that signs the request and the verifier of the attach grant in the answer. Without it the plugin refuses a repos volume.
type NodePlugin ¶
type NodePlugin struct {
csi.UnimplementedIdentityServer
csi.UnimplementedNodeServer
DriverName string
NodeID string
// StateDir holds the blob cache of the node and the volume directory of every workspace.
StateDir string
// APIURL is the store base URL. Grant signs the node grant of a volume; the plugin calls it for every
// store call, so a mount outlives any one grant.
APIURL string
Grant func(volattr.Publication) (string, error)
UID uint32
GID uint32
// AllowedNamespaces lists the namespaces whose pods may publish a volume. The plugin refuses every other pod.
AllowedNamespaces []string
HTTP *http.Client
Clock clock.Clock
// Logger receives the vfs.stats, vfs.health and error records. SlowOp and StatsEvery tune them; zero is the default.
Logger *slog.Logger
SlowOp time.Duration
StatsEvery time.Duration
Transport transport.Transport
// CacheBytes is the size of the node cache above which the plugin evicts the least recently used blobs. Zero evicts
// nothing.
CacheBytes int64
// SweepCache replaces the walk of the node cache that Serve starts in the background.
SweepCache func(dir string)
// Attach lets the plugin serve a repos volume. Nil refuses every repos volume.
Attach *AttachConfig
// contains filtered or unexported fields
}
NodePlugin is the CSI node plugin of the virtual workspace. NodePublishVolume attaches the tree of one commit for one pod through Transport, signs the node grant of the volume and serves the control socket in a directory of that pod. NodeUnpublishVolume detaches it and removes its volume directory and the socket directory.
func (*NodePlugin) GetPluginCapabilities ¶
func (p *NodePlugin) GetPluginCapabilities(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
func (*NodePlugin) GetPluginInfo ¶
func (p *NodePlugin) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
func (*NodePlugin) Mounts ¶
func (p *NodePlugin) Mounts() int
Mounts is the number of workspaces the plugin serves.
func (*NodePlugin) NodeGetCapabilities ¶
func (p *NodePlugin) NodeGetCapabilities(context.Context, *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
func (*NodePlugin) NodeGetInfo ¶
func (p *NodePlugin) NodeGetInfo(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*NodePlugin) NodePublishVolume ¶
func (p *NodePlugin) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mounts the workspace of the workspace named by the volume attributes at the target path, or binds the control socket directory of the workspace for a control socket volume.
func (*NodePlugin) NodeUnpublishVolume ¶
func (p *NodePlugin) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmounts the workspace and deletes its volume directory. A volume this process does not know, for example after a restart, still loses its mount and its volume directory. It holds no lock of the plugin while it unmounts, scans mountinfo or deletes, so a slow volume blocks only itself.
func (*NodePlugin) Probe ¶
func (p *NodePlugin) Probe(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)