Documentation ¶
Index ¶
- func AddData(configMap *corev1.ConfigMap, dataKey, dataValue string) *corev1.ConfigMap
- func AddMetadataLabel(pod *corev1.Pod, labelName, labelContent string) *corev1.Pod
- func AddToPodDefinitionCpuLimits(pod *corev1.Pod, cpuNumber, containerNumber int64) *corev1.Pod
- func AddToPodDefinitionHugePages1Gi(pod *corev1.Pod, amountLimit, amountRequest, containerNumber int64) *corev1.Pod
- func AddToPodDefinitionHugePages2Mi(pod *corev1.Pod, amountLimit, amountRequest, containerNumber int64) *corev1.Pod
- func AddToPodDefinitionMemory(pod *corev1.Pod, amountLimit, amountRequest, containerNumber int64) *corev1.Pod
- func AddToPodDefinitionVolumesWithDownwardAPI(pod *corev1.Pod, mountPath, volumeName string, containerNumber int64) *corev1.Pod
- func ApplyConfigMap(ci coreclient.CoreV1Interface, configMap *corev1.ConfigMap, ...) error
- func ApplyNetworkAttachmentDefinition(ci networkCoreClient.K8sCniCncfIoV1Interface, ...) error
- func CreateNamespace(ci coreclient.CoreV1Interface, name string, timeout time.Duration) error
- func CreateRunningPod(ci coreclient.CoreV1Interface, pod *corev1.Pod, ...) error
- func DeleteConfigMap(ci coreclient.CoreV1Interface, configMap *corev1.ConfigMap, ...) error
- func DeleteNamespace(ci coreclient.CoreV1Interface, name string, timeout time.Duration) error
- func DeleteNetworkAttachmentDefinition(ci networkCoreClient.K8sCniCncfIoV1Interface, testNetworkName string, ...) error
- func DeletePod(ci coreclient.CoreV1Interface, pod *corev1.Pod, timeout time.Duration) error
- func ExecuteCommand(core coreclient.CoreV1Interface, config *restclient.Config, ...) (string, string, error)
- func GetConfigMap(confgiMapName, namespace string) *corev1.ConfigMap
- func GetMultiNetworks(nad []string, ns string, podName string) *corev1.Pod
- func GetNetworkAttachmentDefinition(networkName string, ns string) *cniv1.NetworkAttachmentDefinition
- func GetNetworkSpecConfig(networkName string) string
- func GetNodeSelectorOnly(ns string, networkName string, nodeName string) *cniv1.NetworkAttachmentDefinition
- func GetOneNetwork(nad, ns string, podName string) *corev1.Pod
- func GetOneNetworkTwoContainers(nad, ns, podName, secondContainerName string) *corev1.Pod
- func GetPodDefinition(ns string, podName string) *corev1.Pod
- func GetPodTestImage() string
- func GetResourceAndNodeSelector(ns string, networkName string, nodeName string) *cniv1.NetworkAttachmentDefinition
- func GetResourceSelectorOnly(ns string, networkName string, resourceName string) *cniv1.NetworkAttachmentDefinition
- func GetWithoutAnnotations(ns string, networkName string) *cniv1.NetworkAttachmentDefinition
- func IsMinHugepagesAvailable(ci coreclient.CoreV1Interface, minGi, minMi int) (bool, error)
- func UpdatePodInfo(ci coreclient.CoreV1Interface, pod *corev1.Pod, timeout time.Duration) (*corev1.Pod, error)
- func WaitForNamespaceDelete(core coreclient.CoreV1Interface, namespaceName string, ...) error
- func WaitForPodStateRunning(core coreclient.CoreV1Interface, podName, ns string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMetadataLabel ¶
AddMetadataLabel adds label to the POD metadata section :param labelName - key in map, label name :param labelContent - value, label content
func AddToPodDefinitionCpuLimits ¶
AddToPodDefinitionCpuLimits adds CPU limits and requests to the definition of POD
func AddToPodDefinitionHugePages1Gi ¶
func AddToPodDefinitionHugePages1Gi(pod *corev1.Pod, amountLimit, amountRequest, containerNumber int64) *corev1.Pod
AddToPodDefinitionHugePages1Gi adds Hugepages 1Gi limits and requirements to the POD spec
func AddToPodDefinitionHugePages2Mi ¶
func AddToPodDefinitionHugePages2Mi(pod *corev1.Pod, amountLimit, amountRequest, containerNumber int64) *corev1.Pod
AddToPodDefinitionHugePages2Mi adds Hugepages 2Mi limits and requirements to the POD spec
func AddToPodDefinitionMemory ¶
func AddToPodDefinitionMemory(pod *corev1.Pod, amountLimit, amountRequest, containerNumber int64) *corev1.Pod
AddToPodDefinitionMemory adds Memory constraints to the POD spec
func AddToPodDefinitionVolumesWithDownwardAPI ¶
func AddToPodDefinitionVolumesWithDownwardAPI(pod *corev1.Pod, mountPath, volumeName string, containerNumber int64) *corev1.Pod
AddToPodDefinitionVolumesWithDownwardAPI adds to the POD specification at the 'path' downwardAPI volumes that expose POD namespace :param pod - POD object to be modified :param mountPath - path of the folder in which file is going to be available :param volumeName - name of the volume :param containerNumber - number of the container to which volumes have to be added :return updated POD object
func ApplyConfigMap ¶
func ApplyConfigMap(ci coreclient.CoreV1Interface, configMap *corev1.ConfigMap, timeout time.Duration) error
func ApplyNetworkAttachmentDefinition ¶
func ApplyNetworkAttachmentDefinition(ci networkCoreClient.K8sCniCncfIoV1Interface, nad *cniv1.NetworkAttachmentDefinition, timeout time.Duration) error
func CreateNamespace ¶
func CreateNamespace(ci coreclient.CoreV1Interface, name string, timeout time.Duration) error
func CreateRunningPod ¶
func CreateRunningPod(ci coreclient.CoreV1Interface, pod *corev1.Pod, timeout, interval time.Duration) error
CreateRunningPod create a pod and wait until it is running
func DeleteConfigMap ¶
func DeleteConfigMap(ci coreclient.CoreV1Interface, configMap *corev1.ConfigMap, timeout time.Duration) error
func DeleteNamespace ¶
func DeleteNamespace(ci coreclient.CoreV1Interface, name string, timeout time.Duration) error
func DeleteNetworkAttachmentDefinition ¶
func DeleteNetworkAttachmentDefinition(ci networkCoreClient.K8sCniCncfIoV1Interface, testNetworkName string, nad *cniv1.NetworkAttachmentDefinition, timeout time.Duration) error
func DeletePod ¶
func DeletePod(ci coreclient.CoreV1Interface, pod *corev1.Pod, timeout time.Duration) error
DeletePod will delete a pod
func ExecuteCommand ¶
func ExecuteCommand(core coreclient.CoreV1Interface, config *restclient.Config, podName, ns, containerName, command string) (string, string, error)
ExecuteCommand execute command on the POD :param core - core V1 Interface :param config - configuration used to establish REST connection with K8s node :param podName - POD name on which command has to be executed :param ns - namespace in which POD exists :param containerName - container name on which command should be executed :param command - command to be executed on POD :return string output of the command (stdout)
string output of the command (stderr) error Error object or when everthing is correct nil
func GetConfigMap ¶
func GetMultiNetworks ¶
GetMultiNetworks adds a network to annotation
func GetNetworkAttachmentDefinition ¶
func GetNetworkAttachmentDefinition(networkName string, ns string) *cniv1.NetworkAttachmentDefinition
func GetNetworkSpecConfig ¶
{ "cniVersion": "0.3.0", "name": networkName, "type": "loopback", },
func GetNodeSelectorOnly ¶
func GetNodeSelectorOnly(ns string, networkName string, nodeName string) *cniv1.NetworkAttachmentDefinition
func GetOneNetwork ¶
GetOneNetwork add one network to pod
func GetOneNetworkTwoContainers ¶
GetOneNetworkTwoContainers returns POD with two containers and one network
func GetPodDefinition ¶
GetPodDefinition will return a test pod
func GetPodTestImage ¶
func GetPodTestImage() string
GetPodTestImage returns image to be used during testing
func GetResourceAndNodeSelector ¶
func GetResourceAndNodeSelector(ns string, networkName string, nodeName string) *cniv1.NetworkAttachmentDefinition
func GetResourceSelectorOnly ¶
func GetResourceSelectorOnly(ns string, networkName string, resourceName string) *cniv1.NetworkAttachmentDefinition
func GetWithoutAnnotations ¶
func GetWithoutAnnotations(ns string, networkName string) *cniv1.NetworkAttachmentDefinition
func IsMinHugepagesAvailable ¶
func IsMinHugepagesAvailable(ci coreclient.CoreV1Interface, minGi, minMi int) (bool, error)
IsMinHugepagesAvailable checks if a min Gi/Mi hugepage number is available on any nodes
func UpdatePodInfo ¶
func UpdatePodInfo(ci coreclient.CoreV1Interface, pod *corev1.Pod, timeout time.Duration) (*corev1.Pod, error)
UpdatePodInfo will get the current pod state and return it
func WaitForNamespaceDelete ¶
func WaitForNamespaceDelete(core coreclient.CoreV1Interface, namespaceName string, timeout, interval time.Duration) error
func WaitForPodStateRunning ¶
func WaitForPodStateRunning(core coreclient.CoreV1Interface, podName, ns string, timeout, interval time.Duration) error
WaitForPodStateRunning waits for pod to enter running state
Types ¶
This section is empty.