k8s

package
v0.0.0-...-7a28dcf Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJobContextFromKubernetesAnnotations

func CreateJobContextFromKubernetesAnnotations(meta metav1.ObjectMeta) (contract.JobContext, error)

CreateJobContextFromKubernetesAnnotations translates any Kubernetes object into contract.JobContext

func FindAndReadLogsFromLastPod

func FindAndReadLogsFromLastPod(ctx context.Context, lister v1.PodInterface, selector string) string

FindAndReadLogsFromLastPod is listing logs from the last Pod found for given selector. Errors are returned as logs 1. Find all Pods for given Job 2. Sort by metadata.creationTimestamp, desc 3. Pick first and retrieve logs

func HasUsableAnnotations

func HasUsableAnnotations(meta metav1.ObjectMeta) (bool, error)

HasUsableAnnotations is checking if Kubernetes object is usable at all

func ReadRequestStream

func ReadRequestStream(ctx context.Context, req *rest.Request) string

ReadRequestStream is a helper you can use to read logs from the Pod. Errors are returned as logs

func TruncateLogs

func TruncateLogs(logs string, data config.Data) string

TruncateLogs is truncating logs with a maximum lines number, maximum line length

Types

This section is empty.

Jump to

Keyboard shortcuts

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