errors

package
v0.4.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

An unrecoverable error represents an issue that is not expected to ever succeed by retrying the actions that caused it without being corrected by the user, such as trying to create a malformed or inherently invalid object. The actions that cause these errors are NOT expected to be retried, and should be permanently dropped from any worker queues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsApplicationAnnotationNotFoundError

func IsApplicationAnnotationNotFoundError(err error) bool

func IsClusterClientStoreError added in v0.4.0

func IsClusterClientStoreError(err error) bool

func IsClusterNotInStoreError added in v0.4.0

func IsClusterNotInStoreError(err error) bool

func IsClusterNotReadyError added in v0.4.0

func IsClusterNotReadyError(err error) bool

func IsContenderNotFoundError

func IsContenderNotFoundError(err error) bool

func IsConvertUnstructuredError added in v0.4.0

func IsConvertUnstructuredError(err error) bool

func IsDecodeManifestError added in v0.4.0

func IsDecodeManifestError(err error) bool

func IsIncompleteReleaseError added in v0.4.0

func IsIncompleteReleaseError(err error) bool

func IsIncumbentNotFoundError

func IsIncumbentNotFoundError(err error) bool

func IsInvalidChartError added in v0.4.0

func IsInvalidChartError(err error) bool

func IsInvalidGenerationAnnotationError

func IsInvalidGenerationAnnotationError(err error) bool

func IsKubeclientError added in v0.4.0

func IsKubeclientError(err error) bool

func IsMissingGenerationAnnotationError

func IsMissingGenerationAnnotationError(err error) bool

func IsMultipleOwnerReferencesError added in v0.4.0

func IsMultipleOwnerReferencesError(err error) bool

func IsWrongOwnerReferenceError added in v0.4.0

func IsWrongOwnerReferenceError(err error) bool

func NewApplicationAnnotationError

func NewApplicationAnnotationError(appName, annotationName string, err error) error

func NewClusterClientBuild added in v0.4.0

func NewClusterClientBuild(clusterName string, err error) error

func NewClusterNotInStoreError added in v0.4.0

func NewClusterNotInStoreError(clusterName string) error

func NewClusterNotReadyError added in v0.4.0

func NewClusterNotReadyError(clusterName string) error

func NewContenderNotFoundError

func NewContenderNotFoundError(appName string) error

func NewIncumbentNotFoundError

func NewIncumbentNotFoundError(appName string) error

func NewInvalidGenerationAnnotationError

func NewInvalidGenerationAnnotationError(relName string, err error) error

func NewKubeclientDiscoverError added in v0.4.0

func NewKubeclientDiscoverError(gv schema.GroupVersion, err error) error

func NewKubeclientListError added in v0.4.0

func NewKubeclientListError(gvk schema.GroupVersionKind, ns string, selector labels.Selector, err error) error

func NewMissingGenerationAnnotationError

func NewMissingGenerationAnnotationError(relName string) error

func NewNotEnoughCapableClustersInRegionError added in v0.4.0

func NewNotEnoughCapableClustersInRegionError(region string, capabilities []string, required, available int) error

func ShouldBroadcast added in v0.4.0

func ShouldBroadcast(err error) bool

ShouldBroadcast determines if err should be broadcasted through Kubernetes events. It trusts err.ShouldBroadcast if err implements BroadcastAware, but otherwise assumes that all errors should be broadcasted, under the assumption that most errors are interesting enough to be broadcasted, and we'll actively suppress the few that we don't want to expose.

func ShouldRetry added in v0.4.0

func ShouldRetry(err error) bool

ShouldRetry determines if err should be retried. It trusts err.ShouldRetry if err implements RetryAware, but otherwise assumes that all errors should be retried, in order not to stop retries for errors that haven't been classified yet.

Types

type ApplicationAnnotationError

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

func (*ApplicationAnnotationError) Error

type BroadcastAware added in v0.4.0

type BroadcastAware interface {
	ShouldBroadcast() bool
}

BroadcastAware is an error that knows if the action that caused it should be broadcasted to the outside world through Kubernetes events.

type BrokenChartError added in v0.4.0

type BrokenChartError struct {
	ChartError
	// contains filtered or unexported fields
}

func NewBrokenChartError added in v0.4.0

func NewBrokenChartError(chartName, chartVersion, chartRepo string, err error) BrokenChartError

func (BrokenChartError) Error added in v0.4.0

func (e BrokenChartError) Error() string

func (BrokenChartError) ShouldRetry added in v0.4.0

func (e BrokenChartError) ShouldRetry() bool

