...

Package drivers

import "k8s.io/kubernetes/test/e2e/storage/drivers"
Overview
Index
Subdirectories

Overview ▾

Index ▾

Constants
func InitAwsDriver() storageframework.TestDriver
func InitAzureDiskDriver() storageframework.TestDriver
func InitAzureFileDriver() storageframework.TestDriver
func InitCephFSDriver() storageframework.TestDriver
func InitCinderDriver() storageframework.TestDriver
func InitEmptydirDriver() storageframework.TestDriver
func InitGcePDCSIDriver() storageframework.TestDriver
func InitGcePdDriver() storageframework.TestDriver
func InitHostPathCSIDriver() storageframework.TestDriver
func InitHostPathDriver() storageframework.TestDriver
func InitHostPathSymlinkDriver() storageframework.TestDriver
func InitISCSIDriver() storageframework.TestDriver
func InitLocalDriverWithVolumeType(volumeType utils.LocalVolumeType) func() storageframework.TestDriver
func InitNFSDriver() storageframework.TestDriver
func InitRbdDriver() storageframework.TestDriver
func InitVSphereDriver() storageframework.TestDriver
func InitWindowsGcePdDriver() storageframework.TestDriver
func WaitForCSIDriverRegistrationOnAllNodes(ctx context.Context, driverName string, cs clientset.Interface) error
func WaitForCSIDriverRegistrationOnNode(ctx context.Context, nodeName string, driverName string, cs clientset.Interface) error
type CSIMockDriverOpts
type Hooks
type MockCSICall
type MockCSICalls
    func (c *MockCSICalls) Add(call MockCSICall)
    func (c *MockCSICalls) Get() []MockCSICall
    func (c *MockCSICalls) LogGRPC(method string, request, reply interface{}, err error)
type MockCSITestDriver
    func InitMockCSIDriver(driverOpts CSIMockDriverOpts) MockCSITestDriver

Package files

csi.go csi_objects.go in_tree.go

Constants

const (
    // GCEPDCSIDriverName is the name of GCE Persistent Disk CSI driver
    GCEPDCSIDriverName = "pd.csi.storage.gke.io"
    // GCEPDCSIZoneTopologyKey is the key of GCE Persistent Disk CSI zone topology
    GCEPDCSIZoneTopologyKey = "topology.gke.io/zone"
)

func InitAwsDriver

func InitAwsDriver() storageframework.TestDriver

InitAwsDriver returns awsDriver that implements TestDriver interface

func InitAzureDiskDriver

func InitAzureDiskDriver() storageframework.TestDriver

InitAzureDiskDriver returns azureDiskDriver that implements TestDriver interface

func InitAzureFileDriver

func InitAzureFileDriver() storageframework.TestDriver

InitAzureFileDriver returns azureFileDriver that implements TestDriver interface

func InitCephFSDriver

func InitCephFSDriver() storageframework.TestDriver

InitCephFSDriver returns cephFSDriver that implements TestDriver interface

func InitCinderDriver

func InitCinderDriver() storageframework.TestDriver

InitCinderDriver returns cinderDriver that implements TestDriver interface

func InitEmptydirDriver

func InitEmptydirDriver() storageframework.TestDriver

InitEmptydirDriver returns emptydirDriver that implements TestDriver interface

func InitGcePDCSIDriver

func InitGcePDCSIDriver() storageframework.TestDriver

InitGcePDCSIDriver returns gcePDCSIDriver that implements TestDriver interface

func InitGcePdDriver

func InitGcePdDriver() storageframework.TestDriver

InitGcePdDriver returns gcePdDriver that implements TestDriver interface

func InitHostPathCSIDriver

func InitHostPathCSIDriver() storageframework.TestDriver

InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface

func InitHostPathDriver

func InitHostPathDriver() storageframework.TestDriver

InitHostPathDriver returns hostPathDriver that implements TestDriver interface

func InitHostPathSymlinkDriver

func InitHostPathSymlinkDriver() storageframework.TestDriver

InitHostPathSymlinkDriver returns hostPathSymlinkDriver that implements TestDriver interface

func InitISCSIDriver

func InitISCSIDriver() storageframework.TestDriver

InitISCSIDriver returns iSCSIDriver that implements TestDriver interface

func InitLocalDriverWithVolumeType

func InitLocalDriverWithVolumeType(volumeType utils.LocalVolumeType) func() storageframework.TestDriver

InitLocalDriverWithVolumeType initializes the local driver based on the volume type.

func InitNFSDriver

func InitNFSDriver() storageframework.TestDriver

InitNFSDriver returns nfsDriver that implements TestDriver interface

func InitRbdDriver

func InitRbdDriver() storageframework.TestDriver

