Documentation ¶
Overview ¶
Package apiwarnings defines warning handlers used with API clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DiscardAllHandler = rest.NoWarnings{}
DiscardAllHandler is a handler that discards all warnings.
Functions ¶
func DomainQualifiedFinalizerWarning ¶
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.