errors

package
v0.0.0-...-29ce5d4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 260

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoscalerError

type AutoscalerError interface {
	// Error implements golang error interface
	Error() string

	// Type returns the type of AutoscalerError
	Type() AutoscalerErrorType

	// AddPrefix adds a prefix to error message.
	// Returns the error it's called for convenient inline use.
	// Example:
	// if err := DoSomething(myObject); err != nil {
	//	return err.AddPrefix("can't do something with %v: ", myObject)
	// }
	AddPrefix(msg string, args ...interface{}) AutoscalerError
}

AutoscalerError contains information about Autoscaler errors

func NewAutoscalerError

func NewAutoscalerError(errorType AutoscalerErrorType, msg string, args ...interface{}) AutoscalerError

NewAutoscalerError returns new autoscaler error with a message constructed from format string

func ToAutoscalerError

func ToAutoscalerError(defaultType AutoscalerErrorType, err error) AutoscalerError

ToAutoscalerError converts an error to AutoscalerError with given type, unless it already is an AutoscalerError (in which case it's not modified).

type AutoscalerErrorType

type AutoscalerErrorType string

AutoscalerErrorType describes a high-level category of a given error

const (
	// CloudProviderError is an error related to underlying infrastructure
	CloudProviderError AutoscalerErrorType = "cloudProviderError"
	// ApiCallError is an error related to communication with k8s API server
	ApiCallError AutoscalerErrorType = "apiCallError"
	// InternalError is an error inside Cluster Autoscaler
	InternalError AutoscalerErrorType = "internalError"
	// TransientError is an error that causes us to skip a single loop, but
	// does not require any additional action.
	TransientError AutoscalerErrorType = "transientError"
	// ConfigurationError is an error related to bad configuration provided
	// by a user.
	ConfigurationError AutoscalerErrorType = "configurationError"
	// NodeGroupDoesNotExistError signifies that a NodeGroup
	// does not exist.
	NodeGroupDoesNotExistError AutoscalerErrorType = "nodeGroupDoesNotExistError"
	// UnexpectedScaleDownStateError means Cluster Autoscaler thinks ongoing
	// scale down is already removing too much and so further node removals
	// shouldn't be attempted.
	UnexpectedScaleDownStateError AutoscalerErrorType = "unexpectedScaleDownStateError"
)

Jump to

Keyboard shortcuts

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