InitRbdDriver returns rbdDriver that implements TestDriver interface

func InitVSphereDriver

func InitVSphereDriver() storageframework.TestDriver

InitVSphereDriver returns vSphereDriver that implements TestDriver interface

func InitWindowsGcePdDriver

func InitWindowsGcePdDriver() storageframework.TestDriver

InitWindowsGcePdDriver returns gcePdDriver running on Windows cluster that implements TestDriver interface In current test structure, it first initialize the driver and then set up the new framework, so we cannot get the correct OS here and select which file system is supported. So here uses a separate Windows in-tree gce pd driver

func WaitForCSIDriverRegistrationOnAllNodes

func WaitForCSIDriverRegistrationOnAllNodes(ctx context.Context, driverName string, cs clientset.Interface) error

WaitForCSIDriverRegistrationOnAllNodes waits for the CSINode object to be updated with the given driver on all schedulable nodes.

func WaitForCSIDriverRegistrationOnNode

func WaitForCSIDriverRegistrationOnNode(ctx context.Context, nodeName string, driverName string, cs clientset.Interface) error

WaitForCSIDriverRegistrationOnNode waits for the CSINode object generated by the node-registrar on a certain node

type CSIMockDriverOpts

CSIMockDriverOpts defines options used for csi driver

type CSIMockDriverOpts struct {
    RegisterDriver                bool
    DisableAttach                 bool
    PodInfo                       *bool
    StorageCapacity               *bool
    AttachLimit                   int
    EnableTopology                bool
    EnableResizing                bool
    EnableNodeExpansion           bool
    EnableSnapshot                bool
    EnableVolumeMountGroup        bool
    TokenRequests                 []storagev1.TokenRequest
    RequiresRepublish             *bool
    FSGroupPolicy                 *storagev1.FSGroupPolicy
    EnableSELinuxMount            *bool
    EnableRecoverExpansionFailure bool

    // Embedded defines whether the CSI mock driver runs
    // inside the cluster (false, the default) or just a proxy
    // runs inside the cluster and all gRPC calls are handled
    // inside the e2e.test binary.
    Embedded bool

    // Hooks that will be called if (and only if!) the embedded
    // mock driver is used. Beware that hooks are invoked
    // asynchronously in different goroutines.
    Hooks Hooks
}

type Hooks

Hooks to be run to execute while handling gRPC calls.

At the moment, only generic pre- and post-function call hooks are implemented. Those hooks can cast the request and response values if needed. More hooks inside specific functions could be added if needed.

type Hooks struct {
    // Pre is called before invoking the mock driver's implementation of a method.
    // If either a non-nil reply or error are returned, then those are returned to the caller.
    Pre func(ctx context.Context, method string, request interface{}) (reply interface{}, err error)

    // Post is called after invoking the mock driver's implementation of a method.
    // What it returns is used as actual result.
    Post func(ctx context.Context, method string, request, reply interface{}, err error) (finalReply interface{}, finalErr error)
}

type MockCSICall

Dummy structure that parses just volume_attributes and error code out of logged CSI call

type MockCSICall struct {
    Method  string
    Request struct {
        VolumeContext map[string]string `json:"volume_context"`
        Secrets       map[string]string `json:"secrets"`
    }
    FullError struct {
        Code    codes.Code `json:"code"`
        Message string     `json:"message"`
    }
    Error string
    // contains filtered or unexported fields
}

type MockCSICalls

MockCSICalls is a Thread-safe storage for MockCSICall instances.

type MockCSICalls struct {
    // contains filtered or unexported fields
}

func (*MockCSICalls) Add

func (c *MockCSICalls) Add(call MockCSICall)

Add appends one new call at the end.

func (*MockCSICalls) Get

func (c *MockCSICalls) Get() []MockCSICall

Get returns all currently recorded calls.

func (*MockCSICalls) LogGRPC

func (c *MockCSICalls) LogGRPC(method string, request, reply interface{}, err error)

LogGRPC takes individual parameters from the mock CSI driver and adds them.

type MockCSITestDriver

MockCSITestDriver provides additional functions specific to the CSI mock driver.

type MockCSITestDriver interface {
    storageframework.DynamicPVTestDriver

    // GetCalls returns all currently observed gRPC calls. Only valid
    // after PrepareTest.
    GetCalls(ctx context.Context) ([]MockCSICall, error)
}

func InitMockCSIDriver

func InitMockCSIDriver(driverOpts CSIMockDriverOpts) MockCSITestDriver

InitMockCSIDriver returns a mockCSIDriver that implements TestDriver interface

Subdirectories

Name Synopsis
..
csi-test
driver Package driver is a generated GoMock package.
mock
cache
service
proxy