k8stest

package
v0.0.0-...-9913de7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 53 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DefCompletionTimeout = 600
)
View Source
const (
	// k8sNodeLabelKeyHostname is the label key used by Kubernetes
	// to store the hostname on the node resource.
	K8sNodeLabelKeyHostname = "kubernetes.io/hostname"
)
View Source
const RdmaDeviceName = "rxe0"

Variables

View Source
var (
	DefTimeoutSecs                         = 90 // in seconds
	DefVerifyReplicaWaitHealthyVolTimeSecs = 120
)
View Source
var (
	StsDefTimeoutSecs = 90 // in seconds
)
View Source
var ZeroInt64 = int64(0)

Functions

func AddControlNodeNoScheduleTaintOnNode

func AddControlNodeNoScheduleTaintOnNode(nodeName string) error

func AddHelmRepository

func AddHelmRepository(helmRepoName, helmRepoUrl string) error

func AddNoScheduleTaintOnNode

func AddNoScheduleTaintOnNode(nodeName string) error

func AddSnapshotContentAnnotation

func AddSnapshotContentAnnotation(snapshotContentName, annotationKey, annotationValue string) error

Add the Volume Snapshot content annotations

func AfterSuiteCleanup

func AfterSuiteCleanup()

AfterSuiteCleanup placeholder function for now To aid postmortem analysis for the most common CI use case namely cluster is retained aon failure, we do nothing For other situations behaviour should be configurable

func ApplyIoEngineLabelToNode

func ApplyIoEngineLabelToNode(nodeIP string, nodeName string, podPrefix string, timeoutSecs int) error

ApplyIoEngineLabelToNode add io engine label and verify pod creation on node

func ApplyNodeSelectorToDaemonset

func ApplyNodeSelectorToDaemonset(daemonsetName string, namespace string, label string, value string) error

ApplyNodeSelectorToDaemonset add node selector to the daemonset spec and apply

func ApplyNodeSelectorToDeployment

func ApplyNodeSelectorToDeployment(deploymentName string, namespace string, label string, value string) error

Add a node selector to the deployment spec and apply

func ApplyNodeSelectorToPodObject

func ApplyNodeSelectorToPodObject(pod *coreV1.Pod, label string, value string)

Add a node selector to the given pod definition

func ApplyNodeSelectorToStatefulset

func ApplyNodeSelectorToStatefulset(stsName string, namespace string, label string, value string) error

Add a node selector to the statefuleset spec and apply

func AreNodesReady

func AreNodesReady() (bool, error)

func BounceDeployment

func BounceDeployment(deploymentName string, namespace string, timeout_seconds int) (int32, error)

set the deployment replication to zero until all pods are removed, then reset to the original value.

func ByteCompareVolumeReplicas

func ByteCompareVolumeReplicas(volName string, ns string) (bool, string, error)

func CheckAllMsvsAreHealthy

func CheckAllMsvsAreHealthy() error

func CheckAndSetControlPlane

func CheckAndSetControlPlane() error

CheckAndSetControlPlane checks which deployments exists and sets config control plane setting

func CheckCsiNodeTopologyKeysPresent

func CheckCsiNodeTopologyKeysPresent(nodeName string, driverName string, key []string) (bool, error)

func CheckFioPodCompleted

func CheckFioPodCompleted(podName string, nameSpace string) (coreV1.PodPhase, *common.E2eFioPodLogSynopsis, error)

func CheckForMsvs

func CheckForMsvs() (bool, error)

func CheckForPVCs

func CheckForPVCs() (bool, error)

func CheckForPVs

func CheckForPVs() (bool, error)

func CheckForStorageClasses

func CheckForStorageClasses() (bool, error)

func CheckForTestPods

func CheckForTestPods() (bool, error)

CheckForTestPods Check if any test pods exist in the default and e2e related namespaces .

func CheckIfAllResourcesAreDifferent

func CheckIfAllResourcesAreDifferent(resourceList []string) bool

CheckIfAllResourcesAreDifferent function can be used to check if all elements passed as arguments in the lists are different. So for e.g. it will be useful in tests where we want to verify that all pools are on different nodes or all nexuses are on different nodes or all replicas have different pools.

func CheckMsPodOnNodeByPrefix

func CheckMsPodOnNodeByPrefix(nodeIP string, prefix string) bool

CheckMsPodOnNodeByPrefix check mayastor pod is running on a node with names matching the prefix

func CheckMsvIsDeleted

func CheckMsvIsDeleted(uuid string) error

func CheckPodCompleted

func CheckPodCompleted(podName string, nameSpace string) (coreV1.PodPhase, error)

func CheckPodContainerCompleted

func CheckPodContainerCompleted(podName string, nameSpace string) (coreV1.PodPhase, error)

func CheckPodIsRunningByPrefix

func CheckPodIsRunningByPrefix(prefix string) bool

CheckPodIsRunningByPrefix check pod is running by prefix name

func CheckReplicaComparisonPossible

func CheckReplicaComparisonPossible(volUuid string, volName string, volType common.VolumeType, timeout int) error

CheckReplicaComparisonPossible given a volume uuid, name, and type attempt to ensure that conditions replica comparison are met. Primarily ensure the the volume is not degraded on return from this function. Volumes should not be published/mounted when this function is called

func CheckTestPodsHealth

func CheckTestPodsHealth(namespace string) error

CheckTestPodsHealth Check test pods in a namespace for restarts and failed/unknown state

func ChecksumReplica

func ChecksumReplica(initiatorIP, targetIP, nqn string, maxRetries int, nexusNodeNqn string) (string, error)

ChecksumReplica checksums the nvme target defined by the given uri It uses the e2e agent and the nvme client to connect to the target. the returned format is derived from cksum: <checksum> <size> e.g. "924018992 61849088

func CleanUp

func CleanUp() bool

"Big" sweep, attempts to remove artefacts left over in the cluster that would prevent future successful test runs. returns true if cleanup was successful i.e. all resources were deleted and no errors were encountered.

func CleanUpBusyboxResources

func CleanUpBusyboxResources(pods []string, pvcName string) error

func ClearStorageClasses

func ClearStorageClasses()

Install support function - clear any storage classes created by Helm charts

func CompareReplicas

func CompareReplicas(nexusIP string, replica_1_IP string, replica_2_IP string, volUUID string) error

use the e2e-agent running on each non-nexus node:

for each non-nexus replica node
    nvme connect to its own target
    cksum /dev/nvme0n1p2
    nvme disconnect
compare the checksum results, they should match

func CompareVolumeReplicas

func CompareVolumeReplicas(volName string, ns string) common.ReplicasComparison

CompareVolumeReplicas compares contents of all volume replicas returns replicas match, mismatch or failure to compare replica contents

Fails if a nexus is present for more than 120 seconds after invocation of this function. Presence of a nexus implies writes are possible whilst calculating the checksum, also this function amends replica sharing.

This function is intended for use at the end of volume operations, immediately before a volume is deleted.

func ConfigureLoopDeviceOnNode

func ConfigureLoopDeviceOnNode(node string, size int64, imageDir string) (e2e_agent.LoopDevice, error)

func ConfigureLoopDeviceOnNodes

func ConfigureLoopDeviceOnNodes(nodeDeviceMap map[string]e2e_agent.LoopDevice) (map[string]e2e_agent.LoopDevice, error)

func ContainsK8sControlPlaneLabels

func ContainsK8sControlPlaneLabels(labels map[string]string) bool

func ControlPlaneReady

func ControlPlaneReady(sleepTime int, duration int) bool

func CreateConfiguredPools

func CreateConfiguredPools() error

CreateConfiguredPools (re)create pools as defined by the configuration. No check is made on the status of pools

func CreateConfiguredPoolsAndWait

func CreateConfiguredPoolsAndWait(timeoutsecs int) error

func CreateDeployment

func CreateDeployment(obj *appsv1.Deployment) error

CreateDeployment creates deployment with provided deployment object

func CreateDiskPartitions

func CreateDiskPartitions(addr string, count int, partitionSizeInGiB int, diskPath string) error

func CreateDiskPartitionsMib

func CreateDiskPartitionsMib(addr string, count int, partitionSizeInMiB int, diskPath string) error

func CreateDiskPoolsConfiguration

func CreateDiskPoolsConfiguration() error

CreateDiskPoolsConfiguration query mayastor for available devices and create configmap e2e-diskpools-fqn with a map of nodes and pool devices This function is a NOP if the config map is already present to allow external agents to determine the set of pool devices by creating the configmap before this function is invoked

func CreateFioPod

func CreateFioPod(podName string, volName string, volType common.VolumeType, nameSpace string) (*coreV1.Pod, error)

CreateFioPod deprecated use MakeFioContainer, NewPodBuilder and CreatePod instead / Create a test fio pod in default namespace, no options and no context / mayastor volume is mounted on /volume

func CreateFioPodDef

func CreateFioPodDef(podName string, volName string, volType common.VolumeType, nameSpace string) *coreV1.Pod

CreateFioPodDef deprecated use MakeFioContainer and NewPodBuilder instead / Create a test fio pod in default namespace, no options and no context / for filesystem, mayastor volume is mounted on /volume / for raw-block, mayastor volume is mounted on /dev/sdm

func CreateFioPodOnNode

func CreateFioPodOnNode(podName string, volName string, nodeName string, args []string) error

func CreateFioPodWithNodeSelector

func CreateFioPodWithNodeSelector(podName string, volName string, volType common.VolumeType, nodeName string, args []string) error

func CreatePVC

CreatePVC Create a PVC in default namespace, no options and no context

func CreatePod

func CreatePod(podDef *coreV1.Pod, nameSpace string) (*coreV1.Pod, error)

CreatePod Create a Pod in the specified namespace, no options and no context

func CreatePoolOnNode

func CreatePoolOnNode(nodeName string, poolName string) error

CreatePoolOnNode create pool on a specific node. No check is made on the status of pools

func CreatePoolOnNodeAndWait

func CreatePoolOnNodeAndWait(nodeName string, poolName string, timeoutsecs int) (bool, error)

func CreatePvc

func CreatePvc(createOpts *coreV1.PersistentVolumeClaim, errBuf *error, uuid *string, wg *sync.WaitGroup)

func CreateRdmaDeviceOnAllIoEngineNodes

func CreateRdmaDeviceOnAllIoEngineNodes() error

func CreateRdmaDeviceOnNode

func CreateRdmaDeviceOnNode(node string) error

func CreateSc

func CreateSc(obj *storagev1.StorageClass) error

CreateSc creates storageclass with provided storageclass object

func CreateSleepingFioPod

func CreateSleepingFioPod(fioPodName string, volName string, volType common.VolumeType) error

CreateSleepingFioPod create fio pod definition and create pod with sleep, it will not run fio

func CreateSleepingFioPodOnNode

func CreateSleepingFioPodOnNode(fioPodName string, volName string, volType common.VolumeType, nodename string) error

CreateSleepingFioPodOnNode create fio pod definition and create pod on given node if node provided otherwise fio will be created on any suitable node with sleep, it will not run fio

func CreateSnapshot

func CreateSnapshot(pvcName string, snapshotClassName string, nameSpace string, snapshotName string) (*snapshotv1.VolumeSnapshot, error)

Create the Volume Snapshot , this will create snapshot kubernetes object only. This will be called by MakeSnapshot function

func CreateSnapshotClass

func CreateSnapshotClass(snapshotClassName string, csiDriver string) error

Create the Snapshot class

func CreateStatefulset

func CreateStatefulset(obj *appsv1.StatefulSet) error

CreateStatefulset creates statefulset with provided statefulset object

func CreateVolumeSnapshot

func CreateVolumeSnapshot(snapshotClassName string, snapshotName string, pvc string, namespace string, csiDriver string) (*v1.VolumeSnapshot, string, error)

CreateVolumeSnapshot create snapshot class and snapshot it return snapshot object , snapshot content name and err

func DaemonSetReady

func DaemonSetReady(daemonName string, namespace string) bool

func DeleteAllDeployments

func DeleteAllDeployments(nameSpace string) (int, error)

func DeleteAllMsvs

func DeleteAllMsvs() (int, error)

DeleteAllMsvs Make best attempt to delete MayastorVolumes

func DeleteAllPods

func DeleteAllPods(nameSpace string) (int, error)

/ Delete all pods in the default namespace

func DeleteAllPools

func DeleteAllPools() bool

func DeleteAllPvcs

func DeleteAllPvcs(nameSpace string) (int, error)

Make best attempt to delete PersistentVolumeClaims returns ok -> operations succeeded, resources undeleted, delete resources failed

func DeleteAllPvs

func DeleteAllPvs() (int, error)

Make best attempt to delete PersistentVolumes

func DeleteAllSnapshots

func DeleteAllSnapshots(nameSpace string) (int, error)

Make best attempt to delete Snapshot returns ok -> operations succeeded, resources undeleted, delete resources failed

func DeleteConfigMap

func DeleteConfigMap(name string, nameSpace string) error

func DeleteConfiguredPools

func DeleteConfiguredPools() error

func DeleteDeployment

func DeleteDeployment(name string, namespace string) error

DeleteDeployment deletes the deployment

func DeleteDiskPartitions

func DeleteDiskPartitions(addr string, count int, diskPath string) error

func DeleteFioFile

func DeleteFioFile(podName string, filename string) ([]byte, error)

DeleteFioFile deletes the file which was created by fio while writing data

func DeleteKubernetesSecret

func DeleteKubernetesSecret(secret string, namespace string) error

func DeleteMayastorPodOnNode

func DeleteMayastorPodOnNode(nodeIP string, prefix string) error

DeleteMayastorPodOnNode deletes mayastor pods on a node with names matching the prefix

func DeleteMsv

func DeleteMsv(volName string) error

func DeletePVC

func DeletePVC(volName string, nameSpace string) error

DeletePVC Delete a PVC in default namespace, no options and no context

func DeletePod

func DeletePod(podName string, nameSpace string) error

DeletePod Delete a Pod in the specified namespace, no options and no context

func DeletePodsByLabel

func DeletePodsByLabel(label string, nameSpace string) error

func DeletePvc

func DeletePvc(volName string, namespace string, errBuf *error, wg *sync.WaitGroup)

func DeleteRestartedPods

func DeleteRestartedPods(namespace string) error

DeleteRestartedPods utility function to "clear" pods with restart counts use with care - this functions exists because the test framework systematically asserts that pods have not restarted to mark a test as passed. However there are "legitimate" reasons why mayastor pods may have restarted for example when a node has been rebooted this function should be used in such cases in conjunction with the MayastorReady function to ensure that the test cluster is back to "pristine" state.

