service

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

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-csi/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
	DisableControllerExpansion bool
	DisableOnlineExpansion     bool
	PermissiveTargetPath       bool
	EnableTopology             bool
	ExecHooks                  *Hooks
}

type Hooks added in v3.1.0

type Hooks struct {
	Globals                        string `yaml:"globals"` // will be executed once before all other scripts
	CreateVolumeStart              string `yaml:"createVolumeStart"`
	CreateVolumeEnd                string `yaml:"createVolumeEnd"`
	DeleteVolumeStart              string `yaml:"deleteVolumeStart"`
	DeleteVolumeEnd                string `yaml:"deleteVolumeEnd"`
	ControllerPublishVolumeStart   string `yaml:"controllerPublishVolumeStart"`
	ControllerPublishVolumeEnd     string `yaml:"controllerPublishVolumeEnd"`
	ControllerUnpublishVolumeStart string `yaml:"controllerUnpublishVolumeStart"`
	ControllerUnpublishVolumeEnd   string `yaml:"controllerUnpublishVolumeEnd"`
	ValidateVolumeCapabilities     string `yaml:"validateVolumeCapabilities"`
	ListVolumesStart               string `yaml:"listVolumesStart"`
	ListVolumesEnd                 string `yaml:"listVolumesEnd"`
	GetCapacity                    string `yaml:"getCapacity"`
	ControllerGetCapabilitiesStart string `yaml:"controllerGetCapabilitiesStart"`
	ControllerGetCapabilitiesEnd   string `yaml:"controllerGetCapabilitiesEnd"`
	CreateSnapshotStart            string `yaml:"createSnapshotStart"`
	CreateSnapshotEnd              string `yaml:"createSnapshotEnd"`
	DeleteSnapshotStart            string `yaml:"deleteSnapshotStart"`
	DeleteSnapshotEnd              string `yaml:"deleteSnapshotEnd"`
	ListSnapshots                  string `yaml:"listSnapshots"`
	ControllerExpandVolumeStart    string `yaml:"controllerExpandVolumeStart"`
	ControllerExpandVolumeEnd      string `yaml:"controllerExpandVolumeEnd"`
	NodeStageVolumeStart           string `yaml:"nodeStageVolumeStart"`
	NodeStageVolumeEnd             string `yaml:"nodeStageVolumeEnd"`
	NodeUnstageVolumeStart         string `yaml:"nodeUnstageVolumeStart"`
	NodeUnstageVolumeEnd           string `yaml:"nodeUnstageVolumeEnd"`
	NodePublishVolumeStart         string `yaml:"nodePublishVolumeStart"`
	NodePublishVolumeEnd           string `yaml:"nodePublishVolumeEnd"`
	NodeUnpublishVolumeStart       string `yaml:"nodeUnpublishVolumeStart"`
	NodeUnpublishVolumeEnd         string `yaml:"nodeUnpublishVolumeEnd"`
	NodeExpandVolumeStart          string `yaml:"nodeExpandVolumeStart"`
	NodeExpandVolumeEnd            string `yaml:"nodeExpandVolumeEnd"`
	NodeGetCapabilities            string `yaml:"nodeGetCapabilities"`
	NodeGetInfo                    string `yaml:"nodeGetInfo"`
	NodeGetVolumeStatsStart        string `yaml:"nodeGetVolumeStatsStart"`
	NodeGetVolumeStatsEnd          string `yaml:"nodeGetVolumeStatsEnd"`
}

JavaScript hooks to be run to perform various tests

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 {
	sync.Mutex
	VolumeCSI       csi.Volume
	NodeID          string
	ISStaged        bool
	ISPublished     bool
	ISEphemeral     bool
	StageTargetPath string
	TargetPath      string
}

Jump to

Keyboard shortcuts

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