Documentation ¶
Index ¶
Constants ¶
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.