logs

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package logs provides a way to parse and get the logs of a pod

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertQueryRecord

func AssertQueryRecord(logEntries []map[string]interface{}, errorTestQuery string, message string, logger string) bool

AssertQueryRecord verifies if any of the message record field of each JSON row contains the expectedResult string, then applies the assertions related to the log format

func CheckOptionsForBarmanCommand

func CheckOptionsForBarmanCommand(
	logEntries []map[string]interface{},
	message, backupName, podName string,
	optionsExpected []string,
) (bool, error)

CheckOptionsForBarmanCommand checks if the expected options are used from the barman command execution log

func CheckRecordForQuery

func CheckRecordForQuery(entry map[string]interface{}, errorTestQuery, user, database, message string) bool

CheckRecordForQuery applies some assertions related to the format of the JSON log fields keys and values

func HasLogger

func HasLogger(logEntries []map[string]interface{}, logger string) bool

HasLogger verifies if a given value exists inside a list of JSON entries

func IsWellFormedLogForLogger

func IsWellFormedLogForLogger(item map[string]interface{}, loggerField string) bool

IsWellFormedLogForLogger verifies if the message record field of the given map contains the expectedResult string. If the message field matches the expectedResult, then the related record is returned. Otherwise return nil.

func ParseJSONLogs

func ParseJSONLogs(
	ctx context.Context,
	kubeInterface kubernetes.Interface,
	namespace string, podName string,
) ([]map[string]interface{}, error)

ParseJSONLogs returns the pod's logs of a given pod name, in the form of a list of JSON entries

Types

This section is empty.

Jump to

Keyboard shortcuts

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