apiwarnings

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package apiwarnings defines warning handlers used with API clients.

Index

Constants

This section is empty.

Variables

View Source
var DiscardAllHandler = rest.NoWarnings{}

DiscardAllHandler is a handler that discards all warnings.

Functions

func DomainQualifiedFinalizerWarning

func DomainQualifiedFinalizerWarning(domain string) regexp.Regexp

DomainQualifiedFinalizerWarning is a regular expression that matches a warning that the API server returns when a finalizer is not domain-qualified.

func LogAllHandler

func LogAllHandler(l logr.Logger) rest.WarningHandler

LogAllHandler is a handler that logs all warnings.

Types

type DiscardMatchingHandler

type DiscardMatchingHandler struct {
	// Logger is used to log responses with the warning header.
	Logger logr.Logger

	// Expressions is a slice of regular expressions used to discard warnings.
	// If the warning message matches any expression, it is not logged.
	Expressions []regexp.Regexp
}

DiscardMatchingHandler is a handler that discards API server warnings whose message matches any user-defined regular expressions, but otherwise logs warnings to the user-defined logger.

func DefaultHandler

func DefaultHandler(l logr.Logger) *DiscardMatchingHandler

DefaultHandler is a handler that discards warnings that are the result of decisions made by the Cluster API project, but cannot be immediately addressed, and are therefore not helpful to the user.

func (*DiscardMatchingHandler) HandleWarningHeader

func (h *DiscardMatchingHandler) HandleWarningHeader(code int, _, message string)

HandleWarningHeader handles logging for responses from API server that are warnings with code being 299 and uses a logr.Logger for its logging purposes.

Jump to

Keyboard shortcuts

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