controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 27 Imported by: 5

Documentation

Index

Constants

View Source
const (
	Create = "create"
	Delete = "delete"
	Update = "update"
)

These are the event types supported for controllers

Variables

View Source
var Kubeclient *kubernetes.Clientset

Kubeclient is kubernetes Clientset

Functions

func PvcHandlePodDeletion

func PvcHandlePodDeletion(podDetails *groups_v1.PodDetails)

PvcHandlePodDeletion action to be taken when pod is deleted. Unbound all bounded pvcs.

func Start

func Start(conf *Config)

Start runs the controller goroutine. nolint: gocyclo, interfacer

func UpdatePodVolumeClaims

func UpdatePodVolumeClaims(pod api_v1.Pod, podDetails groups_v1.PodDetails, eventTime meta_v1.Time) groups_v1.PodDetails

UpdatePodVolumeClaims activePodVolumeClaims: current active(bounded) podVolumeClaims for the pod. old podVolumeClaims: Claims(map) for the pod before this update. compares old podVolumeClaims and activePodVolumeClaims. This function hadles 3 cases. Case Unbound pvc:

Present as 'bounded' in old podVolumeClaims. Not present in activePodVolumeClaims.

Case New PVC:

Not present in old podVolumeClaims. Present in activePodVolumeClaims.

Case Bound an unbounded pvc:

Present as 'unbounded' in old podVolumeClaims. Present in activePodVolumeClaims.

Types

type Config

type Config struct {
	KubeConfig       *rest.Config
	Resource         Resource `json:"resource"`
	RingBuffer       *buffering.RingBuffer
	Groupcrdclient   *groups_v1.GroupClient
	Subscriberclient *subscriber_v1.SubscriberClient
	Kubeclient       *kubernetes.Clientset
}

Config contains config objects

type Controller

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

Controller holds Kubernetes controller components

func (*Controller) HasSynced

func (c *Controller) HasSynced() bool

HasSynced is required for the cache.Controller interface.

func (*Controller) LastSyncResourceVersion

func (c *Controller) LastSyncResourceVersion() string

LastSyncResourceVersion is required for the cache.Controller interface.

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{})

Run initiates the controller

type Event

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

Event indicate the informerEvent

type Payload

type Payload struct {
	Key          string `json:"key"`
	EventType    string `json:"eventType"`
	ResourceType string `json:"resourceType"`
	CloudType    string `json:"cloudType"`
	Data         string `json:"data"`
	CaptureTime  meta_v1.Time
}

Payload holds payload information

type PayloadWrapper

type PayloadWrapper struct {
	OrgID   string         `json:"orgId"`
	Cluster string         `json:"cluster"`
	Data    []*interface{} `json:"data"`
}

PayloadWrapper holds additional information about payload

type Resource

type Resource struct {
	Pod                   bool `json:"po"`
	Node                  bool `json:"node"`
	PersistentVolume      bool `json:"pv"`
	PersistentVolumeClaim bool `json:"pvc"`
	Service               bool `json:"service"`
	ReplicaSet            bool `json:"replicaset"`
	StatefulSet           bool `json:"statefulset"`
	Deployment            bool `json:"deployment"`
	Job                   bool `json:"job"`
	DaemonSet             bool `json:"daemonset"`
	Namespace             bool `json:"namespace"`
	Group                 bool `json:"groups.vmware.purser.com"`
	Subscriber            bool `json:"subscribers.vmware.purser.com"`
}

Resource contains resource configuration

Directories

Path Synopsis
discovery

Jump to

Keyboard shortcuts

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