k8s

package
v0.82.0-devel Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package k8s contains utility functions for interacting with Kubernetes clusters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckJobErrors

func CheckJobErrors(ctx context.Context, client kubernetes.Interface, namespace, jobName string) error

CheckJobErrors checks if a job has failed and returns an error with more details about the failure, such as the pod that failed and the error code.

func DescribeJob

func DescribeJob(ctx context.Context, client kubernetes.Interface, namespace, jobName string) string

DescribeJob collects diagnostic information about a Job and its Pods into a human-readable string. It is designed for use in failure messages and never returns an error — each section is best-effort.

func DumpK8sClusterState added in v0.80.0

func DumpK8sClusterState(ctx context.Context, kubeconfig *clientcmdapi.Config, out *strings.Builder) error

func WaitForJobPodRunning

func WaitForJobPodRunning(ctx context.Context, client kubernetes.Interface, namespace, jobName string, timeout time.Duration) (*corev1.Pod, error)

WaitForJobPodRunning polls until a Job's Pod leaves the Pending phase or a terminal error is detected. It returns the Pod on success, or an error describing why the Pod could not start (image pull failure, scheduling issue, crash loop, or timeout). The returned Pod may be in any non-Pending phase (Running, Succeeded, or Failed). This function distinguishes infrastructure failures from runtime outcomes — a Pod that started and exited non-zero is still considered "started" for this purpose.

Types

This section is empty.

Jump to

Keyboard shortcuts

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