service

package
v1.29.5 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MaxStorageCapacity = tib
	ReadOnlyKey        = "readonly"
)
View Source
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"
)

Variables

View Source
var Manifest = map[string]string{
	"url": "https://github.com/kubernetes/kubernetes/tree/master/test/e2e/storage/drivers/csi-test/mock",
}

Manifest is the SP's manifest.

View Source
var MockVolumes map[string]Volume

Functions

This section is empty.

Types

type Config

type Config struct {
	DisableAttach              bool
	DriverName                 string
	AttachLimit                int64
	NodeExpansionRequired      bool
	VolumeMountGroupRequired   bool
	DisableControllerExpansion bool
	DisableOnlineExpansion     bool
	PermissiveTargetPath       bool
	EnableTopology             bool
	IO                         DirIO
}

type DirIO

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
}

DirIO is an abstraction over direct os calls.

type OSDirIO

type OSDirIO struct{}

func (OSDirIO) DirExists

func (o OSDirIO) DirExists(path string) (bool, error)

func (OSDirIO) Mkdir

func (o OSDirIO) Mkdir(path string) error

func (OSDirIO) RemoveAll

func (o OSDirIO) RemoveAll(path string) error

func (OSDirIO) Rename added in v1.26.0

func (o OSDirIO) Rename(oldPath, newPath string) error

type Service

type Service interface {
	csi.ControllerServer
	csi.IdentityServer
	csi.NodeServer
}

Service is the CSI Mock service provider.

func New

func New(config Config) Service

New returns a new Service.

type Volume

type Volume struct {
	VolumeCSI             csi.Volume
	NodeID                string
	ISStaged              bool
	ISPublished           bool
	ISEphemeral           bool
	ISControllerPublished bool
	StageTargetPath       string
	TargetPath            string
}

Jump to

Keyboard shortcuts

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