observer

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package observer polls the Kubernetes api-server to discover all supported API groups/object kinds, and launch a new controller for each of them. Due to CRD/TPR, new API groups / object kinds may appear at any time, that's why we keep polling the API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerFactory

type ControllerFactory interface {
	NewController(client cache.ListerWatcher, notifier event.Notifier, name string) controller.Interface
}

ControllerFactory make controllers generation interchangeable

type Observer

type Observer struct {
	sync.RWMutex // protect ctrls
	// contains filtered or unexported fields
}

Observer watch api-server and manage kubernetes controllers lifecyles

func New

func New(log logger, client restclient, notif event.Notifier, factory ControllerFactory, excluded []string, namespace string) *Observer

New returns a new observer, that will watch API resources and create controllers

func (*Observer) Start

func (c *Observer) Start() *Observer

Start starts the observer in a detached goroutine

func (*Observer) Stop

func (c *Observer) Stop()

Stop halts the observer

Jump to

Keyboard shortcuts

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