func DeleteScVolumeAndFio

func DeleteScVolumeAndFio(scFioVolumeName ScFioVolumeName) error

func DeleteSnapshot

func DeleteSnapshot(snapshotName string, namespace string) error

Delete the volume Snapshot

func DeleteSnapshotClass

func DeleteSnapshotClass(snapshotClassName string) error

Delete the volume Snapshot class

func DeleteSnapshotContent

func DeleteSnapshotContent(snapshotContentName string) error

Delete the volume Snapshot content

func DeleteStatefulset

func DeleteStatefulset(name string, namespace string) error

DeleteStatefulset deletes the statefulset

func DeleteVolumeAttachments

func DeleteVolumeAttachments(nodeName string) error

DeleteVolumeAttachmets deletes volume attachments for a node

func DeployBusyBoxPod

func DeployBusyBoxPod(podName, pvcName string, volType common.VolumeType) error

func DeploymentReady

func DeploymentReady(deploymentName, namespace string) bool

func DeploymentReadyCount

func DeploymentReadyCount(deploymentName string, namespace string) (int, error)

func DisableNetworkInterfaceOnNode

func DisableNetworkInterfaceOnNode(node string) error

disable network interface on node

func DisableRdmaOnNode

func DisableRdmaOnNode(node string) error

func DiscoverProduct

func DiscoverProduct() (string, error)

DiscoverProduct return the name of the product installed on the test cluster this cannot be used by the product install test This function may be called very early during initialisation of a test ot tool run and should have no dependencies of state

func DsSetContainerEnv

func DsSetContainerEnv(dsName string, nameSpace string, containerName string, envName string, envValue string) (bool, error)

func DsUnsetContainerEnv

func DsUnsetContainerEnv(dsName string, nameSpace string, containerName string, envName string) (bool, error)

func DsUpdateStrategy

func DsUpdateStrategy(dsName string, nameSpace string, rollingUpdate bool) error

DSUpdateStrategy set a daemonset update strategy to rolling update on on delete

func DumpPodLog

func DumpPodLog(podName string, nameSpace string)

func EnableNetworkInterfaceOnNode

func EnableNetworkInterfaceOnNode(node string) error

enable network interface on node

func EnableRdmaDeviceOnAllWorkerNodes

func EnableRdmaDeviceOnAllWorkerNodes() error

func EnableRdmaOnNode

func EnableRdmaOnNode(node string) error

func EnsureE2EAgent

func EnsureE2EAgent() (bool, error)

EnsureE2EAgent ensure that e2e agent daemonSet is running, if already deployed does nothing, otherwise creates the e2e agent namespace and deploys the daemonSet. asserts if creating the namespace fails. This function can be called repeatedly.

func EnsureNamespace

func EnsureNamespace(nameSpace string) error

EnsureNamespace ensure that a namespace exists, creates namespace if not found.

func EnsureNodeLabelValues

func EnsureNodeLabelValues(IOEngineLabelKey string, IOEngineLabelValue string, testControlNodeLabel string) error

EnsureNodeLabelValues that existing labels on a node have a particular value

func EnsureNodeLabels

func EnsureNodeLabels() error

EnsureNodeLabels add the label xxxxxxx/engine=mayastor to all worker nodes so that K8s runs mayastor on them returns error is accessing the list of nodes fails.

func ExcludeNexusReplica

func ExcludeNexusReplica(nexusIP string, nexusUuid string, volUuid string) (bool, error)

ExcludeNexusReplica - ensure the volume has no nexus-local replica This depends on there being an unused mayastor instance available so e.g. a 2-replica volume needs at least a 3-node cluster

func ExecuteCommandInContainer

func ExecuteCommandInContainer(namespace string, podName string, containerName string, cmd string) (string, string, error)

ExecuteCommandInContainer is needed for pods with more than one container

func ExecuteCommandInPod

func ExecuteCommandInPod(namespace, podName string, cmd string) (string, string, error)

ExecuteCommandInPod FIXME: Explore how to make the stream interactive and more flexible, etc.

func FaultReplica

func FaultReplica(volumeUuid string, replicaUuid string) error

Identify the nexus IP address, the uri of the replica , fault replica

func ForceDeleteMayastorPods

func ForceDeleteMayastorPods() (bool, int, error)

Force deletion of all existing mayastor pods returns the number of pods still present, and error

func ForceDeleteTerminatingPods

func ForceDeleteTerminatingPods(labels, namespace string) error

ForceDeleteTerminatingPods force deletes the pod this function is required because sometimes after powering off the node some pods stuck in terminating state.

func FsConsistentReplica

func FsConsistentReplica(initiatorIP, targetIP, nqn string, maxRetries int, nexusNodeNqn string, fsType common.FileSystemType) (string, error)

FsConsistentReplica verifies the filesystem consistency of the nvme target defined by the given uri. It uses the e2e agent and the nvme client to connect to the target. Returns the fsck or equivalent output and exit status code

func FsFreezeReplica

func FsFreezeReplica(nodeName string) (string, error)

FsFreezeReplica freezes the filesystem of the nvme target defined by the given uri. It uses the e2e agent and the nvme client to connect to the target. Returns the exit status code

func FsUnfreezeReplica

func FsUnfreezeReplica(nodeName string) (string, error)

FsUnfreezeReplica unfreezes the filesystem of the nvme target defined by the given uri. It uses the e2e agent and the nvme client to connect to the target. Returns the exit status code

func GenerateAppPodLogs

func GenerateAppPodLogs(token string)

Generate Application Pod logs

func GenerateInstallSupportBundle

func GenerateInstallSupportBundle()

GenerateInstallSupportBundle generate a support bundle for the cluster

func GenerateMetaJson

func GenerateMetaJson() error

Create meta.json file with release platform and install bundle details

func GenerateSupportBundle

func GenerateSupportBundle(testLogDir string)

GenerateSupportBundle generate a support bundle for the cluster

func GetCapacityAllReplicasOnPool

func GetCapacityAllReplicasOnPool(poolName string) (int64, error)

GetCapacityAllReplicasOnPool given a poolName, returns totalCapacity of all the replicas on that pool

func GetCapacityAndAllocatedAllSnapshotsAllReplicasOnPool

func GetCapacityAndAllocatedAllSnapshotsAllReplicasOnPool(poolName string) (int64, error)

GetCapacityAndAllocatedAllSnapshotsAllReplicasOnPool given a poolName, returns totalCapacity which is sum of capacity of all the replicas on that pool and AllocatedAllSnapshots of all replicas on that pool

func GetConfigMap

func GetConfigMap(name string, nameSpace string) (*v1.ConfigMap, error)

func GetConfiguredClusterNodePoolDevices

func GetConfiguredClusterNodePoolDevices() (map[string][]string, error)

GetConfiguredClusterNodePoolDevices read the diskpool configmap and return the contents as a map of pool device lists keyed on the node name.

func GetConfiguredNodePoolDevices

func GetConfiguredNodePoolDevices(nodeName string) ([]string, error)

GetConfiguredNodePoolDevices given a nodename, return the array of diskpool devices configured for that node returns error if no pools are configured for the node

func GetCoreAgentNodeName

func GetCoreAgentNodeName() (string, error)

func GetCsiNode

func GetCsiNode(nodeName string) (*storageV1.CSINode, error)

func GetCsiNodeDriverTopologyKeys

func GetCsiNodeDriverTopologyKeys(nodeName string, driverName string) ([]string, error)

func GetDaemonSet

func GetDaemonSet(name, namespace string) (v1.DaemonSet, error)

func GetDeployment

func GetDeployment(deploymentName string, namespace string) (*appsv1.Deployment, error)

Get deployment object for "deploymentName" deployment

func GetDeploymentPods

func GetDeploymentPods(deploymentName string, namespace string) (*coreV1.PodList, error)

Get pods for "deploymentName" deployment in "namespace"

func GetDeploymentReplicaCount

func GetDeploymentReplicaCount(deploymentName string, namespace string) (int32, error)

GetDeploymentReplicaCount return deployment replica count

func GetDeploymentSpecReplicas

func GetDeploymentSpecReplicas(deploymentName string, namespace string) (int32, error)

func GetDeploymentStatusReplicas

func GetDeploymentStatusReplicas(deploymentName string, namespace string) (int32, error)

func GetDevLinkName

func GetDevLinkName(node, iface string) (string, error)

func GetEvent

func GetEvent(nameSpace string, name string, getOptions metaV1.GetOptions) (*v1.Event, error)

GetEvent retrieves event for a specific resource in namespace

func GetEvents

func GetEvents(nameSpace string, listOptions metaV1.ListOptions) (*v1.EventList, error)

GetEvents retrieves events for a specific namespace

func GetIOEngineHostNameLabel

func GetIOEngineHostNameLabel() (string, error)

func GetIOEngineNodeLocsMap

func GetIOEngineNodeLocsMap() (map[string]IOEngineNodeLocation, error)

func GetInstalledProductChartVersionViaHelm

func GetInstalledProductChartVersionViaHelm(namespace string) (string, error)

func GetKubernetesSecret

func GetKubernetesSecret(secret string, namespace string) error

func GetLease

func GetLease(name, ns string) (*coordinationV1.Lease, error)

GetLease return requested lease

func GetMSN

func GetMSN(nodeName string) (*common.MayastorNode, error)

GetMSN Get pointer to a mayastor volume custom resource returns nil and no error if the msn is in pending state.

func GetMSV

func GetMSV(uuid string) (*common.MayastorVolume, error)

GetMSV Get pointer to a mayastor volume custom resource returns nil and no error if the msv is in pending state.

func GetMayastorInitialPodCount

func GetMayastorInitialPodCount() int

func GetMayastorNodeIPAddresses

func GetMayastorNodeIPAddresses() []string

GetMayastorNodeIPAddresses return an array of IP addresses for nodes running mayastor. On error an empty array is returned.

func GetMayastorNodeNames

func GetMayastorNodeNames() ([]string, error)

func GetMayastorPodNameonNodeByPrefix

func GetMayastorPodNameonNodeByPrefix(prefix string, nodeName string) (string, error)

GetMayastorPodNameonNodeByPrefix

func GetMayastorSnapshotScMap

func GetMayastorSnapshotScMap() ([]string, error)

func GetMsNodeStatus

func GetMsNodeStatus(nodeName string) (string, error)

func GetMsPool

func GetMsPool(poolName string) (*common.MayastorPool, error)

func GetMsvDeviceUri

func GetMsvDeviceUri(uuid string) (string, error)

func GetMsvMaxSnapshotCount

func GetMsvMaxSnapshotCount(uuid string) (int32, error)

func GetMsvNexusChildren

func GetMsvNexusChildren(volName string) ([]common.TargetChild, error)

func GetMsvNexusState

func GetMsvNexusState(uuid string) (string, error)

func GetMsvNodes

func GetMsvNodes(uuid string) (string, []string)

GetMsvNodes Retrieve the nexus node hosting the Mayastor Volume, and the names of the replica nodes function asserts if the volume CR is not found.

func GetMsvReplicaTopology

func GetMsvReplicaTopology(volUuid string) (common.ReplicaTopology, error)

func GetMsvReplicas

func GetMsvReplicas(volName string) ([]common.MsvReplica, error)

func GetMsvSize

func GetMsvSize(uuid string) (int64, error)

func GetMsvState

func GetMsvState(uuid string) (string, error)

func GetMsvTargetNode

func GetMsvTargetNode(uuid string) (string, error)

func GetNamespace

func GetNamespace(namespace string) error

func GetNexusNode

func GetNexusNode(vol_uuid string) (string, error)

GetNexusNode return nexus node given the volume uuid

func GetNexusNodeIp

func GetNexusNodeIp(vol_uuid string) (string, error)

GetNexusNodeIp return nexus node IP given the volume uuid

func GetNexusUuid

func GetNexusUuid(vol_uuid string) (string, error)

GetNexusUuid return the nexus uuid given the volume uuid

func GetNodeExtIPAddress

func GetNodeExtIPAddress(nodeName string) (*string, error)

GetNodeIPAddress returns IP address of a node

func GetNodeForPodByPrefix

func GetNodeForPodByPrefix(prefix string, namespace string) (string, error)

GetNodeForPodByPrefix return node where pod is running by pod prefix

func GetNodeIPAddress

func GetNodeIPAddress(nodeName string) (*string, error)

GetNodeIPAddress returns IP address of a node

func GetNodeListForPods

func GetNodeListForPods(labels, namespace string) (map[string]v1.PodPhase, error)

func GetNodeName

func GetNodeName(nodeIp string) (*string, error)

GetNodeName returns node name corresponding to IP address of a node

func GetNodeNameForScheduledPod

func GetNodeNameForScheduledPod(podName, nameSpace string) (string, error)

func GetNodeNqn

func GetNodeNqn(nodeIp string) (string, error)

GetNodeNqn return mayastor node nqn

func GetPV

func GetPV(volName string) (*coreV1.PersistentVolume, error)

GetPV Retrieve a PV in default namespace, no options and no context

func GetPVC

func GetPVC(volName string, nameSpace string) (*coreV1.PersistentVolumeClaim, error)

GetPVC Retrieve a PVC in default namespace, no options and no context

func GetPod

func GetPod(name, ns string) (*v1.Pod, error)

GetPod return requested pod by name in the given namespace

func GetPodAddress

func GetPodAddress(podName string, nameSpace string) (string, error)

func GetPodEvents

func GetPodEvents(podName string, namespace string) (*coreV1.EventList, error)

func GetPodHostIp

func GetPodHostIp(podName string, nameSpace string) (string, error)

GetPodHostIp retrieve the IP address of the node hosting a pod

func GetPodLog

func GetPodLog(podName string, nameSpace string) ([]string, error)

func GetPodRestartCount

func GetPodRestartCount(podName string, nameSpace string) (int32, error)

func GetPodScheduledStatus

func GetPodScheduledStatus(podName string, nameSpace string) (coreV1.ConditionStatus, string, error)

func GetPodStatus

func GetPodStatus(podName string, nameSpace string) (coreV1.PodPhase, error)

func GetPodStatusByPrefix

func GetPodStatusByPrefix(prefix string, namespace string) (coreV1.PodPhase, error)

GetPodStatusByPrefix return pod phase by pod prefix

func GetPoolSizeFraction

