service

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Copyright 2021 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

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 {
	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