const ( MaxStorageCapacity = tib ReadOnlyKey = "readonly" )
const ( // Name is the name of the CSI plug-in. Name = "io.kubernetes.storage.mock" // VendorVersion is the version returned by GetPluginInfo. VendorVersion = "0.3.0" // TopologyKey simulates a per-node topology. TopologyKey = Name + "/node" // TopologyValue is the one, fixed node on which the driver runs. TopologyValue = "some-mock-node" )
Manifest is the SP's manifest.
var Manifest = map[string]string{ "url": "https://github.com/kubernetes/kubernetes/tree/master/test/e2e/storage/drivers/csi-test/mock", }
var MockVolumes map[string]Volume
type Config struct { DisableAttach bool DriverName string AttachLimit int64 NodeExpansionRequired bool VolumeMountGroupRequired bool DisableControllerExpansion bool DisableOnlineExpansion bool PermissiveTargetPath bool EnableTopology bool IO DirIO }
DirIO is an abstraction over direct os calls.
type DirIO interface { // DirExists returns false if the path doesn't exist, true if it exists and is a directory, an error otherwise. DirExists(path string) (bool, error) // Mkdir creates the directory, but not its parents, with 0755 permissions. Mkdir(path string) error // RemoveAll removes the path and everything contained inside it. It's not an error if the path does not exist. RemoveAll(path string) error // Rename changes the name of a file or directory. The parent directory // of newPath must exist. Rename(oldPath, newPath string) error }
type OSDirIO struct{}
func (o OSDirIO) DirExists(path string) (bool, error)
func (o OSDirIO) Mkdir(path string) error
func (o OSDirIO) RemoveAll(path string) error
func (o OSDirIO) Rename(oldPath, newPath string) error
Service is the CSI Mock service provider.
type Service interface { csi.ControllerServer csi.IdentityServer csi.NodeServer }
func New(config Config) Service
New returns a new Service.
type Volume struct { VolumeCSI csi.Volume NodeID string ISStaged bool ISPublished bool ISEphemeral bool ISControllerPublished bool StageTargetPath string TargetPath string }