func GetPoolSizeFraction(pool common.MayastorPool, percentCapacity float64, unit string) int

returns the percentage of the disk pool in the selected units (1.00 = 100%)

func GetPoolUsageInCluster

func GetPoolUsageInCluster() (uint64, error)

GetPoolUsageInCluster use mayastorclient to enumerate the set of pools and sum up the pool usage in the cluster

func GetPvCapacity

func GetPvCapacity(pvName string) (*resource.Quantity, error)

GetPvCapacity Retrieve status capacity of a Persistent Volume

func GetPvStatusPhase

func GetPvStatusPhase(volname string) (phase coreV1.PersistentVolumePhase, err error)

GetPvStatusPhase Retrieve status phase of a Persistent Volume

func GetPvcCapacity

func GetPvcCapacity(volname string, namespace string) (*resource.Quantity, error)

GetPvcCapacity Retrieve status capacity of a Persistent Volume Claim

func GetPvcEvents

func GetPvcEvents(pvcName string, namespace string) (*coreV1.EventList, error)

func GetPvcStatusPhase

func GetPvcStatusPhase(volname string, nameSpace string) (phase coreV1.PersistentVolumeClaimPhase, err error)

GetPvcStatusPhase Retrieve status phase of a Persistent Volume Claim

func GetReplicaState

func GetReplicaState(volumeUuid string, replicaUuid string) (string, error)

func GetReplicaTopoloy

func GetReplicaTopoloy(volUuid string, replicaUuid string) (common.Replica, error)

func GetServiceIp

func GetServiceIp(serviceName string, nameSpace string) (string, error)

func GetSizePerUnits

func GetSizePerUnits(b uint64, unit string) float64

func GetSnapshot

func GetSnapshot(snapshotName string, namespace string) (*snapshotv1.VolumeSnapshot, error)

Get the Volume Snapshot

func GetSnapshotBoundContentName

func GetSnapshotBoundContentName(snapshotName string, namespace string) (string, error)

Get the volume Snapshot bound content name

func GetSnapshotClass

func GetSnapshotClass(snapshotClassName string) (*snapshotv1.VolumeSnapshotClass, error)

Get the Volume Snapshot class

func GetSnapshotContent

func GetSnapshotContent(snapshotContentName string) (*snapshotv1.VolumeSnapshotContent, error)

Get the Volume Snapshot content

func GetSnapshotContentAnnotation

func GetSnapshotContentAnnotation(snapshotContentName string) (map[string]string, error)

Get the Volume Snapshot content annotation

func GetSnapshotContentReadyStatus

func GetSnapshotContentReadyStatus(snapshotContentName string) (bool, *snapshotv1.VolumeSnapshotError, error)

Get the volume Snapshot content ready status

func GetSnapshotCpCloneReadyStatus

func GetSnapshotCpCloneReadyStatus(snapshotUid string, volUuid string) (bool, error)

Get the volume Snapshot ready status from control plane

func GetSnapshotCpReplicaSnapshots

func GetSnapshotCpReplicaSnapshots(snapshotUid string, volUuid string) ([]common.ReplicaSnapshot, error)

Get the volume Snapshot replica snapshots from control plane

func GetSnapshotCpRestoreSize

func GetSnapshotCpRestoreSize(snapshotUid string, volUuid string) (int64, error)

Get the volume Snapshot restore size from control plane

func GetSnapshotCpTimestamp

func GetSnapshotCpTimestamp(snapshotUid string, volUuid string) (string, error)

Get the volume Snapshot timestamp from control plane

func GetSnapshotCreationTime

func GetSnapshotCreationTime(snapshotName string, namespace string) (string, error)

Get the volumeSnapshot Creation Time

func GetSnapshotCreationTimeStamp

func GetSnapshotCreationTimeStamp(snapshotName string, namespace string) (string, error)

Get the Kubernetes Snapshot "CreationTimestamp"

func GetSnapshotReadyStatus

func GetSnapshotReadyStatus(snapshotName string, namespace string) (bool, *snapshotv1.VolumeSnapshotError, error)

Get the volume Snapshot ready status

func GetSnapshotRestoreSize

func GetSnapshotRestoreSize(snapshotName string, namespace string) (*resource.Quantity, error)

Get the volume Snapshot restore size

func GetSnapshotUid

func GetSnapshotUid(snapshotName string, namespace string) (string, error)

Get the volume Snapshot Uid

func GetStsSpecReplicas

func GetStsSpecReplicas(statefulSetName string, namespace string) (int32, error)

func GetStsStatusReplicas

func GetStsStatusReplicas(statefulSetName string, namespace string) (int32, error)

func GetSystemNamespaceUuid

func GetSystemNamespaceUuid() (string, error)

func GetVolumeProtocol

func GetVolumeProtocol(volUuid string) (string, error)

func GetVolumeReplicasChecksum

func GetVolumeReplicasChecksum(volName string, ns string) ([]string, error)

func GetVolumeSnapshotChecksum

func GetVolumeSnapshotChecksum(volUuid string, snapshotName string, ns string) ([]string, error)

func GetVolumeSnapshotFsCheck

func GetVolumeSnapshotFsCheck(volUuid string, snapshotName string, ns string, fsType common.FileSystemType) ([]string, error)
func getSnapshotCheckSum(replica replicaInfo) (string, error) {
	var checksum string

	nqn, err := GetNodeNqn(replica.IP)
	if err == nil {
		snapNqn, err := getSnapshotNqn(replica.URI)
		if err != nil {
			checksum = fmt.Sprintf("%s; %v", replica, err)
		} else {
			checksum, err = ChecksumReplica(replica.IP, replica.IP, snapNqn, 10, nqn)
			if err != nil {
				logf.Log.Info("ChecksumSnapshot failed", "error", err)
				// do not return from here because we want to unshare if the original
				// replica URI was a bdev
				checksum = fmt.Sprintf("%s; %v", replica, err)
			}
		}

	} else {
		logf.Log.Info("GetNodeNqn failed", "IP", replica.IP, "error", err)
		checksum = fmt.Sprintf("%s; %v", replica, err)
	}

	// for now ignore unshare errors as we may have successfully retrieved a checksum
	unsErr := mayastorclient.UnshareBdev(replica.IP, replica.UUID)
	if unsErr != nil {
		logf.Log.Info("Unshare bdev failed", "bdev UUID", replica.UUID, "node IP", replica.IP, "error", unsErr)
	}

	return checksum, err
}

func HelmGetValues

func HelmGetValues(releaseName string, namespace string) ([]byte, error)

Get values for a release from helm command This step will be needed before performing helm upgrade step

func HelmUpgradeChartfromYaml

func HelmUpgradeChartfromYaml(helmChart string, namespace string, releaseName string, setValues map[string]interface{}, filePath string, version string) (string, error)

Upgrade a chart from a yaml file using helm command

As an example "helm upgrade openebs openebs/openebs -n openebs -f old-values.yaml --version 4.1.1 \
  --set openebs-crds.csi.volumeSnapshots.enabled=false"

func InstallHelmChart

func InstallHelmChart(helmChart, version, namespace, releaseName string, values map[string]interface{}) error

func IsMsvDeleted

func IsMsvDeleted(uuid string) bool

func IsMsvPublished

func IsMsvPublished(uuid string) bool

func IsNodeReady

func IsNodeReady(nodeName string, node *v1.Node) (bool, error)

func IsNormalPvcEventPresent

func IsNormalPvcEventPresent(pvcName string, namespace string, errorSubstring string) (bool, error)

func IsPVCDeleted

func IsPVCDeleted(volName string, nameSpace string) (bool, error)

IsPVCDeleted Check for a deleted Persistent Volume Claim, either the object does not exist or the status phase is invalid.

func IsPVDeleted

func IsPVDeleted(volName string) (bool, error)

IsPVDeleted Check for a deleted Persistent Volume, either the object does not exist or the status phase is invalid.

func IsPodRunning

func IsPodRunning(podName string, nameSpace string) bool

func IsPodWithLabelsRunning

func IsPodWithLabelsRunning(labels, namespace string) (string, bool, error)

IsPodWithLabelsRunning expects that at any time only one application pod will be in running state if there are more then one pod in terminating state then it will return the last terminating pod.

func IsPvcBound

func IsPvcBound(pvcName string, nameSpace string) (bool, error)

IsPvcBound returns true if a PVC with the given name is bound otherwise false is returned.

func IsSnapshotContentDeleted

func IsSnapshotContentDeleted(snapshotContentName string) (bool, error)

IsSnapshotContentDeleted return true if Volume snapshot content does not exist in cluster

func IsSnapshotDeleted

func IsSnapshotDeleted(snapshotName string, namespace string) (bool, error)

IsSnapshotDeleted return true if Volume snapshot does not exist in cluster

func IsVolumeAccessibleOverRdma

func IsVolumeAccessibleOverRdma(volUuid string) (bool, error)

IsVolumeAccessibleOverRdma return true if volume device uri scheme contains rdma if volume is accessible over rdma then device uri will be like nvmf+tcp+rdma://<some-random-string>

func IsVolumeAccessibleOverTcp

func IsVolumeAccessibleOverTcp(volUuid string) (bool, error)

IsVolumeAccessibleOverTcp return true if volume device uri scheme contains tcp and not rdma if volume is accessible over rdma then device uri will be like nvmf+tcp://<some-random-string>

func KillPV

func KillPV(pvName string) error

KillPV destroy PV with extreme prejudice

func KubeCtlApplyYaml

func KubeCtlApplyYaml(filename string, dir string) error

Helper for passing yaml from the specified directory to kubectl

func KubeCtlDeleteYaml

func KubeCtlDeleteYaml(filename string, dir string) error

Helper for passing yaml from the specified directory to kubectl

func LabelNode

func LabelNode(nodename string, label string, value string) error

LabelNode add a label to a node label is a string in the form "key=value" function still succeeds if label already present

func ListAllNonMsnNodes

func ListAllNonMsnNodes() (*v1.NodeList, error)

ListAllNonMsnNodes list all nodes without io-engine label and without master node

func ListControlAndDataPlanePods

func ListControlAndDataPlanePods() (*coreV1.PodList, *coreV1.PodList, error)

func ListDaemonSet

func ListDaemonSet(namespace string) (v1.DaemonSetList, error)

func ListIOEngineNodes

func ListIOEngineNodes() (*v1.NodeList, error)

func ListIOEnginePods

func ListIOEnginePods() (*v1.PodList, error)

func ListMsPools

func ListMsPools() ([]common.MayastorPool, error)

func ListMsns

func ListMsns() ([]common.MayastorNode, error)

func ListMsvs

func ListMsvs() ([]common.MayastorVolume, error)

func ListNexusesInCluster

func ListNexusesInCluster() ([]mayastorclient.MayastorNexus, error)

ListNexusesInCluster use mayastorclient to enumerate the set of mayastor nexuses present in the cluster

func ListNodesWithoutNoScheduleTaint

func ListNodesWithoutNoScheduleTaint() ([]string, error)

ListNodesWithoutNoScheduleTaint returns list of nodes which does not have NoSchedule taint

func ListNvmeControllersInCluster

func ListNvmeControllersInCluster() ([]mayastorclient.NvmeController, error)

ListNvmeControllersInCluster use mayastorclient to enumerate the set of mayastor nvme controllers present in the cluster

func ListPVCs

func ListPVCs(nameSpace string) (*coreV1.PersistentVolumeClaimList, error)

ListPVCs retrieves pvc list from a given namespace.

func ListPod

func ListPod(ns string) (*v1.PodList, error)

ListPod return lis of pods in the given namespace

func ListPodsByPrefix

func ListPodsByPrefix(ns string, prefix string) ([]coreV1.Pod, error)

ListPodsByPrefix return list of pods in the given namespace with names that start with a prefix for example pods deployed on behalf of a daemonset

func ListPodsWithLabel

func ListPodsWithLabel(namespace string, labels map[string]string) (*v1.PodList, error)

ListPodsWithLabel return list of pods with a given label in the given namespace

func ListPoolsInCluster

func ListPoolsInCluster() ([]mayastorclient.MayastorPool, error)

ListPoolsInCluster use mayastorclient to enumerate the set of mayastor pools present in the cluster

func ListReplicasInCluster

func ListReplicasInCluster() ([]mayastorclient.MayastorReplica, error)

ListReplicasInCluster use mayastorclient to enumerate the set of mayastor replicas present in the cluster

func ListRunningMayastorPods

func ListRunningMayastorPods(timestamp *time.Time) ([]string, error)

List mayastor pod names, conditionally

  1. No timestamp - all mayastor pods
  2. With timestamp - all mayastor pods created after the timestamp which are Running.

func ListRunningMayastorPodsOnNode

func ListRunningMayastorPodsOnNode(nodeName string) ([]string, error)

List mayastor pod names scheduled on a given node

func ListSnapshot

func ListSnapshot(namespace string) (*snapshotv1.VolumeSnapshotList, error)

List the Volume Snapshot

func ListSnapshotClass

func ListSnapshotClass() (*snapshotv1.VolumeSnapshotClassList, error)

List the Volume Snapshot class

func ListSnapshotContent

func ListSnapshotContent() (*snapshotv1.VolumeSnapshotContentList, error)

List the Volume Snapshot content

func MakeFioContainer

func MakeFioContainer(name string, args []string) coreV1.Container

MakeFioContainer returns a container object setup to use e2e-fio and run fio with appropriate permissions. Privileged: True, AllowPrivilegeEscalation: True, RunAsUser root, parameters:

name - name of the container (usually the pod name)
args - container arguments, if empty the defaults to "sleep", "1000000"

func MakePVC

func MakePVC(volSizeMb int, volName string, scName string, volType common.VolumeType, nameSpace string, local bool, skipVolumeVerification bool) (string, error)

MakePVC Create a PVC and verify that

  1. The PVC status transitions to bound,
  2. The associated PV is created and its status transitions bound
  3. The associated maaystor volume is created and has a State "healthy" if engine is mayastor

func MakeSnapshot

func MakeSnapshot(pvcName string, snapshotClassName string, nameSpace string, snapshotName string) (*snapshotv1.VolumeSnapshot, string, error)

MakeSnapshot Create volume snapshot and verify that

  1. The Snapshot created
  2. The Snapshot class exist
  3. Volume snapshot content provisioned
  4. Bound Volume Snapshot content ready
  5. Volume Snapshot ready

MakeSnapshot function return snapshot object, corresponding snapshot content name and error

func MayastorNodesReady

