vzlog

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: UPL-1.0 Imports: 2 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceConfig

type ResourceConfig struct {
	// Name is the name of the resource
	Name string

	// Namespace is the namespace of the resource
	Namespace string

	// ID is the resource uid
	ID string

	// Generation is the resource generation
	Generation int64

	// Controller name is the name of the controller
	ControllerName string
}

ResourceConfig is the configuration of a logger for a resource that is being reconciled

type VerrazzanoLogger

type VerrazzanoLogger modulelog.VerrazzanoLogger

VerrazzanoLogger is a logger interface that provides sugared and progress logging

func DefaultLogger

func DefaultLogger() VerrazzanoLogger

DefaultLogger ensures the default logger exists. This is typically used for testing

func EnsureResourceLogger

func EnsureResourceLogger(config *ResourceConfig) (VerrazzanoLogger, error)

EnsureResourceLogger ensures that a logger exists for a specific generation of a Kubernetes resource. When a resource is getting reconciled, the status may frequently get updated during the reconciliation. This is the case for the Verrazzano resource. As a result, the controller-runtime queue gets filled with updated instances of a resource that have the same generation. The side-effect is that after a resource is completely reconciled, the controller Reconcile method may still be called many times. In this case, the existing context must be used so that 'once' and 'progress' messages don't start from a new context, causing them to be displayed when they shouldn't. This mehod ensures that the same logger is used for a given resource and generation.

func ForZapLogger added in v1.5.0

func ForZapLogger(config *ResourceConfig, zaplog *zap.SugaredLogger) VerrazzanoLogger

Jump to

Keyboard shortcuts

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