csi

package
v2.0.0-...-c1c857e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerCSIPluginCap is the capability name of the plugins we use with the
	// PluginGetter to get only the plugins we need. The full name of the
	// plugin interface is "docker.csicontroller/1.0". This gets only the CSI
	// plugins with Controller capability.
	DockerCSIPluginCap = "csicontroller"

	// CSIRPCTimeout is the client-side timeout duration for RPCs to the CSI
	// plugin.
	CSIRPCTimeout = 15 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(s *store.MemoryStore, pg mobyplugin.Getter) *Manager

func (*Manager) Run

func (vm *Manager) Run(ctx context.Context)

Run runs the manager. The provided context is used as the parent for all RPC calls made to the CSI plugins. Canceling this context will cancel those RPC calls by the nature of contexts, but this is not the preferred way to stop the Manager. Instead, Stop should be called, which cause all RPC calls to be canceled anyway. The context is also used to get the logging context for the Manager.

func (*Manager) Stop

func (vm *Manager) Stop()

type Plugin

type Plugin interface {
	CreateVolume(context.Context, *api.Volume) (*api.VolumeInfo, error)
	DeleteVolume(context.Context, *api.Volume) error
	PublishVolume(context.Context, *api.Volume, string) (map[string]string, error)
	UnpublishVolume(context.Context, *api.Volume, string) error
	AddNode(swarmID, csiID string)
	RemoveNode(swarmID string)
}

Plugin is the interface for a CSI controller plugin.

In this package, the word "plugin" is unfortunately overused. This particular "Plugin" is the interface used by volume Manager to interact with CSI controller plugins. It should not be confused with the "plugin" returned from the plugingetter interface, which is the interface that gives us the information we need to create this Plugin.

func NewPlugin

func NewPlugin(p mobyplugin.AddrPlugin, provider SecretProvider) Plugin

NewPlugin creates a new Plugin object.

NewPlugin takes both the CompatPlugin and the PluginAddr. These should be the same object. By taking both parts here, we can push off the work of assuring that the given plugin implements the PluginAddr interface without having to typecast in this constructor.

type SecretProvider

type SecretProvider interface {
	// GetSecret returns the secret with the given ID, or nil if not found.
	GetSecret(id string) *api.Secret
}

SecretProvider is an interface for retrieving secrets to use with CSI calls.

func NewSecretProvider

func NewSecretProvider(s *store.MemoryStore) SecretProvider

Jump to

Keyboard shortcuts

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