func MayastorNodesReady(sleepTime int, duration int) (bool, error)

MayastorNodesReady Checks if the requisite number of mayastor nodes are online.

func MayastorReady

func MayastorReady(sleepTime int, duration int) (bool, error)

MayastorReady checks if the product installation is ready

func MayastorUndeletedPodCount

func MayastorUndeletedPodCount() int
>=0 definitive number of mayastor pods

< 0 indeterminate

func MkNamespace

func MkNamespace(nameSpace string) error

func MkPVC deprecated

func MkPVC(volSizeMb int, volName string, scName string, volType common.VolumeType, nameSpace string) (string, error)

Deprecated:MkPVC is deprecated. Make use of MakePVC function

func MkRestorePVC

func MkRestorePVC(pvcSizeMb int, pvcName string, scName string, nameSpace string, volType common.VolumeType, snapshotName string, skipVerification bool) (string, error)

MkRestorePVC Create a PVC from snapshot source and verify that

  1. The PVC status transitions to bound,
  2. The associated PV is created and its status transitions bound
  3. The associated MV is created and has a State "healthy"

func MkStorageClass

func MkStorageClass(scName string, scReplicas int, protocol common.ShareProto, nameSpace string) error

create a storage class with default volume binding mode i.e. not specified

func MonitorE2EFioPod

func MonitorE2EFioPod(podName string, nameSpace string) (*common.E2eFioPodOutputMonitor, error)

MonitorE2EFioPod launches a go thread to stream fio pod log output and scan that stream to populate fields in E2eFioPodOutputMonitor

func MsvConsistencyCheck

func MsvConsistencyCheck(uuid string) error

MsvConsistencyCheck check consistency of MSV Spec, Status, and associated objects returned by gRPC

func NewContainer

func NewContainer(opts ...OptionFunc) corev1.Container

New returns a new kubernetes container

func OpenEBSReady

func OpenEBSReady(sleepTime int, duration int) (bool, error)

OpenEBSReady checks if the product installation is ready

func PVCCreateAndFailCordon

func PVCCreateAndFailCordon(
	volSizeMb int,
	volName string,
	scName string,
	volType common.VolumeType,
	nameSpace string,
	timeoutsecs int,
) error

Attempt to create a PV, but expect it to fail

func PodPresentOnNode

func PodPresentOnNode(prefix string, namespace string, nodeName string) (bool, error)

PodPresentOnNode returns true if the pod is present on the given node

func PodReadyCheck

func PodReadyCheck(namespace string) (bool, error)

list all pods in given namespace and return true if all are in running state else return false

func ReadyCheck

func ReadyCheck(namespace string) (bool, error)

func RefreshPvcToGetPvName

func RefreshPvcToGetPvName(pvcName string, nameSpace string) (string, error)

Refresh the PVC contents, so that we can get the PV name.

func RemoveAllNodeSelectorsFromDaemonset

func RemoveAllNodeSelectorsFromDaemonset(daemonsetName string, namespace string) error

RemoveAllNodeSelectorsFromDaemonset removes all node selectors from the daemonset spec and apply

func RemoveAllNodeSelectorsFromDeployment

func RemoveAllNodeSelectorsFromDeployment(deploymentName string, namespace string) error

Remove all node selectors from the deployment spec and apply

func RemoveConfiguredLoopDeviceOnNode

func RemoveConfiguredLoopDeviceOnNode(node string, device e2e_agent.LoopDevice) error

func RemoveConfiguredLoopDeviceOnNodes

func RemoveConfiguredLoopDeviceOnNodes(nodeDeviceMap map[string]e2e_agent.LoopDevice) error

func RemoveControlNodeNoScheduleTaintFromNode

func RemoveControlNodeNoScheduleTaintFromNode(nodeName string) error

func RemoveHelmRepository

func RemoveHelmRepository(helmRepoName, helmRepoUrl string) error

func RemoveNoScheduleTaintFromNode

func RemoveNoScheduleTaintFromNode(nodeName string) error

func RemovePVC

func RemovePVC(volName string, scName string, nameSpace string, local bool) error

RmLocalPVC Delete a PVC in the default namespace and verify that

  1. The PVC is deleted
  2. The associated PV is deleted
  3. The associated mayastor volume is deleted if engine is mayastor

func RemovePVFinalizer

func RemovePVFinalizer(pvName string) error

RemovePVFinalizer remove the finalizer of a given PV

func RemoveRdmaDeviceOnAllWorkerNodes

func RemoveRdmaDeviceOnAllWorkerNodes() error

func RemoveRdmaDeviceOnNode

func RemoveRdmaDeviceOnNode(node string) error

func RemoveSnapshot

func RemoveSnapshot(snapshotName string, namespace string) error

RemoveSnapshot delete a snapshot in namespace and verify that

  1. The Volume Snapshot is deleted
  2. The associated Volume Snapshot ContentPV is deleted

func RemoveSnapshotContentAnnotation

func RemoveSnapshotContentAnnotation(snapshotContentName string) error

Remove the Volume Snapshot content annotations

func ReplaceConfigMapData

func ReplaceConfigMapData(name string, nameSpace string, data map[string]string) error

func ResourceCheck

func ResourceCheck(waitForPools bool) error

ResourceCheck Fit for purpose checks - No pods - No PVCs - No PVs - No MSVs - Mayastor pods are all healthy - All mayastor pools are online and if e2e-agent is available - mayastor pools usage is 0 - No nexuses - No replicas

func ResourceK8sCheck

func ResourceK8sCheck() error

func RestartMayastor

func RestartMayastor(restartTOSecs int, readyTOSecs int, poolsTOSecs int) error

RestartMayastor this function "restarts" mayastor by

  • cleaning up all mayastor resource artefacts,
  • deleting all mayastor pods

func RestartMayastorPods

func RestartMayastorPods(timeoutSecs int) error

RestartMayastorPods shortcut to reinstalling mayastor, especially useful on some platforms, for example calling this function after patching the installation to use different mayastor images, should allow us to have reasonable confidence that mayastor has been restarted with those images. Deletes all mayastor pods except for mayastor etcd pods, then waits upto specified time for new pods to be provisioned Simply deleting the pods and then waiting for daemonset ready checks do not work due to k8s latencies, for example it has been observed the mayastor-csi pods are deemed ready because they enter terminating state after we've checked for readiness Caller must perform readiness checks after calling this function.

func RestartMayastorPodsOnNode

func RestartMayastorPodsOnNode(restartTOSecs int, readyTOSecs int, poolsTOSecs int, nodeName string) error

RestartMayastorPodsOnNode restart all mayastor pods scheduled on a given node

func RestartPodByPrefix

func RestartPodByPrefix(prefix string) error

RestartPodByPrefix restart the pod by prefix name

func RestoreConfiguredPools

func RestoreConfiguredPools() error

func RestoreDeploymentReplicas

func RestoreDeploymentReplicas(deploymentName string, namespace string, timeout_seconds int, orig_replicas int32) error

func RestrictMayastorToSingleNode

func RestrictMayastorToSingleNode() (string, []string, error)

func RmNamespace

func RmNamespace(nameSpace string) error

func RmPVC deprecated

func RmPVC(volName string, scName string, nameSpace string) error

Deprecated:RmPVC is deprecated. Make use of RemovePVC function

func RmReplicasInCluster

func RmReplicasInCluster() error

RmReplicasInCluster use mayastorclient to remove mayastor replicas present in the cluster

func RmStorageClass

func RmStorageClass(scName string) error

remove a storage class

func RunFio

func RunFio(podName string, duration int, filename string, sizeMb int, args ...string) ([]byte, error)

FIXME: this function runs fio with a bunch of parameters which are not configurable. sizeMb should be 0 for fio to use the entire block device

func SaveHelmValues

func SaveHelmValues(releaseName string, namespace string, filePath string) error

Save values for a release from helm command to a yaml file As an example "helm get values openebs -n openebs -o yaml > old-values.yaml"

func ScaleCsiDeployment

func ScaleCsiDeployment(replication int32) error

ScaleCsiDeployment scale up or scale down CSI deployment

func ScanFioPodLogs

func ScanFioPodLogs(pod v1.Pod, synopsisIn *common.E2eFioPodLogSynopsis) *common.E2eFioPodLogSynopsis

func ScanFioPodLogsByName

func ScanFioPodLogsByName(podName string, nameSpace string) (*common.E2eFioPodLogSynopsis, error)

func SetAllContainerArgs

func SetAllContainerArgs(deploymentName string, containerName string, namespace string, args []string) error

Set all of the arguments for a container. Used for restoring the original set.

func SetContainerArgs

func SetContainerArgs(deploymentName string, containerName string, namespace string, argKey string, argValue string) ([]string, error)

Add argument to container in deployment

func SetDeploymentReplication

func SetDeploymentReplication(deploymentName string, namespace string, replicas *int32) error

Adjust the number of replicas in the deployment

func SetMayastorInitialPodCount

func SetMayastorInitialPodCount(count int)

func SetMsvReplicaCount

func SetMsvReplicaCount(uuid string, replicaCount int) error

func SetNexusRebuildVerify

func SetNexusRebuildVerify(on bool, daemonSetName string) error

SetNexusRebuildVerify sets or removes environment variable NEXUS_REBUILD_VERIFY for IO engine daemonset, then deletes all the IO engine pods and waits for Mayastor to be ready and pools to be online

func SetPromtailTolerations

func SetPromtailTolerations(tolerations []coreV1.Toleration, promtailDsName string, namespace string) error

func SetReplication

func SetReplication(appLabel string, namespace string, replicas *int32) error

func SetStatefulsetReplication

func SetStatefulsetReplication(statefulsetName string, namespace string, replicas *int32) error

Adjust the number of replicas in the statefulset

func SetupControlNode

func SetupControlNode(excludeLabels []string, testControlNodeLabel string) (bool, error)

SetupControlNode set up a node as the control node, A node is selected if it does not have any labels in the set defined by excludeLabels. A control node which is not a k8s master/control-plane node will be tainted with NoSchedule. Workloads are scheduled on the control node by setting tolerations when deploying the workload.

func SetupK8sEnv

func SetupK8sEnv() error

func SetupK8sEnvBasic

func SetupK8sEnvBasic() error

func SetupK8sLib

func SetupK8sLib() error

SetupK8sLib convenience function for applications using common code go code using ginkgo should not invoke this function.

func SetupPostgresEnvironment

func SetupPostgresEnvironment() ([]coreV1.Node, error)

SetupPostgresEnvironment sets up the environment for PostgreSQL by managing node labels and taints. Normally called in Before suit action. It will return a slice of nodes which are ready for postgres installation.

func ShareReplica

func ShareReplica(poolId string, replicaUuid string) (string, error)

func StatefulSetReady

func StatefulSetReady(statefulSetName string, namespace string) bool

func StsExists

func StsExists(statefulSetName string, namespace string) (bool, error)

func SuppressMayastorPodOnNode

func SuppressMayastorPodOnNode(nodeName string, timeout int) error

SuppressMayastorPodOnNode Prevent mayastor pod from running on the given node.

func TeardownTestEnv

func TeardownTestEnv() error

func TeardownTestEnvNoCleanup

func TeardownTestEnvNoCleanup() error

func TryMkOversizedPVC

func TryMkOversizedPVC(volSizeMb int, volName string, scName string, volType common.VolumeType, nameSpace string) (bool, error)

func UnShareReplica

func UnShareReplica(poolId string, replicaUuid string) error

func UninstallE2eAgent

func UninstallE2eAgent() error

func UninstallHelmRelease

func UninstallHelmRelease(releaseName, namespace string) error

func UnlabelNode

func UnlabelNode(nodename string, label string) error

UnlabelNode remove a label from a node function still succeeds if label not present

func UnscheduleIoEngineFromNode

func UnscheduleIoEngineFromNode(nodeIP string, nodeName string, podPrefix string, timeoutSecs int) error

UnscheduleIoEngineFromNode remove io engine label and verify pod removal from node

func UnsuppressMayastorPodOnNode

func UnsuppressMayastorPodOnNode(nodeName string, timeout int) error

UnsuppressMayastorPodOnNode Allow mayastor pod to run on the given node.

func UpdateDaemonSet

func UpdateDaemonSet(ds appsV1.DaemonSet, namespace string) (v1.DaemonSet, error)

func UpdateDemonsetContainerAllEnv

func UpdateDemonsetContainerAllEnv(daemonsetName string, containerName string, namespace string, env []coreV1.EnvVar) error

update daemonset container all env

func UpdateDemonsetContainerEnv

func UpdateDemonsetContainerEnv(daemonsetName string, containerName string, namespace string, envName string, envValue string) ([]coreV1.EnvVar, error)

update daemonset container env

func UpdateDeploymentReplica

func UpdateDeploymentReplica(deployName string, namespace string, replica int32) error

func UpdateHelmRepository

func UpdateHelmRepository(helmRepoName string) error

func UpdateNodeTaints

func UpdateNodeTaints(nodeName string, taintKey string) error

func UpdatePVC

UpdatePVC update a PVC in given namespace, no options and no context

func UpdatePvcSize

func UpdatePvcSize(pvcName string, namespace string, volSizeMb int) (*coreV1.PersistentVolumeClaim, error)

UpdatePvcSize updates the pvc resource request size

func UpgradeHelmChart

func UpgradeHelmChart(helmChart, namespace, releaseName, version string, values map[string]interface{}) ([]byte, error)

func UpgradeHelmChartForValues

func UpgradeHelmChartForValues(helmChart, namespace, releaseName string, values map[string]interface{}) error

func VerifyDeploymentReadyReplicaCount

func VerifyDeploymentReadyReplicaCount(name, namespace string, expectedReplicas int) (bool, error)

func VerifyIoEnginePodCreationOnNode

func VerifyIoEnginePodCreationOnNode(nodeIP string, podPrefix string, timeoutSecs int) bool

VerifyIoEnginePodCreationOnNode verify io engine pod creation on node

func VerifyIoEnginePodDeletionFromNode

func VerifyIoEnginePodDeletionFromNode(nodeIP string, podPrefix string, timeoutSecs int) bool

VerifyIoEnginePodDeletionFromNode verify io engine pod removal from node

func VerifyMayastorAndPoolReady

func VerifyMayastorAndPoolReady(timeoutSecs int) (bool, error)

func VerifyMayastorPvcIsUsable

func VerifyMayastorPvcIsUsable(pvc *coreV1.PersistentVolumeClaim) error

func VerifyMayastorVolumeProvision

