Documentation ¶
Index ¶
- func ErrorIsMultipleMatchesForFilter(err error) bool
- func ErrorIsNoMatchesForFilter(err error) bool
- func Get(ctx context.Context, k8sClient client.Client, namespace string, ...) (*marin3rv1alpha1.EnvoyConfigRevision, error)
- func List(ctx context.Context, k8sClient client.Client, namespace string, ...) (*marin3rv1alpha1.EnvoyConfigRevisionList, error)
- func SortByPublication(desiredVersion string, list *marin3rv1alpha1.EnvoyConfigRevisionList) *marin3rv1alpha1.EnvoyConfigRevisionList
- type Error
- type ErrorReason
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorIsMultipleMatchesForFilter ¶
ErrorIsMultipleMatchesForFilter returns true if the Reason field of an Error is a MultipleRevisionsForFilterError. Returns false otherwise
func ErrorIsNoMatchesForFilter ¶
ErrorIsNoMatchesForFilter returns true if the Reason field of an Error is a NoMatchesForFilterError. Returns false otherwise.
func Get ¶
func Get(ctx context.Context, k8sClient client.Client, namespace string, filters ...filters.RevisionFilter) (*marin3rv1alpha1.EnvoyConfigRevision, error)
Get returns the EnvoyConfigRevision that matches the provided filters. If no EnvoyConfigRevisions are returned by the API an error is returned. If more than one EnvoyConfigRevision is returned by the API an error is returned.
func List ¶
func List(ctx context.Context, k8sClient client.Client, namespace string, filters ...filters.RevisionFilter) (*marin3rv1alpha1.EnvoyConfigRevisionList, error)
List returns the list of EnvoyConfigRevisions owned by the EnvoyConfig the reconciler has been instantiated with
func SortByPublication ¶
func SortByPublication(desiredVersion string, list *marin3rv1alpha1.EnvoyConfigRevisionList) *marin3rv1alpha1.EnvoyConfigRevisionList
SortByPublication sorts a list of EnvoyConfigRevisions using the following criteria - if revision matches desiredVersion, it always goes higher - if publication date is defined, higher publication date goes higher - if publication date is not defined, higher creation date goes higher
Types ¶
type Error ¶
type Error struct { Reason ErrorReason Method string Message string }
Error custom error types for envoyconfig controller
type ErrorReason ¶
type ErrorReason string
ErrorReason is an enum of possible errors for the reconciler
const ( // UnknownError is used for non specific errors that don't // require special treatment or are yet unknown UnknownError ErrorReason = "Unknown" // MultipleMatchesForFilterError means that several revisions // match the provided filters when only one should MultipleMatchesForFilterError ErrorReason = "MultipleMatchesForFilter" // NoMatchesForFilterError means that no revision matches the provided filters NoMatchesForFilterError ErrorReason = "NoMatchesForFilter" )
func ReasonForError ¶
func ReasonForError(err error) ErrorReason
ReasonForError returns the ErrorReason for a given error