podlogs

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package podlogs provides generic pod log fetching utilities.

Index

Constants

View Source
const DefaultMaxLogBytes int64 = 8 * 1024 * 1024

DefaultMaxLogBytes caps a single log fetch at 8 MB. Sized well above a normal sampling window (a chatty trainer emits a few hundred KB per minute) while staying far below the controller's memory limit.

Variables

This section is empty.

Functions

func ScanLines

func ScanLines(reader io.Reader) ([]string, error)

ScanLines reads all lines from a reader using a buffered scanner with a 1 MB buffer.

Callers are responsible for bounding the reader (see LogOptions.LimitBytes); this returns one string per line and so allocates proportionally to input size.

Types

type LogOptions

type LogOptions struct {
	Container string
	SinceTime *metav1.Time

	// LimitBytes caps how many bytes the API server returns for this fetch.
	// Zero means DefaultMaxLogBytes; reads are never unbounded.
	LimitBytes int64
}

LogOptions configures log reading.

type PodLogFetcher

type PodLogFetcher interface {
	FetchLogs(ctx context.Context, namespace, podName string, opts LogOptions) ([]string, error)
}

PodLogFetcher abstracts fetching raw log lines from a pod.

func NewKubernetesLogFetcher

func NewKubernetesLogFetcher(clientset *kubernetes.Clientset) PodLogFetcher

NewKubernetesLogFetcher creates a PodLogFetcher backed by a Kubernetes clientset.

Jump to

Keyboard shortcuts

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