Documentation ¶
Index ¶
- Constants
- func GetLabels() map[string]string
- func GetPodLabels(podName string, taskName string) map[string]string
- func NewClient(inClusterConfig bool, kubeconfig string) (kubernetes.Interface, error)
- func NodeIsTolerable(node corev1.Node, tolerations []corev1.Toleration) bool
- func PodDelete(k8sclient kubernetes.Interface, pod *corev1.Pod, timeout int) error
- func PodDeleteByLabels(k8sclient kubernetes.Interface, namespace string, ...) error
- func PodDeleteByName(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) error
- func PodRecreate(k8sclient kubernetes.Interface, pod *corev1.Pod, delTimeout int) error
- func PortsListToPorts(list testers.Ports) []corev1.ContainerPort
- func WaitForPodToRun(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) (bool, error)
- func WaitForPodToRunOrSucceed(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) (bool, error)
- func WaitForPodToSucceed(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) (bool, error)
Constants ¶
const (
// TaskIDLabel label for the task-id
TaskIDLabel = "ancientt/task-id"
)
Variables ¶
This section is empty.
Functions ¶
func GetLabels ¶
GetLabels return a default set of labels for "any" object ancientt is going to create.
func GetPodLabels ¶
GetPodLabels default labels combined with additional labels for Pods.
func NewClient ¶
func NewClient(inClusterConfig bool, kubeconfig string) (kubernetes.Interface, error)
NewClient create a new Kubernetes clientset
func NodeIsTolerable ¶
func NodeIsTolerable(node corev1.Node, tolerations []corev1.Toleration) bool
NodeIsTolerable returns true if the node's taints are all tolerated by the given tolerations. There is the option to ignore well known taints defined in WellKnownTaints. See WellKnownTaints for more information.
func PodDelete ¶
PodDelete delete Pod if it exists, wait for it till it has been for custom amount deleted
func PodDeleteByLabels ¶
func PodDeleteByLabels(k8sclient kubernetes.Interface, namespace string, selectorLabels map[string]string) error
PodDeleteByLabels delete Pods by labels
func PodDeleteByName ¶
func PodDeleteByName(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) error
PodDeleteByName delete Pod by namespace and name if it exists
func PodRecreate ¶
PodRecreate delete Pod if it exists and create it again. If the Pod does not exist, create it.
func PortsListToPorts ¶
func PortsListToPorts(list testers.Ports) []corev1.ContainerPort
PortsListToPorts PortList testers.Port to Kubernetes []corev1.ContainerPort conversion (for TCP and UDP)
func WaitForPodToRun ¶
func WaitForPodToRun(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) (bool, error)
WaitForPodToRun wait for a Pod to be in phase Running. In case of phase Running, return true and no error
func WaitForPodToRunOrSucceed ¶
func WaitForPodToRunOrSucceed(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) (bool, error)
WaitForPodToRunOrSucceed wait for a Pod to be in phase Running or Succeeded. In case of one of the phases, return true and no error
func WaitForPodToSucceed ¶
func WaitForPodToSucceed(k8sclient kubernetes.Interface, namespace string, podName string, timeout int) (bool, error)
WaitForPodToSucceed wait for a Pod to be in phase Succeeded. In case of phase Succeeded, return true and no error
Types ¶
This section is empty.