logs

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package logs provides utilities for retrieving and parsing pod logs in e2e tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindArchiveBatchCompletions

func FindArchiveBatchCompletions(logEntries []map[string]any) []map[string]any

FindArchiveBatchCompletions finds "WAL archive batch completed" log entries and returns the parsed data. Each returned map contains the structured log fields.

func FindArchiveBatches

func FindArchiveBatches(logEntries []map[string]any) []map[string]any

FindArchiveBatches finds "WAL archive batch prepared" log entries and returns the parsed data. Each returned map contains the structured log fields.

func FindLogEntriesByMessage added in v0.7.0

func FindLogEntriesByMessage(logEntries []map[string]any, message string) []map[string]any

FindLogEntriesByMessage returns the log entries whose "msg" field equals the given message.

func FindPgbackrestCommandOptions added in v0.8.0

func FindPgbackrestCommandOptions(logEntries []map[string]any) []string

FindPgbackrestCommandOptions scans the structured log entries for pgbackrest command invocations (which the plugin logs together with an "options" field) and returns each invocation's options joined into a single space-separated string. This makes it easy to assert on the exact flags the plugin passed to pgbackrest.

func GetPodContainerLogs

func GetPodContainerLogs(
	ctx context.Context,
	clientSet *kubernetes.Clientset,
	namespace, podName, containerName string,
	sinceSeconds *int64,
) ([]map[string]any, error)

GetPodContainerLogs retrieves logs from a specific container in a pod and parses them as JSON. All logs are expected to be valid structured JSON. Returns an error if any line is not valid JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

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