manager

package
v0.0.0-...-706ea71 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachePod

type CachePod struct {
	metav1.ObjectMeta
	Spec v1.PodSpec
}

CachePod is the struct save pod data for check pod is really changed

type CommonResourceEventHandler

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

CommonResourceEventHandler can be used by configmapManager and podManager

func NewCommonResourceEventHandler

func NewCommonResourceEventHandler(events chan watch.Event) *CommonResourceEventHandler

NewCommonResourceEventHandler create CommonResourceEventHandler used by configmapManager and podManager

func (*CommonResourceEventHandler) OnAdd

func (c *CommonResourceEventHandler) OnAdd(obj interface{})

OnAdd handle Add event

func (*CommonResourceEventHandler) OnDelete

func (c *CommonResourceEventHandler) OnDelete(obj interface{})

OnDelete handle Delete event

func (*CommonResourceEventHandler) OnUpdate

func (c *CommonResourceEventHandler) OnUpdate(oldObj, newObj interface{})

OnUpdate handle Update event

type ConfigMapManager

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

ConfigMapManager manage all events of configmap by SharedInformer

func NewConfigMapManager

func NewConfigMapManager(kubeClient *kubernetes.Clientset, namespace string) (*ConfigMapManager, error)

NewConfigMapManager create ConfigMapManager by kube clientset and namespace

func (*ConfigMapManager) Events

func (cmm *ConfigMapManager) Events() chan watch.Event

Events return the channel save events from watch configmap change

type DeviceManager

type DeviceManager struct {

	// Device, key is device.Name, value is *v1alpha2.Device{}
	Device sync.Map
	// contains filtered or unexported fields
}

DeviceManager is a manager watch device change event

func NewDeviceManager

func NewDeviceManager(crdClient *rest.RESTClient, namespace string) (*DeviceManager, error)

NewDeviceManager create DeviceManager from config

func (*DeviceManager) Events

func (dmm *DeviceManager) Events() chan watch.Event

Events return a channel, can receive all device event

type Manager

type Manager interface {
	Events() chan watch.Event
}

Manager define the interface of a Manager, configmapManager and podManager implement it

type PodManager

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

PodManager is a manager watch pod change event

func NewPodManager

func NewPodManager(kubeClient *kubernetes.Clientset, namespace, nodeName string) (*PodManager, error)

NewPodManager create PodManager from config

func (*PodManager) Events

func (pm *PodManager) Events() chan watch.Event

Events return a channel, can receive all pod event

Jump to

Keyboard shortcuts

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