Documentation ¶
Index ¶
- Variables
- func CreateEvent(name, namespace, uid, eventType, eventReason string) *v1.Event
- func CreateMockServer(t *testing.T) (*gomock.Controller, *driver.MockCSIDriver, *driver.MockIdentityServer, ...)
- func CreateNode(name, namespace string) *v1.Node
- func CreatePV(capacityGB int, pvcName, name, pvcNamespace, volumeId string, pvcUID types.UID, ...) *v1.PersistentVolume
- func CreatePVC(requestGB, capacityGB int, name, uid, namespace, volumeName string, ...) *v1.PersistentVolumeClaim
- func CreatePVWithNilVolumeHandle(capacityGB int, pvcName, name, pvcNamespace string, pvcUID types.UID, ...) *v1.PersistentVolume
- func CreatePVWithoutCSIDriver(capacityGB int, pvcName, name, pvcNamespace string, pvcUID types.UID, ...) *v1.PersistentVolume
- func CreatePod(name, namespace, volumeName, pvcName, nodeName, uid string, pvcReadOnly bool) *v1.Pod
- func FakeK8s() (kubernetes.Interface, informers.SharedInformerFactory)
- func New(ctx context.Context, address string) (*grpc.ClientConn, error)
- func QuantityGB(i int) resource.Quantity
- func WatchEvent(want bool, eventChan <-chan string) (string, error)
- type CSIVolume
- type MockEvent
- type MockNode
- type MockPod
- type MockVolume
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 CreateMockServer ¶
func CreateMockServer(t *testing.T) (*gomock.Controller, *driver.MockCSIDriver, *driver.MockIdentityServer, *driver.MockControllerServer, *driver.MockNodeServer, *grpc.ClientConn, error)
func CreateNode ¶
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 FakeK8s ¶
func FakeK8s() (kubernetes.Interface, informers.SharedInformerFactory)
func QuantityGB ¶
Types ¶
type CSIVolume ¶
type CSIVolume struct { Volume *csi.Volume Condition *csi.VolumeCondition IsBlock bool }
type MockVolume ¶
type MockVolume struct { CSIVolume *CSIVolume NativeVolume *v1.PersistentVolume NativeVolumeClaim *v1.PersistentVolumeClaim }
Click to show internal directories.
Click to hide internal directories.