kube

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	log logrus.FieldLogger,
	f informers.SharedInformerFactory,
	k8sVersion version.Version,
) *Controller

func (*Controller) AddSubscribers added in v0.41.1

func (c *Controller) AddSubscribers(subs ...ObjectSubscriber)

func (*Controller) GetPodOwnerID added in v0.41.1

func (c *Controller) GetPodOwnerID(pod *corev1.Pod) string

GetPodOwnerID returns last pod owner ID. In most cases for pod it will search for Deployment or CronJob uid if exists.

func (*Controller) NeedLeaderElection added in v0.47.2

func (c *Controller) NeedLeaderElection() bool

func (*Controller) Start added in v0.47.2

func (c *Controller) Start(ctx context.Context) error

type Event

type Event string
const (
	EventAdd    Event = "add"
	EventDelete Event = "delete"
	EventUpdate Event = "update"
)

type Object

type Object interface {
	runtime.Object
	metav1.Object
}

type ObjectSubscriber

type ObjectSubscriber interface {
	ResourceEventHandler
	Run(ctx context.Context) error
	RequiredInformers() []reflect.Type
}

type ResourceEventHandler

type ResourceEventHandler interface {
	OnAdd(obj Object)
	OnUpdate(obj Object)
	OnDelete(obj Object)
}

Jump to

Keyboard shortcuts

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