type ChartError added in v0.4.0

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

type ChartFetchFailureError added in v0.4.0

type ChartFetchFailureError struct {
	ChartError
	// contains filtered or unexported fields
}

func NewChartFetchFailureError added in v0.4.0

func NewChartFetchFailureError(chartName, chartVersion, chartRepo string, err error) ChartFetchFailureError

func (ChartFetchFailureError) Error added in v0.4.0

func (e ChartFetchFailureError) Error() string

func (ChartFetchFailureError) ShouldRetry added in v0.4.0

func (e ChartFetchFailureError) ShouldRetry() bool

type ClusterClientBuildError added in v0.4.0

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

func (ClusterClientBuildError) Error added in v0.4.0

func (e ClusterClientBuildError) Error() string

func (ClusterClientBuildError) ShouldRetry added in v0.4.0

func (e ClusterClientBuildError) ShouldRetry() bool

type ClusterNotInStoreError added in v0.4.0

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

func (ClusterNotInStoreError) Error added in v0.4.0

func (e ClusterNotInStoreError) Error() string

func (ClusterNotInStoreError) ShouldRetry added in v0.4.0

func (e ClusterNotInStoreError) ShouldRetry() bool

type ClusterNotReadyError added in v0.4.0

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

func (ClusterNotReadyError) Error added in v0.4.0

func (e ClusterNotReadyError) Error() string

func (ClusterNotReadyError) ShouldBroadcast added in v0.4.0

func (e ClusterNotReadyError) ShouldBroadcast() bool

func (ClusterNotReadyError) ShouldRetry added in v0.4.0

func (e ClusterNotReadyError) ShouldRetry() bool

type ContenderNotFoundError

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

func (ContenderNotFoundError) Error

func (e ContenderNotFoundError) Error() string

func (ContenderNotFoundError) ShouldRetry added in v0.4.0

func (e ContenderNotFoundError) ShouldRetry() bool

type ConvertUnstructuredError added in v0.4.0

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

func NewConvertUnstructuredError added in v0.4.0

func NewConvertUnstructuredError(format string, args ...interface{}) ConvertUnstructuredError

func (ConvertUnstructuredError) Error added in v0.4.0

func (e ConvertUnstructuredError) Error() string

func (ConvertUnstructuredError) ShouldRetry added in v0.4.0

func (e ConvertUnstructuredError) ShouldRetry() bool

type DecodeManifestError added in v0.4.0

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

func NewDecodeManifestError added in v0.4.0

func NewDecodeManifestError(format string, args ...interface{}) DecodeManifestError

func (DecodeManifestError) Error added in v0.4.0

func (e DecodeManifestError) Error() string

func (DecodeManifestError) ShouldRetry added in v0.4.0

func (e DecodeManifestError) ShouldRetry() bool

type DuplicateCapabilityRequirementError added in v0.4.0

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

func NewDuplicateCapabilityRequirementError added in v0.4.0

func NewDuplicateCapabilityRequirementError(capability string) DuplicateCapabilityRequirementError

func (DuplicateCapabilityRequirementError) Error added in v0.4.0

func (DuplicateCapabilityRequirementError) ShouldRetry added in v0.4.0

func (e DuplicateCapabilityRequirementError) ShouldRetry() bool

type IncompleteReleaseError added in v0.4.0

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

func NewIncompleteReleaseError added in v0.4.0

func NewIncompleteReleaseError(format string, args ...interface{}) IncompleteReleaseError

func (IncompleteReleaseError) Error added in v0.4.0

func (e IncompleteReleaseError) Error() string

func (IncompleteReleaseError) ShouldRetry added in v0.4.0

func (e IncompleteReleaseError) ShouldRetry() bool

type IncumbentNotFoundError

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

func (IncumbentNotFoundError) Error

func (e IncumbentNotFoundError) Error() string

func (IncumbentNotFoundError) ShouldRetry added in v0.4.0

func (e IncumbentNotFoundError) ShouldRetry() bool

type InvalidCapacityTargetError added in v0.4.0

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

func NewInvalidCapacityTargetError added in v0.4.0

func NewInvalidCapacityTargetError(releaseName string, count int) InvalidCapacityTargetError

func (InvalidCapacityTargetError) Error added in v0.4.0

func (InvalidCapacityTargetError) ShouldRetry added in v0.4.0

func (e InvalidCapacityTargetError) ShouldRetry() bool

type InvalidChartError added in v0.4.0

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

func NewInvalidChartError added in v0.4.0

func NewInvalidChartError(m string) InvalidChartError

