failures

package
v2.12.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceFailureReasonUnknown is used when no specific message is specified when creating a ResourceFailure.
	ResourceFailureReasonUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceFailure

type ResourceFailure struct {
	// contains filtered or unexported fields
}

ResourceFailure represents an error encountered when processing one or more Kubernetes resources into Kong configuration.

func NewResourceFailure

func NewResourceFailure(reason string, causingObjects ...client.Object) (ResourceFailure, error)

NewResourceFailure creates a ResourceFailure with a message that should be a human-readable explanation of the error message, and a causingObjects slice that specifies what objects have caused the error.

func (ResourceFailure) CausingObjects

func (p ResourceFailure) CausingObjects() []client.Object

CausingObjects returns a slice of objects involved in a resource processing failure.

func (ResourceFailure) Message

func (p ResourceFailure) Message() string

Message returns a human-readable message describing the cause of the failure.

type ResourceFailuresCollector

type ResourceFailuresCollector struct {
	// contains filtered or unexported fields
}

ResourceFailuresCollector collects resource failures across different stages of resource processing.

func NewResourceFailuresCollector

func NewResourceFailuresCollector(logger logrus.FieldLogger) (*ResourceFailuresCollector, error)

func (*ResourceFailuresCollector) PopResourceFailures

func (c *ResourceFailuresCollector) PopResourceFailures() []ResourceFailure

PopResourceFailures returns all resource processing failures stored in the collector and clears the collector's stored failures. The collector can then be reused for the next iteration of the process it tracks.

func (*ResourceFailuresCollector) PushResourceFailure

func (c *ResourceFailuresCollector) PushResourceFailure(reason string, causingObjects ...client.Object)

PushResourceFailure adds a resource processing failure to the collector and logs it.

Jump to

Keyboard shortcuts

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