utils

package
v0.0.0-...-ef941a2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CSIVersion          = "1.3.0"
	MaxVCDUpdateRetries = 10
)
View Source
const (
	NginxDeploymentVolumeName = "nginx-deployment-volume"
	InitContainerMountPath    = "/init-container-msg-mount-path"
	DataMountPath             = "/data"
)

Variables

View Source
var (
	VcdResourceSetNotFound = errors.New("vcdResourceSet field not found in status->[csi] of RDE")
)

Functions

func CreateDeployment

func CreateDeployment(ctx context.Context, tc *testingsdk.TestClient, deploymentName, volumeName, containerImage, pvcRefName, mountPath, ns string) (*appsv1.Deployment, error)

func CreateDisk

func CreateDisk(vcdClient *vcdsdk.Client, diskName string, diskSizeMB int64, storageProfileName string) error

func CreatePV

func CreatePV(ctx context.Context, k8sClient *kubernetes.Clientset, persistentVolumeName string, storageClass string, storageProfile string, storageSize string, reclaimPolicy apiv1.PersistentVolumeReclaimPolicy) (*apiv1.PersistentVolume, error)

func CreatePVC

func CreatePVC(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string, storageClass string, storageSize string) (*apiv1.PersistentVolumeClaim, error)

func CreateStorageClass

func CreateStorageClass(ctx context.Context, k8sClient *kubernetes.Clientset, scName string,
	reclaimPolicy apiv1.PersistentVolumeReclaimPolicy, storageProfile string,
	fsType string, allowVolumeExpansion bool) (*stov1.StorageClass, error)

func DeleteDisk

func DeleteDisk(vcdClient *vcdsdk.Client, diskName string) error

func DeletePV

func DeletePV(ctx context.Context, k8sClient *kubernetes.Clientset, pvName string) error

func DeletePVC

func DeletePVC(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string) error

func DeleteStorageClass

func DeleteStorageClass(ctx context.Context, k8sClient *kubernetes.Clientset, scName string) error

func ExecCmdExample

func ExecCmdExample(client kubernetes.Interface, config *restclient.Config, nameSpace string, podName string,
	command []string) (string, error)

ExecCmdExample ExecCmd exec command on specific pod and wait the command's output.

func FindFsTypeWithMountPath

func FindFsTypeWithMountPath(executedOutput string, mountedPath string, fsType string) (bool, error)

func GetDiskByNameViaVCD

func GetDiskByNameViaVCD(vcdClient *vcdsdk.Client, diskName string) (disk *vcdtypes.Disk, err error)

func GetPV

func GetPV(ctx context.Context, k8sClient *kubernetes.Clientset, pvName string) (*apiv1.PersistentVolume, error)

func GetPVByNameViaRDE

func GetPVByNameViaRDE(pvName string, tc *testingsdk.TestClient, resourceType string) (bool, error)

func GetPVC

func GetPVC(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string) (*apiv1.PersistentVolumeClaim, error)

func GetStorageClass

func GetStorageClass(ctx context.Context, k8sClient *kubernetes.Clientset, scName string) (*stov1.StorageClass, error)

func IncreasePVCSize

func IncreasePVCSize(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string,
	additionalSize resource.Quantity) (*apiv1.PersistentVolumeClaim, error)

func RemoveDiskViaRDE

func RemoveDiskViaRDE(vcdClient *vcdsdk.Client, diskName string, clusterId string) error

func ValidateDiskQuotaError

func ValidateDiskQuotaError(err error) bool

func ValidateNoAttachedVM

func ValidateNoAttachedVM(vcdClient *vcdsdk.Client, disk *vcdtypes.Disk) error

func VerifyDiskViaVCD

func VerifyDiskViaVCD(vcdClient *vcdsdk.Client, diskName string) (*vcdtypes.Disk, error)

func WaitDiskDeleteViaVCD

func WaitDiskDeleteViaVCD(vcdClient *vcdsdk.Client, diskName string) error

func WaitForPVCDeleted

func WaitForPVCDeleted(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string) (bool, error)

func WaitForPVDeleted

func WaitForPVDeleted(ctx context.Context, k8sClient *kubernetes.Clientset, pvName string) (bool, error)

func WaitForPvcReady

func WaitForPvcReady(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string) error

func WaitForPvcSizeUpdated

func WaitForPvcSizeUpdated(ctx context.Context, k8sClient *kubernetes.Clientset, nameSpace string, pvcName string,
	newSize resource.Quantity) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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