mock

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultNS          = "test"
	DriverName         = "fake.csi.driver.io"
	DefaultKubeletPath = "/var/lib/kubelet"
	FSVolumeMode       = v1.PersistentVolumeBlock
	AbnormalEvent      = "Warning VolumeConditionAbnormal Volume not found"
	NormalEvent        = "Normal VolumeConditionNormal The Volume returns to the healthy state"
	ErrorWatchTimeout  = errors.New("watch event timeout")
)

Functions

func CreateEvent added in v0.2.0

func CreateEvent(name, namespace, uid, eventType, eventReason string) *v1.Event

func CreateNode

func CreateNode(name, namespace string) *v1.Node

func CreatePV

func CreatePV(capacityGB int, pvcName, name, pvcNamespace, volumeId string, pvcUID types.UID, volumeMode *v1.PersistentVolumeMode, volumePhase v1.PersistentVolumePhase) *v1.PersistentVolume

func CreatePVC

func CreatePVC(requestGB, capacityGB int, name, uid, namespace, volumeName string, volumePhase v1.PersistentVolumeClaimPhase) *v1.PersistentVolumeClaim

func CreatePVWithNilVolumeHandle

func CreatePVWithNilVolumeHandle(capacityGB int, pvcName, name, pvcNamespace string, pvcUID types.UID, volumeId string, volumePhase v1.PersistentVolumePhase, volumeMode *v1.PersistentVolumeMode) *v1.PersistentVolume

func CreatePVWithoutCSIDriver

func CreatePVWithoutCSIDriver(capacityGB int, pvcName, name, pvcNamespace string, pvcUID types.UID, volumeId string, volumePhase v1.PersistentVolumePhase, volumeMode *v1.PersistentVolumeMode) *v1.PersistentVolume

func CreatePod

func CreatePod(name, namespace, volumeName, pvcName, nodeName, uid string, pvcReadOnly bool) *v1.Pod

func New

func New(address string) (*grpc.ClientConn, error)

func QuantityGB

func QuantityGB(i int) resource.Quantity

func WatchEvent

func WatchEvent(want bool, eventChan <-chan string) (string, error)

Types

type CSIVolume

type CSIVolume struct {
	Volume    *csi.Volume
	Condition *csi.VolumeCondition
	IsBlock   bool
}

type MockEvent added in v0.2.0

type MockEvent struct {
	NativeEvent *v1.Event
}

type MockNode

type MockNode struct {
	NativeNode *v1.Node
}

type MockPod

type MockPod struct {
	NativePod *v1.Pod
}

type MockVolume

type MockVolume struct {
	CSIVolume         *CSIVolume
	NativeVolume      *v1.PersistentVolume
	NativeVolumeClaim *v1.PersistentVolumeClaim
}

Jump to

Keyboard shortcuts

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