func (InvalidChartError) Error added in v0.4.0

func (e InvalidChartError) Error() string

func (InvalidChartError) ShouldRetry added in v0.4.0

func (e InvalidChartError) ShouldRetry() bool

type InvalidGenerationAnnotationError

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

func (*InvalidGenerationAnnotationError) Error

func (*InvalidGenerationAnnotationError) ShouldRetry added in v0.4.0

func (e *InvalidGenerationAnnotationError) ShouldRetry() bool

type KubeclientDiscoverError added in v0.4.0

type KubeclientDiscoverError struct {
	// embed KubeclientError so we don't need a copy of ShouldRetry/ShouldBroadcast
	KubeclientError
	// contains filtered or unexported fields
}

KubeclientDiscoverError is a more specialized version of KubeclientError that includes the schema.GroupVersion used in a .Discover() call.

func (KubeclientDiscoverError) Error added in v0.4.0

func (e KubeclientDiscoverError) Error() string

type KubeclientError added in v0.4.0

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

KubeclientError is a RetryAware and BroadcastAware wrapper around kerrors.APIStatus errors returned by the Kubernetes client.

func NewKubeclientCreateError added in v0.4.0

func NewKubeclientCreateError(obj kubeobj, err error) KubeclientError

func NewKubeclientDeleteError added in v0.4.0

func NewKubeclientDeleteError(ns, name string, err error) KubeclientError

func NewKubeclientError added in v0.4.0

func NewKubeclientError(verb KubeclientVerb, ns, name string, err error) KubeclientError

func NewKubeclientErrorFromObject added in v0.4.0

func NewKubeclientErrorFromObject(verb KubeclientVerb, obj kubeobj, err error) KubeclientError

func NewKubeclientGetError added in v0.4.0

func NewKubeclientGetError(ns, name string, err error) KubeclientError

func NewKubeclientPatchError added in v0.4.0

func NewKubeclientPatchError(ns, name string, err error) KubeclientError

func NewKubeclientUpdateError added in v0.4.0

func NewKubeclientUpdateError(obj kubeobj, err error) KubeclientError

func (KubeclientError) Error added in v0.4.0

func (e KubeclientError) Error() string

func (KubeclientError) ShouldBroadcast added in v0.4.0

func (e KubeclientError) ShouldBroadcast() bool

ShouldBroadcast implements the BroadcastAware interface.

func (KubeclientError) ShouldRetry added in v0.4.0

func (e KubeclientError) ShouldRetry() bool

ShouldRetry implements the RetryAware interface, and determines if the error should be retried based on its reason. It follows the API conventions stipulated by https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#http-status-codes

func (KubeclientError) WithCoreV1Kind added in v0.4.0

func (e KubeclientError) WithCoreV1Kind(kind string) KubeclientError

WithCoreV1Kind returns a new KubeclientError associated with a Kubernetes Core v1 GVK.

func (KubeclientError) WithKind added in v0.4.0

WithKind returns a new KubeclientError associated with a gvk.GroupVersionKind. All KubeclientErrors are expected to have this property set, so error messages can be generated with enough information.

func (KubeclientError) WithShipperKind added in v0.4.0

func (e KubeclientError) WithShipperKind(kind string) KubeclientError

WithShipperKind returns a new KubeclientError associated with a Shipper GVK.

type KubeclientListError added in v0.4.0

type KubeclientListError struct {
	// embed KubeclientError so we don't need a copy of ShouldRetry/ShouldBroadcast
	KubeclientError
	// contains filtered or unexported fields
}

KubeclientListError is a more specialized version of KubeclientError that includes the selector used in a .List() call.

func (KubeclientListError) Error added in v0.4.0

func (e KubeclientListError) Error() string

type KubeclientVerb added in v0.4.0

type KubeclientVerb string
const (
	KubeclientVerbCreate   KubeclientVerb = "CREATE"
	KubeclientVerbGet      KubeclientVerb = "GET"
	KubeclientVerbUpdate   KubeclientVerb = "UPDATE"
	KubeclientVerbDelete   KubeclientVerb = "DELETE"
	KubeclientVerbPatch    KubeclientVerb = "PATCH"
	KubeclientVerbList     KubeclientVerb = "LIST"
	KubeclientVerbDiscover KubeclientVerb = "DISCOVER"
)

type MissingGenerationAnnotationError

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

func (MissingGenerationAnnotationError) Error

func (MissingGenerationAnnotationError) ShouldRetry added in v0.4.0

func (e MissingGenerationAnnotationError) ShouldRetry() bool

