util

package
v0.0.0-...-d0f8fb9 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package util helps to setup Kubernetes resource related operations. All kubernetes resource creation operation goes here. In addition, any common tests related library functions goes here.

Index

Constants

This section is empty.

Variables

View Source
var TargetNamespace = getTargetNamespace()

TargetNamespace represents Kubernetes namespace to run tests

View Source
var TargetServiceAccount = getTargetServiceAccount()

TargetServiceAccount represents Kubernetes service account

Functions

func CheckReadyReplicas

func CheckReadyReplicas(clientset kubernetes.Interface, deploymentName string,
	targetNamespace string, retryCount int) error

CheckReadyReplicas will wait until the resource is fully rolled out with all replicas

func CreateDeployment

func CreateDeployment(clientset kubernetes.Interface, deployment *appsv1.Deployment, targetNamespace string) error

CreateDeployment creates kubernetes deployment

func CreatePod

func CreatePod(clientset kubernetes.Interface, pod *v1.Pod, targetNamespace string) error

CreatePod creates kubernetes pod

func DeleteDeployment

func DeleteDeployment(clientset kubernetes.Interface, deploymentName string, targetNamespace string) error

DeleteDeployment deletes kubernetes deployment

func DeletePod

func DeletePod(clientset kubernetes.Interface, podName string, targetNamespace string) error

DeletePod deletes kubernetes pod

func GetStatusCondition

func GetStatusCondition(clientset kubernetes.Interface, deploymentName string) (*v1beta1.ReplicaSetList, error)

GetStatusCondition waits until status conditions are availabe for a given replica set. If not found after multiple retries, return an error otherwise return the replicasetList instance.

func IsPrivilegedContainerCreated

func IsPrivilegedContainerCreated(rsList *v1beta1.ReplicaSetList,
	statusReason string, statusCondition string) bool

IsPrivilegedContainerCreated gets the replicaset and match status failure condition and status failure reason

func ReplicaSetsByLabel

func ReplicaSetsByLabel(clientset kubernetes.Interface, labelSelectorValue string, targetNamespace string) (*v1beta1.ReplicaSetList, error)

ReplicaSetsByLabel returns rs list by labelSelectorValue and targetNamespace

Types

This section is empty.

Jump to

Keyboard shortcuts

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