api

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFactory

type HandlerFactory = func(client client.Client, args string) (MutatingHandler, error)

HandlerFactory is a function that builds a MutatingHandler.

type MutatingHandler

type MutatingHandler interface {
	// Mutate injects affinity info into pod
	// if a plugin return true, it means that no need to call other plugins
	// map[string]base.RuntimeInfoInterface's key is pvcName
	Mutate(*corev1.Pod, map[string]base.RuntimeInfoInterface) (shouldStop bool, err error)
	// GetName returns the name of plugin
	GetName() string
}

MutatingHandler defines the interface for mutating a pod, implementations should be thread(goroutine) safe.

type Registry

type Registry map[string]HandlerFactory

func (Registry) Register

func (r Registry) Register(name string, factory HandlerFactory) error

type RegistryHandler

type RegistryHandler interface {
	GetPodWithoutDatasetHandler() []MutatingHandler
	GetPodWithDatasetHandler() []MutatingHandler
	GetServerlessPodWithDatasetHandler() []MutatingHandler
	GetServerlessPodWithoutDatasetHandler() []MutatingHandler
}

RegistryHandler record the active plugins including two kinds: plugins for pod with no dataset mounted and with dataset mounted

Jump to

Keyboard shortcuts

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