controller

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessSynced is used as part of the Event 'reason' when a Function is synced
	SuccessSynced = "Synced"
	// ErrResourceExists is used as part of the Event 'reason' when a Function fails
	// to sync due to a Deployment of the same name already existing.
	ErrResourceExists = "ErrResourceExists"
	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a Deployment already existing
	MessageResourceExists = "Resource %q already exists and is not managed by controller"
	// MessageResourceSynced is the message used for an Event fired when a Function
	// is synced successfully
	MessageResourceSynced = "FunctionIngress synced successfully"
)
View Source
const AgentName = "ingress-operator"
View Source
const FaasIngressKind = "InferenceIngress"
View Source
const OpenfaasWorkloadPort = 8080

Variables

This section is empty.

Functions

func CheckCustomResourceType

func CheckCustomResourceType(obj interface{}) (faasv1.InferenceIngress, bool)

func EventRecorder

func EventRecorder(client kubernetes.Interface) record.EventRecorder

func GetClass

func GetClass(ingressType string) string

func GetIssuerKind

func GetIssuerKind(issuerType string) string

func IngressNeedsUpdate

func IngressNeedsUpdate(old, fni *faasv1.InferenceIngress) bool

func MakeAnnotations

func MakeAnnotations(fni *faasv1.InferenceIngress, host string) map[string]string

func MakeOwnerRef

func MakeOwnerRef(fni *faasv1.InferenceIngress) []metav1.OwnerReference

Types

type BaseController

type BaseController struct {
	FunctionsLister listers.InferenceIngressLister
	FunctionsSynced cache.InformerSynced

	// Workqueue is a rate limited work queue. This is used to queue work to be
	// processed instead of performing it as soon as a change happens. This
	// means we can ensure we only process a fixed amount of resources at a
	// time, and makes it easy to ensure we are never processing the same item
	// simultaneously in two different workers.
	Workqueue workqueue.RateLimitingInterface

	SyncHandler func(ctx context.Context, key string) error
}

BaseController is the controller contains the common function ingress implementation that is shared between the various versions of k8s.

func (*BaseController) EnqueueFunction

func (c *BaseController) EnqueueFunction(obj interface{})

enqueueFunction takes a fni resource and converts it into a namespace/name string which is then put onto the work queue. This method should *not* be passed resources of any type other than fni.

func (BaseController) HandleObject

func (c BaseController) HandleObject(obj interface{})

handleObject will take any resource implementing metav1.Object and attempt to find the fni resource that 'owns' it. It does this by looking at the objects metadata.ownerReferences field for an appropriate OwnerReference. It then enqueues that fni resource to be processed. If the object does not have an appropriate OwnerReference, it will simply be skipped.

func (BaseController) Run

func (c BaseController) Run(threadiness int, stopCh <-chan struct{}) error

func (BaseController) SetupEventHandlers

func (c BaseController) SetupEventHandlers(
	functionIngress v1.InferenceIngressInformer,
	kubeInformerFactory kubeinformers.SharedInformerFactory,
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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