Documentation ¶
Index ¶
- func PVWriteReadSingleNodeCheck(client clientset.Interface, claim *v1.PersistentVolumeClaim, id string)
- func TestDynamicLateBindingProvisioning(client clientset.Interface, claim *v1.PersistentVolumeClaim, id string)
- func WaitForPodsWithLabelRunningReady(c clientset.Interface, ns string, label labels.Selector, num int, ...) (pods *v1.PodList, err error)
- type Cleanup
- type VolumeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PVWriteReadSingleNodeCheck ¶
func PVWriteReadSingleNodeCheck(client clientset.Interface, claim *v1.PersistentVolumeClaim, id string)
PVWriteReadSingleNodeCheck checks that a PV retains data on a single node.
It starts two pods: - The first pod writes 'hello word' to the /mnt/test (= the volume) on one node. - The second pod runs grep 'hello world' on /mnt/test on the same node.
The node is selected by Kubernetes when scheduling the first pod. It's then selected via its name for the second pod.
If both succeed, Kubernetes actually allocated something that is persistent across pods.
This is a common test that can be called from a StorageClassTest.PvCheck.
func TestDynamicLateBindingProvisioning ¶
func TestDynamicLateBindingProvisioning(client clientset.Interface, claim *v1.PersistentVolumeClaim, id string)
TestDynamicLateBindingProvisioning is a variant of k8s.io/kubernetes/test/e2e/storage/testsuites/provisioning.go which works with late binding.
func WaitForPodsWithLabelRunningReady ¶
func WaitForPodsWithLabelRunningReady(c clientset.Interface, ns string, label labels.Selector, num int, timeout time.Duration) (pods *v1.PodList, err error)
This is a copy from framework/utils.go with the fix from https://github.com/kubernetes/kubernetes/pull/78687 TODO: update to Kubernetes 1.15 (assuming that PR gets merged in time for that) and remove this function.
Types ¶
type Cleanup ¶
type Cleanup struct { Context *sanity.SanityContext ControllerClient csi.ControllerClient NodeClient csi.NodeClient ControllerPublishSupported bool NodeStageSupported bool // contains filtered or unexported fields }
Cleanup keeps track of resources, in particular volumes, which need to be freed when testing is done. All methods can be called concurrently.
func (*Cleanup) DeleteVolumes ¶
func (cl *Cleanup) DeleteVolumes()
DeleteVolumes stops using the registered volumes and tries to delete all of them.
func (*Cleanup) MaybeRegisterVolume ¶
func (cl *Cleanup) MaybeRegisterVolume(name string, vol *csi.CreateVolumeResponse, err error)
MaybeRegisterVolume adds or updates an entry for the volume with the given name if CreateVolume was successful.
func (*Cleanup) RegisterVolume ¶
func (cl *Cleanup) RegisterVolume(name string, info VolumeInfo)
RegisterVolume adds or updates an entry for the volume with the given name.
func (*Cleanup) UnregisterVolume ¶
UnregisterVolume removes the entry for the volume with the given name, thus preventing all cleanup operations for it.
type VolumeInfo ¶
type VolumeInfo struct { // Node on which the volume was published, empty if none // or publishing is not supported. NodeID string // Volume ID assigned by CreateVolume. VolumeID string }
VolumeInfo keeps track of the information needed to delete a volume.