func VerifyMayastorVolumeProvision(pvcName string, namespace string) (string, error)

Verify volume provisioning, return mayastor volume uuid and error

func VerifyPodStatusWithAppLabel

func VerifyPodStatusWithAppLabel(podLabel string, namespace string) (bool, error)

VerifyPodStatusWithAppLabel return true if all the pod with a given label are in running state

func VerifyPodsOnNode

func VerifyPodsOnNode(podLabelsList []string, nodeName string, namespace string) error

func VerifyPvcCreateAndFail

func VerifyPvcCreateAndFail(
	volSizeMb int,
	volName string,
	scName string,
	volType common.VolumeType,
	nameSpace string,
	timeoutsecs int,
	errorMessage string,
) error

func VerifyVolumeProvision

func VerifyVolumeProvision(pvcName string, namespace string) (string, error)

VerifyVolumeProvision Verify volume provisioning, return volume uuid and error

func VolumeComparePreFlightChecks

func VolumeComparePreFlightChecks(volUuid string, volTyp common.VolumeType, volName string, waitSecs uint) error

VolumeComparePreFlightChecks volume replicas can only be compared meaningfully if the volume is not degraded - ie all replicas are online and rebuilds if any have been completed. rebuilds will not complete if the volume is unpublished so this function mounts the volume on a sleeper fio pio (no io) and waits for the volume to be healthy, within a time period.

func WaitFioPodComplete

func WaitFioPodComplete(podName string, sleepTimeSecs, timeoutSecs int) error

WaitFioPodComplete waits until pod is in completed state

func WaitForDeploymentReady

func WaitForDeploymentReady(deploymentName string, namespace string, sleepTime int, duration int) bool

func WaitForDeploymentToMatchExpectedState

func WaitForDeploymentToMatchExpectedState(deployName string, namespace string, expectedReplica int) (bool, error)

func WaitForMCPPath

func WaitForMCPPath(timeout string) error

func WaitForMayastorSockets

func WaitForMayastorSockets(addrs []string, timeout string) error

func WaitForMayastorVolumeToProvision

func WaitForMayastorVolumeToProvision(msvName string) (*common.MayastorVolume, error)

Wait for the mayastor volume to be provisioned

func WaitForPodAbsentFromNode

func WaitForPodAbsentFromNode(podNameRegexp string, namespace string, nodeName string, timeoutSeconds int) error

Wait until all instances of the specified pod are absent from the given node

func WaitForPodNotRunningOnNode

func WaitForPodNotRunningOnNode(podNameRegexp string, namespace string, nodeName string, timeoutSeconds int) error

Wait until the instance of the specified pod is absent or not in the running state on the given node

func WaitForPodRunning

func WaitForPodRunning(podNameRegexp string, namespace string, timeoutSeconds int) error

Wait until the instance of the specified pod with prefix is present and in the running state

func WaitForPodRunningOnNode

func WaitForPodRunningOnNode(podNameRegexp string, namespace string, nodeName string, timeoutSeconds int) error

Wait until the instance of the specified pod is present and in the running state on the given node

func WaitForPoolsToBeOnline

func WaitForPoolsToBeOnline(timeoutSeconds int) error

func WaitForPvToProvision

func WaitForPvToProvision(pvName string) error

Wait for the PV to be provisioned

func WaitForPvcNormalEvent

func WaitForPvcNormalEvent(pvcName string, namespace string, errorSubstring string) (bool, error)

Wait for the PVC normal event return true if pvc normal event found else return false , it return error in case of error

func WaitPodComplete

func WaitPodComplete(podName string, sleepTimeSecs, timeoutSecs int) error

WaitPodComplete waits until pod is in completed state

func WaitPodRunning

func WaitPodRunning(podName string, nameSpace string, timeoutSecs int) bool

WaitPodRunning wait for pod to transition to running with timeout, returns true of the pod is running, false otherwise.

func WaitPvToBound

func WaitPvToBound(pvName string) error

Wait for the PV to bound

func WaitPvcToBound

func WaitPvcToBound(pvcName string, nameSpace string) error

Wait for the PVC to bound

func WipeVolumeReplicas

func WipeVolumeReplicas(volUuid string) error

func XfsCheck

func XfsCheck(nodeName string, deployName string, containerName string) (string, error)

XfsCheck returns output and exit status code of xfs_repair -n

func ZapPoolDevices

func ZapPoolDevices() error

func ZeroDeploymentReplicas

func ZeroDeploymentReplicas(deploymentName string, namespace string, timeout_seconds int) (int32, error)

func ZeroNodeHugePages

func ZeroNodeHugePages(nodeName string) (string, error)

ZeroNodeHugePages sets huge pages to 0 on current node

Types

type BenchmarkParams

type BenchmarkParams struct {
	InsertCount      int
	InsertStart      int
	OperationCount   int
	RecordCount      int
	ThreadCount      int
	WorkloadFileName string
}

type Chart

type Chart struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	AppVersion  string `json:"app_version"`
	Description string `json:"description"`
}

func GetLatestHelmChartVersion

func GetLatestHelmChartVersion(helmChart string) (Chart, error)

type ContainerBuilder

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

Builder provides utilities required to build a kubernetes container type

func NewContainerBuilder

func NewContainerBuilder() *ContainerBuilder

NewBuilder returns a new instance of builder

func (*ContainerBuilder) Build

func (b *ContainerBuilder) Build() (corev1.Container, error)

Build returns the final kubernetes container

func (*ContainerBuilder) WithArgumentsNew

func (b *ContainerBuilder) WithArgumentsNew(args []string) *ContainerBuilder

WithArgumentsNew sets the command arguments of the container

func (*ContainerBuilder) WithCommandNew

func (b *ContainerBuilder) WithCommandNew(cmd []string) *ContainerBuilder

WithCommandNew sets the command of the container

func (*ContainerBuilder) WithEnvs

func (b *ContainerBuilder) WithEnvs(envs []corev1.EnvVar) *ContainerBuilder

WithEnvs sets the envs of the container

func (*ContainerBuilder) WithEnvsNew

func (b *ContainerBuilder) WithEnvsNew(envs []corev1.EnvVar) *ContainerBuilder

WithEnvsNew sets the envs of the container

func (*ContainerBuilder) WithImage

func (b *ContainerBuilder) WithImage(img string) *ContainerBuilder

WithImage sets the image of the container

func (*ContainerBuilder) WithImagePullPolicy

func (b *ContainerBuilder) WithImagePullPolicy(policy corev1.PullPolicy) *ContainerBuilder

WithImagePullPolicy sets the image pull policy of the container

func (*ContainerBuilder) WithLifeCycle

func (b *ContainerBuilder) WithLifeCycle(lc *corev1.Lifecycle) *ContainerBuilder

WithLifeCycle sets the life cycle of the container

func (*ContainerBuilder) WithLivenessProbe

func (b *ContainerBuilder) WithLivenessProbe(liveness *corev1.Probe) *ContainerBuilder

WithLivenessProbe sets the liveness probe of the container

func (*ContainerBuilder) WithName

func (b *ContainerBuilder) WithName(name string) *ContainerBuilder

WithName sets the name of the container

func (*ContainerBuilder) WithPortsNew

func (b *ContainerBuilder) WithPortsNew(ports []corev1.ContainerPort) *ContainerBuilder

WithPortsNew sets ports of the container

func (*ContainerBuilder) WithPrivilegedSecurityContext

func (b *ContainerBuilder) WithPrivilegedSecurityContext(privileged *bool) *ContainerBuilder

WithPrivilegedSecurityContext sets securitycontext of the container

func (*ContainerBuilder) WithResources

func (b *ContainerBuilder) WithResources(
	resources *corev1.ResourceRequirements,
) *ContainerBuilder

WithResources sets resources of the container

func (*ContainerBuilder) WithResourcesByValue

func (b *ContainerBuilder) WithResourcesByValue(resources corev1.ResourceRequirements) *ContainerBuilder

WithResourcesByValue sets resources of the container

func (*ContainerBuilder) WithVolumeDevice

func (b *ContainerBuilder) WithVolumeDevice(volumeDevice corev1.VolumeDevice) *ContainerBuilder

func (*ContainerBuilder) WithVolumeDeviceOrMount

func (b *ContainerBuilder) WithVolumeDeviceOrMount(volName string, volType common.VolumeType) *ContainerBuilder

func (*ContainerBuilder) WithVolumeDevices

func (b *ContainerBuilder) WithVolumeDevices(volumeDevices []corev1.VolumeDevice) *ContainerBuilder

WithVolumeDevices builds the containers with the appropriate volumeDevices

func (*ContainerBuilder) WithVolumeMount

func (b *ContainerBuilder) WithVolumeMount(volumeMount corev1.VolumeMount) *ContainerBuilder

func (*ContainerBuilder) WithVolumeMountsNew

func (b *ContainerBuilder) WithVolumeMountsNew(volumeMounts []corev1.VolumeMount) *ContainerBuilder

WithVolumeMountsNew sets the command arguments of the container

type Deployment

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

Deployment is the wrapper over k8s deployment Object

func NewForAPIObject

func NewForAPIObject(
	obj *appsv1.Deployment,
	opts ...deploymentBuildOption,
) *Deployment

NewForAPIObject returns a new instance of builder for a given deployment Object

func (*Deployment) IsNotSyncSpec

func (d *Deployment) IsNotSyncSpec() bool

IsNotSyncSpec compare generation in status and spec and check if deployment spec is synced or not. If Generation <= Status.ObservedGeneration then deployment spec is not updated yet.

func (*Deployment) IsTerminationInProgress

func (d *Deployment) IsTerminationInProgress() bool

IsTerminationInProgress checks for older replicas are waiting to terminate or not. If Status.Replicas > Status.UpdatedReplicas then some of the older replicas are in running state because newer replicas are not in running state. It waits for newer replica to come into running state then terminate.

func (*Deployment) IsUpdateInProgress

func (d *Deployment) IsUpdateInProgress() bool

IsUpdateInProgress Checks if all the replicas are updated or not. If Status.AvailableReplicas < Status.UpdatedReplicas then all the older replicas are not there but there are less number of availableReplicas

func (*Deployment) VerifyReplicaStatus

func (d *Deployment) VerifyReplicaStatus() error

VerifyReplicaStatus verifies whether all the replicas of the deployment are up and running

type DeploymentBuilder

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

Builder enables building an instance of deployment

func NewDeploymentBuilder

func NewDeploymentBuilder() *DeploymentBuilder

NewBuilder returns a new instance of builder meant for deployment

func (*DeploymentBuilder) Build

func (b *DeploymentBuilder) Build() (*appsv1.Deployment, error)

Build returns a deployment instance

func (*DeploymentBuilder) WithLabelsNew

func (b *DeploymentBuilder) WithLabelsNew(labels map[string]string) *DeploymentBuilder

WithLabelsNew resets existing labels if any with ones that are provided here

func (*DeploymentBuilder) WithName

func (b *DeploymentBuilder) WithName(name string) *DeploymentBuilder

WithName sets the Name field of deployment with provided value.

func (*DeploymentBuilder) WithNamespace

func (b *DeploymentBuilder) WithNamespace(namespace string) *DeploymentBuilder

WithNamespace sets the Namespace field of deployment with provided value.

func (*DeploymentBuilder) WithNodeSelector

func (b *DeploymentBuilder) WithNodeSelector(selector map[string]string) *DeploymentBuilder

WithNodeSelector Sets the node selector with the provided argument.

func (*DeploymentBuilder) WithNodeSelectorNew

func (b *DeploymentBuilder) WithNodeSelectorNew(selector map[string]string) *DeploymentBuilder

WithNodeSelector Sets the node selector with the provided argument.

func (*DeploymentBuilder) WithPodTemplateSpecBuilder

func (b *DeploymentBuilder) WithPodTemplateSpecBuilder(
	tmplbuilder *PodtemplatespecBuilder,
) *DeploymentBuilder

WithPodTemplateSpecBuilder sets the template field of the deployment

func (*DeploymentBuilder) WithReplicas

func (b *DeploymentBuilder) WithReplicas(replicas *int32) *DeploymentBuilder

WithReplicas sets the replica field of deployment

func (*DeploymentBuilder) WithSelectorMatchLabels

func (b *DeploymentBuilder) WithSelectorMatchLabels(matchlabels map[string]string) *DeploymentBuilder

WithSelectorMatchLabels merges existing matchlabels if any with the ones that are provided here

func (*DeploymentBuilder) WithSelectorMatchLabelsNew

func (b *DeploymentBuilder) WithSelectorMatchLabelsNew(matchlabels map[string]string) *DeploymentBuilder

WithSelectorMatchLabelsNew resets existing matchlabels if any with ones that are provided here

type FioApp

type FioApp struct {
	Decor      string
	DeployName string
	VolSizeMb  int
	VolType    common.VolumeType
	FsType     common.FileSystemType
	// FsPercent -> controls size of file allocated on FS
	// 0 -> default (lessby N blocks) unless FsMiB is non-zero
	// > 0 < 100 percentage of available blocks used
	FsPercent uint
	// FS test file size in MiB - only effective if FsPercent == 0
	FsMiB                               uint
	ReplicaCount                        int
	Runtime                             uint
	Loops                               int
	VerifyReplicasOnDelete              bool
	AddFioArgs                          []string
	StatusInterval                      int
	OutputFormat                        string
	AppNodeName                         string
	ZeroFill                            bool
	WipeReplicas                        bool
	ThinProvisioned                     bool
	VolWaitForFirstConsumer             bool
	Liveness                            bool
	BlockSize                           uint
	SnapshotName                        string
	CloneFsIdAsVolumeId                 common.CloneFsIdAsVolumeIdType
	FioDebug                            string
	SaveFioPodLog                       bool
	PostOpSleep                         uint
	MountOptions                        []string
	VerifyReplicaWaitHealthyVolTimeSecs uint
	SkipRestoreVolumeVerification       bool
	AllowVolumeExpansion                common.AllowVolumeExpansion
	NodeHasTopologyKey                  string
	NodeSpreadTopologyKey               string
	NodeAffinityTopologyLabel           map[string]string
	MaxSnapshots                        int
	PoolHasTopologyKey                  string
	PoolAffinityTopologyLabel           map[string]string
	MountReadOnly                       bool
	// contains filtered or unexported fields
}

func (*FioApp) Cleanup

func (dfa *FioApp) Cleanup() error

func (*FioApp) CreateVolume

func (dfa *FioApp) CreateVolume() error

