revisions

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorIsMultipleMatchesForFilter

func ErrorIsMultipleMatchesForFilter(err error) bool

ErrorIsMultipleMatchesForFilter returns true if the Reason field of an Error is a MultipleRevisionsForFilterError. Returns false otherwise

func ErrorIsNoMatchesForFilter

func ErrorIsNoMatchesForFilter(err error) bool

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(currentResourcesVersion string, list *marin3rv1alpha1.EnvoyConfigRevisionList) *marin3rv1alpha1.EnvoyConfigRevisionList

SortByPublication sorts a list of EnvoyConfigRevisions using the following criteria - if revision matches currentResourcesVersion, 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

func NewError

func NewError(t ErrorReason, method string, msg string) Error

NewError returns a new ErrorType struct

func (Error) Error

func (e Error) Error() string

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

Jump to

Keyboard shortcuts

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