type MissingShipperLabelError added in v0.4.0

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

TODO(jgreff): this can be reused to replace NewIncompleteReleaseError

func NewMissingShipperLabelError added in v0.4.0

func NewMissingShipperLabelError(tt *shipper.TrafficTarget, label string) MissingShipperLabelError

func (MissingShipperLabelError) Error added in v0.4.0

func (e MissingShipperLabelError) Error() string

func (MissingShipperLabelError) ShouldRetry added in v0.4.0

func (e MissingShipperLabelError) ShouldRetry() bool

type MissingTargetClusterSelectorError added in v0.4.0

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

func NewTargetClusterServiceMissesSelectorError added in v0.4.0

func NewTargetClusterServiceMissesSelectorError(clusterName, ns, serviceName string) MissingTargetClusterSelectorError

func (MissingTargetClusterSelectorError) Error added in v0.4.0

func (MissingTargetClusterSelectorError) ShouldRetry added in v0.4.0

func (e MissingTargetClusterSelectorError) ShouldRetry() bool

type MissingTrafficWeightsForClusterError added in v0.4.0

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

func NewMissingTrafficWeightsForClusterError added in v0.4.0

func NewMissingTrafficWeightsForClusterError(ns, appName, clusterName string) MissingTrafficWeightsForClusterError

func (MissingTrafficWeightsForClusterError) Error added in v0.4.0

func (MissingTrafficWeightsForClusterError) ShouldRetry added in v0.4.0

type MultiError added in v0.4.0

type MultiError struct {
	Errors []error
}

MultiError is an collection of errors that implements both RetryAware and BroadcastAware.

func NewMultiError added in v0.4.0

func NewMultiError() *MultiError

func (*MultiError) Any added in v0.4.0

func (e *MultiError) Any() bool

Any returns true if there are any errors in the collection.

func (*MultiError) Append added in v0.4.0

func (e *MultiError) Append(err error)

Append appends an error to the collection.

func (*MultiError) Error added in v0.4.0

func (e *MultiError) Error() string

Error implements the error interface. It concatenates the messages for all the errors in the collection.

func (*MultiError) Flatten added in v0.4.0

func (e *MultiError) Flatten() error

Flatten unboxes a MultiError into a single error if there's only one in the collection, nil if there are none, or itself otherwise.

func (*MultiError) ShouldBroadcast added in v0.4.0

func (e *MultiError) ShouldBroadcast() bool

ShouldBroadcast returns true when at least one error in the collection should be broadcasted, and false otherwise.

func (*MultiError) ShouldRetry added in v0.4.0

func (e *MultiError) ShouldRetry() bool

ShouldRetry returns true when at least one error in the collection should be retried, and false otherwise.

type MultipleOwnerReferencesError added in v0.4.0

type MultipleOwnerReferencesError string

func NewMultipleOwnerReferencesError added in v0.4.0

func NewMultipleOwnerReferencesError(name string, references int) MultipleOwnerReferencesError

func (MultipleOwnerReferencesError) Error added in v0.4.0

func (MultipleOwnerReferencesError) ShouldRetry added in v0.4.0

func (e MultipleOwnerReferencesError) ShouldRetry() bool

type MultipleTrafficTargetsForReleaseError added in v0.4.0

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

func NewMultipleTrafficTargetsForReleaseError added in v0.4.0

func NewMultipleTrafficTargetsForReleaseError(ns, releaseName string, ttNames []string) MultipleTrafficTargetsForReleaseError

func (MultipleTrafficTargetsForReleaseError) Error added in v0.4.0

func (MultipleTrafficTargetsForReleaseError) ShouldRetry added in v0.4.0

type NoRegionsSpecifiedError added in v0.4.0

type NoRegionsSpecifiedError struct{}

func NewNoRegionsSpecifiedError added in v0.4.0

func NewNoRegionsSpecifiedError() NoRegionsSpecifiedError

func (NoRegionsSpecifiedError) Error added in v0.4.0

func (e NoRegionsSpecifiedError) Error() string

func (NoRegionsSpecifiedError) ShouldRetry added in v0.4.0

func (e NoRegionsSpecifiedError) ShouldRetry() bool

type NotEnoughCapableClustersInRegionError added in v0.4.0

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

func (NotEnoughCapableClustersInRegionError) Error added in v0.4.0

func (NotEnoughCapableClustersInRegionError) ShouldRetry added in v0.4.0

type NotEnoughClustersInRegionError added in v0.4.0

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

func NewNotEnoughClustersInRegionError added in v0.4.0