func (*FioApp) DeletePod

func (dfa *FioApp) DeletePod() error

func (*FioApp) DeployApp

func (dfa *FioApp) DeployApp() error

func (*FioApp) DeployAppWithArgs

func (dfa *FioApp) DeployAppWithArgs(fioArgsSet common.FioAppArgsSet) error

func (*FioApp) DeployFio

func (dfa *FioApp) DeployFio(fioArgsSet common.FioAppArgsSet, podPrefix string) error

func (*FioApp) DumpPodLog

func (dfa *FioApp) DumpPodLog()

func (*FioApp) DumpReplicas

func (dfa *FioApp) DumpReplicas()

func (*FioApp) FioTargetSizes

func (dfa *FioApp) FioTargetSizes() (map[string]uint64, error)

func (*FioApp) ForcedCleanup

func (dfa *FioApp) ForcedCleanup()

ForcedCleanup - delete resources associated with the FioApp by name regardless of creation status This function should be used sparingly. FIXME: refactor so that is function can be replaced by simply calling Cleanup

func (*FioApp) GetAppUuid

func (dfa *FioApp) GetAppUuid() string

func (*FioApp) GetPodName

func (dfa *FioApp) GetPodName() string

func (*FioApp) GetPodStatus

func (dfa *FioApp) GetPodStatus() (coreV1.PodPhase, error)

func (*FioApp) GetReplicaCount

func (dfa *FioApp) GetReplicaCount() int

func (*FioApp) GetScName

func (dfa *FioApp) GetScName() string

func (*FioApp) GetVolName

func (dfa *FioApp) GetVolName() string

func (*FioApp) GetVolUuid

func (dfa *FioApp) GetVolUuid() string

func (*FioApp) ImportVolume

func (dfa *FioApp) ImportVolume(volName string) error

func (*FioApp) ImportVolumeFromApp

func (dfa *FioApp) ImportVolumeFromApp(srcDfa *FioApp) error

func (*FioApp) IsPVCCreated

func (dfa *FioApp) IsPVCCreated() bool

PVC was created and PVC may not be accessbile

func (*FioApp) IsVolumeCreated

func (dfa *FioApp) IsVolumeCreated() bool

PVC was created and PVC is accessbile

func (*FioApp) MonitorPod

func (dfa *FioApp) MonitorPod() (*common.E2eFioPodOutputMonitor, error)

MonitorPod - invokes MonitorE2EFioPod which launches a go thread to stream fio pod log output and scan that stream to populate fields in E2eFioPodOutputMonitor

func (*FioApp) RefreshDeploymentFioPodName

func (dfa *FioApp) RefreshDeploymentFioPodName() error

RefreshDeploymentFioPodName update the name of the pod from the k8s deployment object

func (*FioApp) RefreshVolumeState

func (dfa *FioApp) RefreshVolumeState() error

func (*FioApp) ScaleVolumeReplicas

func (dfa *FioApp) ScaleVolumeReplicas(v int) error

func (*FioApp) SetAppNodeName

func (dfa *FioApp) SetAppNodeName(nodeName string) error

func (*FioApp) SetVolumeReplicaCount

func (dfa *FioApp) SetVolumeReplicaCount(replicaCount int) error

func (*FioApp) VerifyReplicas

func (dfa *FioApp) VerifyReplicas() error

VerifyReplicas verify replicas for volumes used by the FioApp instance

func (*FioApp) WaitComplete

func (dfa *FioApp) WaitComplete(timeoutSecs int) error

func (*FioApp) WaitDeploymentRunning

func (dfa *FioApp) WaitDeploymentRunning() (bool, error)

WaitDeploymentRunning wait for the number of running pod replicas to match 1

func (*FioApp) WaitFioComplete

func (dfa *FioApp) WaitFioComplete(timeoutSecs int, pollTimeSecs int) (int, error)

func (*FioApp) WaitRunning

func (dfa *FioApp) WaitRunning(timeoutSecs int) bool

type FioApplication

type FioApplication struct {
	Decor         string
	VolSizeMb     int
	VolType       common.VolumeType
	FsType        common.FileSystemType
	OpenEbsEngine common.OpenEbsEngine
	// FsPercent -> controls size of file allocated on FS
	// 0 -> default (lessby N blocks) unless FsMiB is non-zero.
	// > 0 < 100 percentage of available blocks used
	FsPercent uint
	// non-zero and FsPercent is 0 -> test file size in MiB
	FsMiB                   uint
	Runtime                 uint
	Loops                   int
	AddFioArgs              []string
	StatusInterval          int
	OutputFormat            string
	AppNodeName             string
	VolWaitForFirstConsumer bool
	ScMountOptions          []string
	ScReclaimPolicy         v1.PersistentVolumeReclaimPolicy
	Liveness                bool
	BlockSize               uint
	FioDebug                string
	SaveFioPodLog           bool
	PostOpSleep             uint
	AllowVolumeExpansion    common.AllowVolumeExpansion
	Lvm                     LvmOptions
	Zfs                     ZfsOptions
	HostPath                HostPathOptions

	SkipPvcVerificationAfterCreate bool
	// contains filtered or unexported fields
}

func (*FioApplication) Cleanup

func (dfa *FioApplication) Cleanup() error

func (*FioApplication) CreateSc

func (dfa *FioApplication) CreateSc() error

func (*FioApplication) CreateVolume

func (dfa *FioApplication) CreateVolume() error

func (*FioApplication) DeletePod

func (dfa *FioApplication) DeletePod() error

func (*FioApplication) DeployAppWithArgs

func (dfa *FioApplication) DeployAppWithArgs(fioArgsSet common.FioAppArgsSet) error

func (*FioApplication) DeployApplication

func (dfa *FioApplication) DeployApplication() error

func (*FioApplication) DeployFio

func (dfa *FioApplication) DeployFio(fioArgsSet common.FioAppArgsSet, podPrefix string) error

func (*FioApplication) DumpPodLog

func (dfa *FioApplication) DumpPodLog()

func (*FioApplication) FioTargetSizes

func (dfa *FioApplication) FioTargetSizes() (map[string]uint64, error)

func (*FioApplication) ForcedCleanup

func (dfa *FioApplication) ForcedCleanup()

ForcedCleanup - delete resources associated with the FioApplicationlication by name regardless of creation status This function should be used sparingly. FIXME: refactor so that is function can be replaced by simply calling Cleanup

func (*FioApplication) GetAppUuid

func (dfa *FioApplication) GetAppUuid() string

func (*FioApplication) GetPodName

func (dfa *FioApplication) GetPodName() string

func (*FioApplication) GetPodStatus

func (dfa *FioApplication) GetPodStatus() (coreV1.PodPhase, error)

func (*FioApplication) GetPvcName

func (dfa *FioApplication) GetPvcName() string

func (*FioApplication) GetScName

func (dfa *FioApplication) GetScName() string

func (*FioApplication) ImportVolume

func (dfa *FioApplication) ImportVolume(volName string) error

func (*FioApplication) ImportVolumeFromApp

func (dfa *FioApplication) ImportVolumeFromApp(srcDfa *FioApplication) error

func (*FioApplication) IsPVCCreated

func (dfa *FioApplication) IsPVCCreated() bool

PVC was created and PVC may not be accessbile

func (*FioApplication) MonitorPod

func (dfa *FioApplication) MonitorPod() (*common.E2eFioPodOutputMonitor, error)

MonitorPod - invokes MonitorE2EFioPod which launches a go thread to stream fio pod log output and scan that stream to populate fields in E2eFioPodOutputMonitor

func (*FioApplication) RefreshVolumeState

func (dfa *FioApplication) RefreshVolumeState() error

func (*FioApplication) SetAppNodeName

func (dfa *FioApplication) SetAppNodeName(nodeName string) error

func (*FioApplication) WaitComplete

func (dfa *FioApplication) WaitComplete(timeoutSecs int) error

func (*FioApplication) WaitFioComplete

func (dfa *FioApplication) WaitFioComplete(timeoutSecs int, pollTimeSecs int) (int, error)

func (*FioApplication) WaitRunning

func (dfa *FioApplication) WaitRunning(timeoutSecs int) bool

type FioApplicationStatus

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

type FioStsApp

type FioStsApp struct {
	Decor     string
	VolSizeMb int
	ScName    string
	StsName   string
	VolName   string
	// StatefulSet allows you to relax its ordering guarantees while preserving
	// its uniqueness and identity guarantees via its .spec.podManagementPolicy field
	// values permitted: "Parallel" and "OrderedReady"
	StsPodManagementPolicy string
	StsAffinityGroup       string // "true" or "false" for anti affinity feature for volume replicas and target
	VolType                common.VolumeType
	StsReplicaCount        *int32
	VolReplicaCount        int
	VolUuid                string
	FioArgs                []string
	Runtime                uint
	Loops                  int
	VerifyReplicasOnDelete bool
	AppNodeName            string
}

func (*FioStsApp) Cleanup

func (dfa *FioStsApp) Cleanup(replicaCount int) error

func (*FioStsApp) StsApp

func (dfa *FioStsApp) StsApp() error

type HostPathOptions

type HostPathOptions struct {
	Annotations map[string]string
}

type IOEngineNodeLocation

type IOEngineNodeLocation struct {
	NodeName  string
	IPAddress string
}

func GetIOEngineNodes

func GetIOEngineNodes() ([]IOEngineNodeLocation, error)

type LvmOptions

type LvmOptions struct {
	AllowedTopologies []v1.TopologySelectorTerm
	Shared            common.YesNoVal
	VgPattern         string
	Storage           string
	VolGroup          string
	ThinProvision     common.YesNoVal
}

type MongoApp

type MongoApp struct {
	Namespace    string
	Pod          coreV1.Pod
	VolUuid      string
	ReleaseName  string
	ReplicaCount int
	ScName       string
	Standalone   bool
	PvcName      string
	Ycsb         bool
}

func (*MongoApp) CompareBSONChecksums

func (mongo *MongoApp) CompareBSONChecksums(file1, file2 string) bool

func (*MongoApp) MongoDump

func (mongo *MongoApp) MongoDump() (string, error)

func (*MongoApp) MongoInstallReady

func (mongo *MongoApp) MongoInstallReady() error

type NodeLocation

type NodeLocation struct {
	NodeName        string
	IPAddress       string
	MayastorNode    bool
	K8sControlPlane bool
	ControlNode     bool
	ExtIPAddress    string
}

func GetTestControlNodes

func GetTestControlNodes() ([]NodeLocation, error)

func ListWorkerNode

func ListWorkerNode() ([]NodeLocation, error)

type OptionFunc

type OptionFunc func(*container)

OptionFunc is a typed function that abstracts anykind of operation against the provided container instance

This is the basic building block to create functional operations against the container instance

func WithImage

func WithImage(img string) OptionFunc

WithImage sets the image of the container

func WithName

func WithName(name string) OptionFunc

WithName sets the name of the container

type PgBenchApp

type PgBenchApp struct {
	BenchmarkParams PgBenchmarkParams // Parameters for benchmarking.
	Name            string            // Name of the PgBench application.
	Namespace       string            // Kubernetes namespace for the PgBench application.
	NodeSelector    string            // Node selector for scheduling the PgBench Pod.
	Pod             *coreV1.Pod       // Kubernetes Pod running the PgBench application.
}

PgBenchApp represents a PgBench application configuration for benchmarking PostgreSQL.

func (*PgBenchApp) DeletePgBenchJob

func (pgBench *PgBenchApp) DeletePgBenchJob(jobName string) error

func (*PgBenchApp) GetPgBenchJob

func (pgBench *PgBenchApp) GetPgBenchJob(jobName string) (*batchV1.Job, error)

func (*PgBenchApp) InitializePgBench

func (pgBench *PgBenchApp) InitializePgBench(host string) error

InitializePgBench initializes the PgBench database. Must be called before RunPgBench

func (*PgBenchApp) RunPgBench

func (pgBench *PgBenchApp) RunPgBench(host string) error

RunPgBench runs the PgBench benchmark on the PostgreSQL database.

type PgBenchAppBuilder

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

func NewPgBenchAppBuilder

func NewPgBenchAppBuilder() *PgBenchAppBuilder

NewPgBenchAppBuilder creates a new PgBenchApp instance with default benchmark parameters.

func (*PgBenchAppBuilder) Build

func (b *PgBenchAppBuilder) Build() *PgBenchApp

func (*PgBenchAppBuilder) WithBenchmarkParams

func (b *PgBenchAppBuilder) WithBenchmarkParams(params PgBenchmarkParams) *PgBenchAppBuilder

func (*PgBenchAppBuilder) WithName

func (b *PgBenchAppBuilder) WithName(name string) *PgBenchAppBuilder

func (*PgBenchAppBuilder) WithNamespace

func (b *PgBenchAppBuilder) WithNamespace(namespace string) *PgBenchAppBuilder

func (*PgBenchAppBuilder) WithNodeSelector

func (b *PgBenchAppBuilder) WithNodeSelector(nodeSelector string) *PgBenchAppBuilder

type PgBenchmarkParams

type PgBenchmarkParams struct {
	ConcurrentClients int // Number of concurrent clients for PgBench.
	ThreadCount       int // Number of threads for PgBench.
	DurationSeconds   int // Duration of the benchmark in seconds.
}

type Pod

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

type PodBuilder

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

PodBuilder is the builder object for Pod

func NewPodBuilder

func NewPodBuilder(appLabelValue string) *PodBuilder

NewPodBuilder returns new instance of Builder

func (*PodBuilder) Build

func (b *PodBuilder) Build() (*corev1.Pod, error)

Build returns the Pod API instance

func (*PodBuilder) WithContainer

func (b *PodBuilder) WithContainer(container corev1.Container) *PodBuilder

WithContainer sets the Containers field in Pod with provided arguments

func (*PodBuilder) WithContainers

func (b *PodBuilder) WithContainers(containers []corev1.Container) *PodBuilder

WithContainers sets the Containers field in Pod with provided arguments

func (*PodBuilder) WithHostPath

func (b *PodBuilder) WithHostPath(name string, hostPath string) *PodBuilder

func (*PodBuilder) WithLabels

func (b *PodBuilder) WithLabels(labels map[string]string) *PodBuilder

WithNamespace sets the Namespace field of Pod with provided value.

func (*PodBuilder) WithMountReadOnly

func (b *PodBuilder) WithMountReadOnly(rdOnly bool) *PodBuilder

WithMountReadOnly - mount filesystem volumes as read only fails at Build if volume is raw block

