Documentation
¶
Index ¶
- Variables
- func AWSError(err error) (smithy.APIError, bool)
- func AWSRequestFailure(err error) (smithy.APIError, bool)
- func HTTPStatusCode(err error) int
- func IsPostCreateError(err error) bool
- func NewReadOneFailAfterCreate(numAttempts int) error
- func ResourceReferenceAndIDNotSupportedFor(fields ...string) error
- func ResourceReferenceCrossNamespaceNotAllowedFor(sourceNamespace string, targetNamespace string, name string) error
- func ResourceReferenceMissingTargetFieldFor(resource string, namespace string, name string, targetField string) error
- func ResourceReferenceNotSyncedFor(resource string, namespace string, name string) error
- func ResourceReferenceOrIDRequiredFor(fields ...string) error
- func ResourceReferenceTerminalFor(resource string, namespace string, name string) error
- func WrapPostCreateError(err error) error
- type PostCreateError
- type TerminalError
Constants ¶
This section is empty.
Variables ¶
var ( // AdoptedResourceNotFound is like NotFound but provides the caller with // information that the resource being checked for existence was // previously-created out of band from ACK AdoptedResourceNotFound = fmt.Errorf("adopted resource not found") // ReadOnlyResourceNotFound is like NotFound but provides the caller with // information that the resource is on read-only mode and was not found ReadOnlyResourceNotFound = fmt.Errorf("read-only resource not found") // MissingNameIdentifier indicates an unexpected nil name identifier pointer MissingNameIdentifier = fmt.Errorf("expected name identifier, found nil") // NotAdoptable is to indicate the current resource has been explicitly // flagged as not able to be adopted NotAdoptable = fmt.Errorf("resource not adoptable") // NotImplemented is returned when a code path isn't implemented yet NotImplemented = fmt.Errorf("not implemented") // NotFound is returned when an expected resource was not found NotFound = fmt.Errorf("resource not found") // NilResourceManagerFactory is returned when a resource manager factory // that has not been properly initialized is bound to a controller manager NilResourceManagerFactory = fmt.Errorf( "error binding controller manager to reconciler before " + "setting resource manager factory", ) // ResourceManagerFactoryNotFound is return when a lookup into the resource // manager factory mapping fails ResourceManagerFactoryNotFound = fmt.Errorf("resource manager factory " + "not found", ) // TemporaryOutOfSync is to indicate the error isn't really an error // but more of a marker that the status check will be performed // after some wait time TemporaryOutOfSync = fmt.Errorf( "temporary out of sync, reconcile after some time") // Terminal is returned with resource is in Terminal Condition Terminal = fmt.Errorf( "resource is in terminal condition") // SecretTypeNotSupported is returned if non opaque secret is used. SecretTypeNotSupported = fmt.Errorf( "only opaque secrets can be used") // SecretNotFound is returned if specified kubernetes secret is not found. SecretNotFound = fmt.Errorf( "kubernetes secret not found") // ReadOneFailedAfterCreate is returned if a ReadOne call fails right after // a create operation. ReadOneFailedAfterCreate = fmt.Errorf("ReadOne call failed after a Create operation") )
var ( // FieldExportPathDoesNotExist indicates the path specified in the field // export spec does not exist on the object FieldExportPathDoesNotExist = fmt.Errorf("path does not exist in this object") // FieldExportResourceNotSynced indicates the source resource does not have // the ResourceSynced condition set to True FieldExportResourceNotSynced = fmt.Errorf("the source resource is not synced yet") // FieldExportInvalidPath indicates there was an error parsing the path into // a JQ query FieldExportInvalidPath = TerminalError{/* contains filtered or unexported fields */} // FieldExportInvalidPath indicates there was an error when executing the // JQ query FieldExportQueryFailed = TerminalError{/* contains filtered or unexported fields */} // FieldExportMissingConfigMap indicates there was an error when trying // to get the target configmap FieldExportMissingConfigMap = fmt.Errorf("unable to get existing configmap") // FieldExportMissingSecret indicates there was an error when trying // to get the target secret FieldExportMissingSecret = fmt.Errorf("unable to get existing secret") )
var ( // ResourceReferenceOrIDRequired indicates that the user failed to specify // either the actual referenced identifier or an AWSResourceReferenceWrapper ResourceReferenceOrIDRequired = fmt.Errorf( "resource reference wrapper or ID required", ) // ResourceReferenceAndIDNotSupported indicates that the user specified // both the actual referenced identifier and an AWSResourceReferenceWrapper ResourceReferenceAndIDNotSupported = fmt.Errorf( "both resource reference wrapper and ID cannot be used together", ) // ResourceReferenceTerminal indicates that the resource referred from // AWSResourceReferenceWrapper is in Terminal state and cannot be referred ResourceReferenceTerminal = fmt.Errorf( "the referenced resource has 'ACK.Terminal' condition 'True'." + " Cannot be referenced", ) // ResourceReferenceNotSynced indicates that the resource referred from // AWSResourceReferenceWrapper is still being reconciled and cannot be // referred ResourceReferenceNotSynced = fmt.Errorf( "the referenced resource is not synced yet", ) // ResourceReferenceMissingTargetField indicates that the resource referred // from AWSResourceReferenceWrapper does not contain the target field which // needs to be referred ResourceReferenceMissingTargetField = fmt.Errorf( "the referenced resource is missing the target field", ) // ResourceReferenceCrossNamespaceNotAllowed indicates that a resource // reference specifies a Namespace that differs from the namespace of the // resource containing the reference, and the // --enable-cross-namespace flag is not enabled. ResourceReferenceCrossNamespaceNotAllowed = fmt.Errorf( "cross-namespace resource reference is not allowed. " + "Set --enable-cross-namespace=true to allow it", ) )
Functions ¶
func AWSError ¶
AWSError returns the type conversion for the supplied error to an aws-sdk-go Error interface
func AWSRequestFailure ¶
AWSRequestFailure returns the type conversion for the supplied error to an aws-sdk-go RequestFailure interface
func HTTPStatusCode ¶
HTTPStatusCode returns the HTTP status code from the supplied error by introspecting the error to see if it's an awserr.RequestFailure interface and if so, calling StatusCode() on that type-converted RequestFailure. If the type conversion fails, returns -1
func IsPostCreateError ¶ added in v0.66.0
IsPostCreateError returns true if the backend AWS resource was created before the supplied error occurred.
func NewReadOneFailAfterCreate ¶ added in v0.18.4
NewReadOneFailAfterCreate takes a number of attempts and returns a ReadOneFailedAfterCreate error if multiple ReadOne calls fails.
func ResourceReferenceAndIDNotSupportedFor ¶ added in v0.16.0
ResourceReferenceAndIDNotSupportedFor returns a ResourceReferenceAndIDNotSupported error for one or more supplied fields
func ResourceReferenceCrossNamespaceNotAllowedFor ¶ added in v0.60.0
func ResourceReferenceCrossNamespaceNotAllowedFor( sourceNamespace string, targetNamespace string, name string, ) error
ResourceReferenceCrossNamespaceNotAllowedFor returns a ResourceReferenceCrossNamespaceNotAllowed error annotated with the source namespace, target namespace, and referenced resource name.
func ResourceReferenceMissingTargetFieldFor ¶ added in v0.16.0
func ResourceReferenceMissingTargetFieldFor(resource string, namespace string, name string, targetField string, ) error
ResourceReferenceMissingTargetFieldFor returns a ResourceReferenceMissingTargetField for supplied resource
func ResourceReferenceNotSyncedFor ¶ added in v0.16.0
ResourceReferenceNotSyncedFor returns a ResourceReferenceNotSynced for supplied resource
func ResourceReferenceOrIDRequiredFor ¶ added in v0.16.0
ResourceReferenceOrIDRequiredFor returns a ResourceReferenceOrIDRequired error for one or more supplied fields
func ResourceReferenceTerminalFor ¶ added in v0.16.0
ResourceReferenceTerminalFor returns a ResourceReferenceTerminal for supplied resource
func WrapPostCreateError ¶ added in v0.66.0
WrapPostCreateError marks err as a post-create failure, returning it unchanged if it is not an AWS API error.
Only AWS API errors cause the reconciler to unmanage a resource, so wrapping anything else would change no behaviour while hiding sentinels such as NotFound and the ackrequeue signals from the identity comparisons callers perform on them. The check unwraps, so an AWS error carried inside another error is still wrapped -- it already triggers the unmanage path today.
Types ¶
type PostCreateError ¶ added in v0.66.0
type PostCreateError struct {
// contains filtered or unexported fields
}
PostCreateError wraps an error that occurred after the backend AWS resource was successfully created, when a later call in the same Create operation failed. It tells the reconciler the resource exists in AWS, so the ACK finalizer must be retained.
func (*PostCreateError) Error ¶ added in v0.66.0
func (e *PostCreateError) Error() string
func (*PostCreateError) Unwrap ¶ added in v0.66.0
func (e *PostCreateError) Unwrap() error
type TerminalError ¶ added in v0.18.0
type TerminalError struct {
// contains filtered or unexported fields
}
TerminalError defines an error that should be considered terminal, and placed onto an ACK.Terminal condition
func NewTerminalError ¶ added in v0.18.3
func NewTerminalError(terminalError error) *TerminalError
func (TerminalError) Error ¶ added in v0.18.0
func (e TerminalError) Error() string
func (TerminalError) Unwrap ¶ added in v0.18.0
func (e TerminalError) Unwrap() error