func NewNotEnoughClustersInRegionError(region string, required, available int) NotEnoughClustersInRegionError

func (NotEnoughClustersInRegionError) Error added in v0.4.0

func (NotEnoughClustersInRegionError) ShouldRetry added in v0.4.0

func (e NotEnoughClustersInRegionError) ShouldRetry() bool

type NotWorkingOnStrategyError added in v0.4.0

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

func NewNotWorkingOnStrategyError added in v0.4.0

func NewNotWorkingOnStrategyError(contenderReleaseKey string) NotWorkingOnStrategyError

func (NotWorkingOnStrategyError) Error added in v0.4.0

func (NotWorkingOnStrategyError) ShouldRetry added in v0.4.0

func (e NotWorkingOnStrategyError) ShouldRetry() bool

type RecoverableError added in v0.4.0

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

RecoverableError is a generic error that will cause an action to be retried. It mostly behaves like any other error that doesn't implement the RetryAware interface, but by using it we signal that this is an error that we're consciously willing to retry, so it is preferred over bare generic errors.

func NewRecoverableError added in v0.4.0

func NewRecoverableError(err error) RecoverableError

func (RecoverableError) Error added in v0.4.0

func (e RecoverableError) Error() string

func (RecoverableError) ShouldBroadcast added in v0.4.0

func (e RecoverableError) ShouldBroadcast() bool

func (RecoverableError) ShouldRetry added in v0.4.0

func (e RecoverableError) ShouldRetry() bool

type RenderManifestError added in v0.4.0

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

func NewRenderManifestError added in v0.4.0

func NewRenderManifestError(err error) RenderManifestError

func (RenderManifestError) Error added in v0.4.0

func (e RenderManifestError) Error() string

func (RenderManifestError) ShouldRetry added in v0.4.0

func (e RenderManifestError) ShouldRetry() bool

type RetryAware added in v0.4.0

type RetryAware interface {
	ShouldRetry() bool
}

RetryAware is an error that knows if the action that caused it should be retried.

type TargetClusterMathError added in v0.4.0

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

func NewTargetClusterMathError added in v0.4.0

func NewTargetClusterMathError(releaseName string, idlePodCount, missingCount int) TargetClusterMathError

func (TargetClusterMathError) Error added in v0.4.0

func (e TargetClusterMathError) Error() string

type TargetClusterServiceError added in v0.4.0

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

func NewTargetClusterWrongServiceCountError added in v0.4.0

func NewTargetClusterWrongServiceCountError(clusterName string, selector labels.Selector, ns string, serviceCount int) TargetClusterServiceError

func (TargetClusterServiceError) Error added in v0.4.0

func (TargetClusterServiceError) ShouldRetry added in v0.4.0

func (e TargetClusterServiceError) ShouldRetry() bool

type UnrecoverableError added in v0.4.0

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

UnrecoverableError is a generic error that will cause an action to NOT be retried and dropped from any worker queues.

func NewUnrecoverableError added in v0.4.0

func NewUnrecoverableError(err error) UnrecoverableError

func (UnrecoverableError) Error added in v0.4.0

func (e UnrecoverableError) Error() string

func (UnrecoverableError) ShouldBroadcast added in v0.4.0

func (e UnrecoverableError) ShouldBroadcast() bool

func (UnrecoverableError) ShouldRetry added in v0.4.0

func (e UnrecoverableError) ShouldRetry() bool

type WrongChartDeploymentsError added in v0.4.0

type WrongChartDeploymentsError struct {
	ChartError
	// contains filtered or unexported fields
}

func NewWrongChartDeploymentsError added in v0.4.0

func NewWrongChartDeploymentsError(chartName, chartVersion, chartRepo string, deploymentCount int) WrongChartDeploymentsError

func (WrongChartDeploymentsError) Error added in v0.4.0

func (WrongChartDeploymentsError) ShouldRetry added in v0.4.0

func (e WrongChartDeploymentsError) ShouldRetry() bool

type WrongOwnerReferenceError added in v0.4.0

type WrongOwnerReferenceError string

func NewWrongOwnerReferenceError added in v0.4.0

func NewWrongOwnerReferenceError(name string, expectedUID, gotUID types.UID) WrongOwnerReferenceError

func (WrongOwnerReferenceError) Error added in v0.4.0

func (e WrongOwnerReferenceError) Error() string

func (WrongOwnerReferenceError) ShouldRetry added in v0.4.0

func (e WrongOwnerReferenceError) ShouldRetry() bool

Jump to

Keyboard shortcuts

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