func (*PodBuilder) WithName

func (b *PodBuilder) WithName(name string) *PodBuilder

WithName sets the Name field of Pod with provided value.

func (*PodBuilder) WithNamespace

func (b *PodBuilder) WithNamespace(namespace string) *PodBuilder

WithNamespace sets the Namespace field of Pod with provided value.

func (*PodBuilder) WithNodeName

func (b *PodBuilder) WithNodeName(nodeName string) *PodBuilder

WithNodeName sets the NodeName field of Pod with provided value.

func (*PodBuilder) WithNodeSelectorHostnameNew

func (b *PodBuilder) WithNodeSelectorHostnameNew(hostname string) *PodBuilder

WithNodeSelectorHostnameNew sets the Pod NodeSelector to the provided hostname value This function replaces (resets) the NodeSelector to use only hostname selector

func (*PodBuilder) WithRestartPolicy

func (b *PodBuilder) WithRestartPolicy(
	restartPolicy corev1.RestartPolicy,
) *PodBuilder

WithRestartPolicy sets the RestartPolicy field in Pod with provided arguments

func (*PodBuilder) WithServiceAccountName

func (b *PodBuilder) WithServiceAccountName(serviceAccountName string) *PodBuilder

WithServiceAccountName sets the ServiceAccountName of Pod spec with the provided value

func (*PodBuilder) WithTolerationsForTaints

func (b *PodBuilder) WithTolerationsForTaints(taints ...corev1.Taint) *PodBuilder

WithTolerationsForTaints sets the Spec.Tolerations with provided taints.

func (*PodBuilder) WithVolume

func (b *PodBuilder) WithVolume(volume corev1.Volume) *PodBuilder

WithVolume sets the Volumes field in Pod with provided arguments

func (*PodBuilder) WithVolumeDevice

func (b *PodBuilder) WithVolumeDevice(volDevice corev1.VolumeDevice) *PodBuilder

WithVolumeDevice sets the Volumes field in Pod with provided arguments

func (*PodBuilder) WithVolumeDeviceOrMount

func (b *PodBuilder) WithVolumeDeviceOrMount(volType common.VolumeType) *PodBuilder

func (*PodBuilder) WithVolumeDevices

func (b *PodBuilder) WithVolumeDevices(volDevices []corev1.VolumeDevice) *PodBuilder

WithVolumeDevices sets the Volumes field in Pod with provided arguments

func (*PodBuilder) WithVolumeMount

func (b *PodBuilder) WithVolumeMount(volMount corev1.VolumeMount) *PodBuilder

WithVolumeMount sets the Volumes field in Pod with provided arguments

func (*PodBuilder) WithVolumeMounts

func (b *PodBuilder) WithVolumeMounts(volMounts []corev1.VolumeMount) *PodBuilder

WithVolumeMounts sets the Volumes field in Pod with provided arguments

func (*PodBuilder) WithVolumes

func (b *PodBuilder) WithVolumes(volumes []corev1.Volume) *PodBuilder

WithVolumes sets the Volumes field in Pod with provided arguments

type PodTemplateSpec

type PodTemplateSpec struct {
	Object *corev1.PodTemplateSpec
}

PodTemplateSpec holds the api's podtemplatespec objects

type PodtemplatespecBuilder

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

Builder is the builder object for Pod

func NewPodtemplatespecBuilder

func NewPodtemplatespecBuilder() *PodtemplatespecBuilder

NewBuilder returns new instance of Builder

func (*PodtemplatespecBuilder) Build

Build returns a padTemplateSpec instance

func (*PodtemplatespecBuilder) WithAffinity

func (b *PodtemplatespecBuilder) WithAffinity(affinity *corev1.Affinity) *PodtemplatespecBuilder

WithAffinity sets the affinity field of podtemplatespec

func (*PodtemplatespecBuilder) WithAnnotations

func (b *PodtemplatespecBuilder) WithAnnotations(annotations map[string]string) *PodtemplatespecBuilder

WithAnnotations merges existing annotations if any with the ones that are provided here

func (*PodtemplatespecBuilder) WithAnnotationsNew

func (b *PodtemplatespecBuilder) WithAnnotationsNew(annotations map[string]string) *PodtemplatespecBuilder

WithAnnotationsNew resets the annotation field of podtemplatespec with provided arguments

func (*PodtemplatespecBuilder) WithContainerBuilders

func (b *PodtemplatespecBuilder) WithContainerBuilders(
	containerBuilderList ...*ContainerBuilder,
) *PodtemplatespecBuilder

WithContainerBuilders builds the list of containerbuilder provided and merges it to the containers field of the podtemplatespec

func (*PodtemplatespecBuilder) WithContainerBuildersNew

func (b *PodtemplatespecBuilder) WithContainerBuildersNew(
	containerBuilderList ...*ContainerBuilder,
) *PodtemplatespecBuilder

WithContainerBuildersNew builds the list of containerbuilder provided and sets the containers field of the podtemplatespec

func (*PodtemplatespecBuilder) WithLabels

func (b *PodtemplatespecBuilder) WithLabels(labels map[string]string) *PodtemplatespecBuilder

WithLabels merges existing labels if any with the ones that are provided here

func (*PodtemplatespecBuilder) WithLabelsNew

func (b *PodtemplatespecBuilder) WithLabelsNew(labels map[string]string) *PodtemplatespecBuilder

WithLabelsNew resets the labels field of podtemplatespec with provided arguments

func (*PodtemplatespecBuilder) WithName

WithName sets the Name field of podtemplatespec with provided value.

func (*PodtemplatespecBuilder) WithNamespace

func (b *PodtemplatespecBuilder) WithNamespace(namespace string) *PodtemplatespecBuilder

WithNamespace sets the Namespace field of PodTemplateSpec with provided value.

func (*PodtemplatespecBuilder) WithNodeSelector

func (b *PodtemplatespecBuilder) WithNodeSelector(nodeselectors map[string]string) *PodtemplatespecBuilder

WithNodeSelector merges the nodeselectors if present with the provided arguments

func (*PodtemplatespecBuilder) WithNodeSelectorByValue

func (b *PodtemplatespecBuilder) WithNodeSelectorByValue(nodeselectors map[string]string) *PodtemplatespecBuilder

func (*PodtemplatespecBuilder) WithNodeSelectorNew

func (b *PodtemplatespecBuilder) WithNodeSelectorNew(nodeselectors map[string]string) *PodtemplatespecBuilder

WithNodeSelectorNew resets the nodeselector field of podtemplatespec with provided arguments

func (*PodtemplatespecBuilder) WithPriorityClassName

func (b *PodtemplatespecBuilder) WithPriorityClassName(prorityClassName string) *PodtemplatespecBuilder

WithPriorityClassName sets the PriorityClassName field of podtemplatespec

func (*PodtemplatespecBuilder) WithServiceAccountName

func (b *PodtemplatespecBuilder) WithServiceAccountName(serviceAccountnNme string) *PodtemplatespecBuilder

WithServiceAccountName sets the ServiceAccountnNme field of podtemplatespec

func (*PodtemplatespecBuilder) WithTolerations

func (b *PodtemplatespecBuilder) WithTolerations(tolerations ...corev1.Toleration) *PodtemplatespecBuilder

WithTolerations merges the existing tolerations with the provided arguments

func (*PodtemplatespecBuilder) WithTolerationsByValue

func (b *PodtemplatespecBuilder) WithTolerationsByValue(tolerations ...corev1.Toleration) *PodtemplatespecBuilder

WithTolerationsByValue sets pod toleration. If provided tolerations argument is empty it does not complain.

func (*PodtemplatespecBuilder) WithTolerationsNew

func (b *PodtemplatespecBuilder) WithTolerationsNew(tolerations ...corev1.Toleration) *PodtemplatespecBuilder

WithTolerationsNew sets the tolerations field of podtemplatespec

func (*PodtemplatespecBuilder) WithVolumeBuilders

func (b *PodtemplatespecBuilder) WithVolumeBuilders(
	volumeBuilderList ...*VolumeBuilder,
) *PodtemplatespecBuilder

WithVolumeBuilders builds the list of volumebuilders provided and merges it to the volumes field of podtemplatespec.

func (*PodtemplatespecBuilder) WithVolumeBuildersNew

func (b *PodtemplatespecBuilder) WithVolumeBuildersNew(
	volumeBuilderList ...*VolumeBuilder,
) *PodtemplatespecBuilder

WithVolumeBuildersNew builds the list of volumebuilders provided and sets Volumes field of podtemplatespec.

type PortInfo

type PortInfo struct {
	PCI     string `json:"pci"`
	Type    string `json:"type"`
	Netdev  string `json:"netdev"`
	Flavour string `json:"flavour"`
	Port    int    `json:"port"`
}

type PortMap

type PortMap struct {
	Port map[string]PortInfo `json:"port"`
}
func ListDevLink(node string) (PortMap, error)

type PostgresApp

type PostgresApp struct {
	Namespace    string     // Kubernetes namespace where the PostgreSQL application is deployed.
	Pod          coreV1.Pod // Kubernetes Pod running the PostgreSQL application.
	VolUuid      string     // UUID of the provisioned volume for the PostgreSQL application.
	ReleaseName  string     // Helm release name for the PostgreSQL application.
	ReplicaCount int        // Number of replicas for the PostgreSQL StatefulSet.
	ScName       string     // StorageClass name used for provisioning volumes.
	Standalone   bool       // Indicates if the PostgreSQL deployment is standalone.
	PvcName      string     // Name of the PersistentVolumeClaim.
	PgBench      PgBenchApp // PgBench application configuration for benchmarking.
}

PostgresApp represents a PostgreSQL application deployment configuration.

func (*PostgresApp) PostgresInstallReady

func (psql *PostgresApp) PostgresInstallReady() error

PostgresInstallReady checks if the PostgreSQL application is installed and ready.

type Pvc

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

type PvcBuilder

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

PvcBuilder enables building an instance of PersistentVolumeClaim

func NewPvcBuilder

func NewPvcBuilder() *PvcBuilder

NewPvcBuilder returns new instance of PvcBuilder

func (*PvcBuilder) Build

Build returns the StorageClass API instance

func (*PvcBuilder) BuildAndCreate

func (b *PvcBuilder) BuildAndCreate() error

Build and create the StorageClass

func (*PvcBuilder) WithAccessModes

func (b *PvcBuilder) WithAccessModes(mode coreV1.PersistentVolumeAccessMode) *PvcBuilder

WithAccessModes sets the accessModes field of pvc with provided argument.

func (*PvcBuilder) WithDataSourceApiGroup

func (b *PvcBuilder) WithDataSourceApiGroup(dataSourceApiGroup string) *PvcBuilder

WithDataSourceApiGroup sets the data source aoi group field of pvc with provided argument.

func (*PvcBuilder) WithDataSourceKind

func (b *PvcBuilder) WithDataSourceKind(dataSourceKind string) *PvcBuilder

WithDataSourceKind sets the data source kind field of pvc with provided argument.

func (*PvcBuilder) WithDataSourceName

func (b *PvcBuilder) WithDataSourceName(dataSourceName string) *PvcBuilder

WithDataSourceName sets the data source name field of pvc with provided argument.

func (*PvcBuilder) WithName

func (b *PvcBuilder) WithName(name string) *PvcBuilder

WithName sets the Name field of pvc with provided argument.

func (*PvcBuilder) WithNamespace

func (b *PvcBuilder) WithNamespace(namespace string) *PvcBuilder

WithNamespace sets the Namespace field of pvc with provided argument.

func (*PvcBuilder) WithPvcSize

func (b *PvcBuilder) WithPvcSize(size string) *PvcBuilder

WithPvcSize sets the size field of pvc with provided argument.

func (*PvcBuilder) WithStorageClass

func (b *PvcBuilder) WithStorageClass(scName string) *PvcBuilder

WithStorageClass sets the storage class name field of pvc with provided argument.

func (*PvcBuilder) WithVolumeMode

func (b *PvcBuilder) WithVolumeMode(volType common.VolumeType) *PvcBuilder

WithStorageClass sets the storage class name field of pvc with provided argument.

type RdmaDeviceNetworkInterface

type RdmaDeviceNetworkInterface struct {
	IfIndex       int    `json:"ifindex"`
	IfName        string `json:"ifname"`
	Port          int    `json:"port"`
	State         string `json:"state"`
	PhysicalState string `json:"physical_state"`
	NetDev        string `json:"netdev"`
	NetDevIndex   int    `json:"netdev_index"`
}

func ListRdmaDevice

func ListRdmaDevice(node string) ([]RdmaDeviceNetworkInterface, error)

type ReplicaMount

type ReplicaMount struct {
	Spec   ReplicaMountSpec
	Status ReplicaMountStatus
}

func ConnectReplica

func ConnectReplica(spec ReplicaMountSpec, maxRetries int) (*ReplicaMount, error)

func (*ReplicaMount) Unmount

func (rm *ReplicaMount) Unmount() bool

type ReplicaMountSpec

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

type ReplicaMountStatus

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

type ScBuilder

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

ScBuilder enables building an instance of StorageClass

func NewScBuilder

func NewScBuilder() *ScBuilder

NewScBuilder returns new instance of ScBuilder

func NewStorageClassBuilder

func NewStorageClassBuilder() *ScBuilder

NewStorageClassBuilder returns new instance of ScBuilder

func (*ScBuilder) Build

func (b *ScBuilder) Build() (*storagev1.StorageClass, error)

Build returns the StorageClass API instance

func (*ScBuilder) BuildAndCreate

func (b *ScBuilder) BuildAndCreate() error

Build and create the StorageClass

func (*ScBuilder) WithAllowedTopologies

func (b *ScBuilder) WithAllowedTopologies(value []v1.TopologySelectorTerm) *ScBuilder

WithLvmAllowedTopologies sets the allowedTopologies of storageclass to given argument.

func (*ScBuilder) WithAnnotations

func (b *ScBuilder) WithAnnotations(annotations map[string]string) *ScBuilder

WithAnnotations sets the Annotations field of storageclass with provided value.

func (*ScBuilder) WithCloneFsIdAsVolumeId

func (b *ScBuilder) WithCloneFsIdAsVolumeId(value common.CloneFsIdAsVolumeIdType) *ScBuilder

WithCloneFsIdAsVolumeId sets the cloneFsIdAsVolumeId parameter of storageclass with provided argument.

func (*ScBuilder) WithFileSystemType

func (b *ScBuilder) WithFileSystemType(value common.FileSystemType) *ScBuilder

WithFileType sets the fsType parameter of storageclass with provided argument.

func (*ScBuilder) WithGenerateName

func (b *ScBuilder) WithGenerateName(name string) *ScBuilder

WithGenerateName appends a random string after the name

func (*ScBuilder) WithIOTimeout

func (b *ScBuilder) WithIOTimeout(value int) *ScBuilder

WithIOTimeout sets the ioTimeout parameter of storageclass with provided argument.

func (*ScBuilder) WithLvmShared

func (b *ScBuilder) WithLvmShared(value string) *ScBuilder

LVM WithLvmShared sets the shared parameter of storageclass with provided argument.

func (*ScBuilder) WithLvmStorage

func (b *ScBuilder) WithLvmStorage(value string) *ScBuilder

WithLvmStorage sets the storage parameter of storageclass to given argument.

func (*ScBuilder) WithLvmThinVol

func (b *ScBuilder) WithLvmThinVol(val string) *ScBuilder

WithLvmThinVol sets the thinProvision parameter of storageclass to yes or no

func (*ScBuilder) WithLvmVgPattern

func (b *ScBuilder) WithLvmVgPattern(value string) *ScBuilder

WithLvmVgPattern sets the vgPattern parameter of storageclass with provided argument.

func (*ScBuilder) WithLvmVolGroup

func (b *ScBuilder) WithLvmVolGroup(value string) *ScBuilder

WithLvmVolGroup sets the volGroup parameter of storageclass with provided argument.

func (*ScBuilder) WithMaxSnapshots

func (b *ScBuilder) WithMaxSnapshots(value int) *ScBuilder

WithMaxSnapshots sets the maxSnapshots parameter of storageclass with provided argument.

func (*ScBuilder) WithMountOption

func (b *ScBuilder) WithMountOption(option string) *ScBuilder

func (*ScBuilder) WithMountOptions

func (b *ScBuilder) WithMountOptions(options []string) *ScBuilder

func (*ScBuilder) WithName

func (b *ScBuilder) WithName(name string) *ScBuilder

WithName sets the Name field of storageclass with provided argument.

func (*ScBuilder) WithNamespace

func (b *ScBuilder) WithNamespace(ns string) *ScBuilder

WithNamespace sets the namespace field of storageclass with provided argument.

func (*ScBuilder) WithNodeAffinityTopologyLabel

func (b *ScBuilder) WithNodeAffinityTopologyLabel(topology map[string]string) *ScBuilder

func (*ScBuilder) WithNodeHasTopologyKey

func (b *ScBuilder) WithNodeHasTopologyKey(topologyKey string) *ScBuilder

func (*ScBuilder) WithNodeSpreadTopologyKey

func (b *ScBuilder) WithNodeSpreadTopologyKey(topologyKey string) *ScBuilder

func (*ScBuilder) WithNvmeCtrlLossTmo

func (b *ScBuilder) WithNvmeCtrlLossTmo(value int) *ScBuilder

WithNvmeCtrlLossTmo sets the nvme controller loss timeout parameter of storageclass with provided argument.

func (*ScBuilder) WithPoolAffinityTopologyLabel

func (b *ScBuilder) WithPoolAffinityTopologyLabel(topology map[string]string) *ScBuilder

func (*ScBuilder) WithPoolHasTopologyKey

func (b *ScBuilder) WithPoolHasTopologyKey(topologyKey string) *ScBuilder

func (*ScBuilder) WithProtocol

func (b *ScBuilder) WithProtocol(value common.ShareProto) *ScBuilder

WithProtocol sets the protocol parameter of storageclass with provided argument.

func (*ScBuilder) WithProvisioner

func (b *ScBuilder) WithProvisioner(provisioner string) *ScBuilder

WithProvisioner sets the Provisioner field of storageclass with provided argument.

func (*ScBuilder) WithProvisioningType

func (b *ScBuilder) WithProvisioningType(provisioningType common.ProvisioningType) *ScBuilder

WithProvisioningType sets the thin provisioning field of storageclass with provided argument.

func (*ScBuilder) WithReclaimPolicy

func (b *ScBuilder) WithReclaimPolicy(reclaimPolicy v1.PersistentVolumeReclaimPolicy) *ScBuilder

WithReclaimPolicy sets the reclaim policy field of storageclass with provided argument.

func (*ScBuilder) WithReplicas

func (b *ScBuilder) WithReplicas(value int) *ScBuilder

WithReplicas sets the replica parameter of storageclass with provided argument.

func (*ScBuilder) WithStsAffinityGroup

func (b *ScBuilder) WithStsAffinityGroup(stsAffinity common.StsAffinityGroup) *ScBuilder

WithStsAffinityGroup sets the stsAffinityGroup field of storageclass with provided argument.

func (*ScBuilder) WithVolumeBindingMode

func (b *ScBuilder) WithVolumeBindingMode(bindingMode storagev1.VolumeBindingMode) *ScBuilder

WithVolumeBindingMode sets the volume binding mode of storageclass with provided argument. VolumeBindingMode indicates how PersistentVolumeClaims should be bound. VolumeBindingImmediate indicates that PersistentVolumeClaims should be immediately provisioned and bound. This is the default mode. VolumeBindingWaitForFirstConsumer indicates that PersistentVolumeClaims should not be provisioned and bound until the first Pod is created that references the PeristentVolumeClaim. The volume provisioning and binding will occur during Pod scheduing.

func (*ScBuilder) WithVolumeExpansion

func (b *ScBuilder) WithVolumeExpansion(value common.AllowVolumeExpansion) *ScBuilder

WithVolumeExpansion sets the AllowVolumeExpansion field of storageclass.

func (*ScBuilder) WithZfsCompression

func (b *ScBuilder) WithZfsCompression(value string) *ScBuilder

WithZfsCompression sets the compression parameter of storageclass with provided argument.

func (*ScBuilder) WithZfsDeDUp

func (b *ScBuilder) WithZfsDeDUp(value string) *ScBuilder

WithZfsDeDUp sets the dedup parameter of storageclass to given argument.

func (*ScBuilder) WithZfsPoolName

func (b *ScBuilder) WithZfsPoolName(value string) *ScBuilder

WithZfsPoolName sets the poolname parameter of storageclass to given argument.

func (*ScBuilder) WithZfsRecordSize

func (b *ScBuilder) WithZfsRecordSize(value string) *ScBuilder

WithZfsRecordSize sets the recordsize parameter of storageclass with provided argument.

func (*ScBuilder) WithZfsShared

func (b *ScBuilder) WithZfsShared(value string) *ScBuilder

ZFS WithZfsShared sets the shared parameter of storageclass with provided argument.

func (*ScBuilder) WithZfsThinVol

func (b *ScBuilder) WithZfsThinVol(val string) *ScBuilder

WithZfsThinVol sets the thinProvision parameter of storageclass to yes or no

type ScFioVolumeName

type ScFioVolumeName struct {
	VolName    string
	Uuid       string
	ScName     string
	FioPodName string
	NexusNode  string
}

ScFioVolumeName holds the fio pod, storage class, volume names and uuid

func CreateScVolumeAndFio

func CreateScVolumeAndFio(prefix string, replicaCount int, volSizeMb int, nodeName string, volType common.VolumeType) (ScFioVolumeName, error)

CreateScVolumeAndFio creates sc, volume and fio pod and return struct of volume name, volume uuid, sc name,fio pod name

type Statefulset

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

Statefulset is the wrapper over k8s statefulset Object

func (*Statefulset) IsNotSyncSpec

func (d *Statefulset) IsNotSyncSpec() bool

IsNotSyncSpec compare generation in status and spec and check if statefulset spec is synced or not. If Generation <= Status.ObservedGeneration then statefulset spec is not updated yet.

func (*Statefulset) IsTerminationInProgress

func (d *Statefulset) IsTerminationInProgress() bool

IsTerminationInProgress checks for older replicas are waiting to terminate or not. If Status.Replicas > Status.UpdatedReplicas then some of the older replicas are in running state because newer replicas are not in running state. It waits for newer replica to come into running state then terminate.

func (*Statefulset) IsUpdateInProgress

func (d *Statefulset) IsUpdateInProgress() bool

IsUpdateInProgress Checks if all the replicas are updated or not. If Status.AvailableReplicas < Status.UpdatedReplicas then all the older replicas are not there but there are less number of availableReplicas

func (*Statefulset) VerifyReplicaStatus

func (d *Statefulset) VerifyReplicaStatus() error

VerifyReplicaStatus verifies whether all the replicas of the statefulset are up and running

type StatefulsetBuilder

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

Builder enables building an instance of statefulset

func NewStatefulsetBuilder

func NewStatefulsetBuilder() *StatefulsetBuilder

NewBuilder returns a new instance of builder meant for statefulset

func (*StatefulsetBuilder) Build

func (b *StatefulsetBuilder) Build() (*appsv1.StatefulSet, error)

Build returns a statefulset instance

func (*StatefulsetBuilder) WithLabels

func (b *StatefulsetBuilder) WithLabels(labels map[string]string) *StatefulsetBuilder

WithLabels sets the label field of statefulset with provided value.

func (*StatefulsetBuilder) WithName

func (b *StatefulsetBuilder) WithName(name string) *StatefulsetBuilder

WithName sets the Name field of statefulset with provided value.

func (*StatefulsetBuilder) WithNamespace

func (b *StatefulsetBuilder) WithNamespace(namespace string) *StatefulsetBuilder

WithNamespace sets the Namespace field of statefulset with provided value.

func (*StatefulsetBuilder) WithNodeSelector

func (b *StatefulsetBuilder) WithNodeSelector(selector map[string]string) *StatefulsetBuilder

WithNodeSelector Sets the node selector with the provided argument.

func (*StatefulsetBuilder) WithPodManagementPolicy

func (b *StatefulsetBuilder) WithPodManagementPolicy(policy appsv1.PodManagementPolicyType) *StatefulsetBuilder

WithPodManagementPolicy sets the spec.podManagementPolicy field of statefulset

func (*StatefulsetBuilder) WithPodTemplateSpecBuilder

func (b *StatefulsetBuilder) WithPodTemplateSpecBuilder(
	tmplbuilder *PodtemplatespecBuilder,
) *StatefulsetBuilder

WithPodTemplateSpecBuilder sets the template field of the statefulset

func (*StatefulsetBuilder) WithReplicas

func (b *StatefulsetBuilder) WithReplicas(replicas *int32) *StatefulsetBuilder

WithReplicas sets the replica field of statefulset

func (*StatefulsetBuilder) WithSelectorMatchLabels

func (b *StatefulsetBuilder) WithSelectorMatchLabels(matchlabels map[string]string) *StatefulsetBuilder

WithSelectorMatchLabels set the selector labels field of statefulset with provided value.

func (*StatefulsetBuilder) WithVolumeClaimTemplate

func (b *StatefulsetBuilder) WithVolumeClaimTemplate(name, storage, storageClassName string, volType common.VolumeType) *StatefulsetBuilder

WithVolumeClaimTemplate sets the volumeClaimTemplate in statefulset to create volume claims according to no of statefulset replicas

type StorageClass

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

type TestEnvironment

type TestEnvironment struct {
	KubeInt kubernetes.Interface
	CsiInt  clientset.Interface
}

type Volume

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

Volume is a wrapper over named volume api object, used within Pods. It provides build, validations and other common logic to be used by various feature specific callers.

type VolumeBuilder

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

Builder is the builder object for Volume

func NewVolumeBuilder

func NewVolumeBuilder() *VolumeBuilder

NewBuilder returns new instance of Builder

func (*VolumeBuilder) Build

func (b *VolumeBuilder) Build() (*corev1.Volume, error)

Build returns the Volume API instance

func (*VolumeBuilder) WithConfigMap

func (b *VolumeBuilder) WithConfigMap(configMap *corev1.ConfigMap, defaultMode int32) *VolumeBuilder

WithConfigMap sets the VolumeSource field of Volume with provided ConfigMap

func (*VolumeBuilder) WithEmptyDir

func (b *VolumeBuilder) WithEmptyDir(dir *corev1.EmptyDirVolumeSource) *VolumeBuilder

WithEmptyDir sets the EmptyDir field of the Volume with provided dir

func (*VolumeBuilder) WithHostDirectory

func (b *VolumeBuilder) WithHostDirectory(path string) *VolumeBuilder

WithHostDirectory sets the VolumeSource field of Volume with provided hostpath as type directory.

func (*VolumeBuilder) WithHostPathAndType

func (b *VolumeBuilder) WithHostPathAndType(
	dirpath string,
	dirtype *corev1.HostPathType,
) *VolumeBuilder

WithHostPathAndType sets the VolumeSource field of Volume with provided hostpath as directory path and type as directory type

func (*VolumeBuilder) WithName

func (b *VolumeBuilder) WithName(name string) *VolumeBuilder

WithName sets the Name field of Volume with provided value.

func (*VolumeBuilder) WithPVCSource

func (b *VolumeBuilder) WithPVCSource(pvcName string) *VolumeBuilder

WithPVCSource sets the Volume field of Volume with provided pvc

func (*VolumeBuilder) WithSecret

func (b *VolumeBuilder) WithSecret(secret *corev1.Secret, defaultMode int32) *VolumeBuilder

WithSecret sets the VolumeSource field of Volume with provided Secret

type YcsbApp

type YcsbApp struct {
	BenchmarkParams BenchmarkParams
	MongoConnUrl    string
	Name            string
	Namespace       string
	NodeSelector    string
	PodName         string
}

func NewYCSB

func NewYCSB() *YcsbApp

func (*YcsbApp) DeployYcsbApp

func (ycsb *YcsbApp) DeployYcsbApp(namePrefix string) (string, string, error)

func (*YcsbApp) LoadYcsbApp

func (ycsb *YcsbApp) LoadYcsbApp() error

func (*YcsbApp) RunYcsbApp

func (ycsb *YcsbApp) RunYcsbApp(result *string) error

func (*YcsbApp) UndeployYcsbApp

func (ycsb *YcsbApp) UndeployYcsbApp() error

type ZfsOptions

type ZfsOptions struct {
	AllowedTopologies []v1.TopologySelectorTerm
	RecordSize        string
	Compression       common.OnOffVal
	DedUp             common.OnOffVal
	PoolName          string
	ThinProvision     common.YesNoVal
	VolBlockSize      string
	Shared            common.YesNoVal
}

Jump to

Keyboard shortcuts

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