controller

package
v4.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const MaxWorkers = 5

Variables

This section is empty.

Functions

func RunWithTime

func RunWithTime(f func()) time.Duration

Run a function and return the time.

Types

type Arbiter

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

func NewArbiter

func NewArbiter(baseUrl string, workerCount int, controllerId string) *Arbiter

type Controller

type Controller struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewController

func NewController(os *osclient.Client, kc *kclient.Client, hub *HubParams) *Controller

func (*Controller) AddImage

func (c *Controller) AddImage(ID string, Reference string)

func (*Controller) Load

func (c *Controller) Load(done <-chan struct{})

func (*Controller) RemoveImage

func (c *Controller) RemoveImage(ID string, Reference string)

func (*Controller) Start

func (c *Controller) Start(arb *Arbiter)

func (*Controller) Stop

func (c *Controller) Stop()

func (*Controller) ValidateConfig

func (c *Controller) ValidateConfig() bool

func (*Controller) ValidateDockerConfig

func (c *Controller) ValidateDockerConfig() bool

func (*Controller) Watch

func (c *Controller) Watch()

type Dispatcher

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

func NewDispatcher

func NewDispatcher(jobQueue chan Job, maxWorkers int) *Dispatcher

func (*Dispatcher) Run

func (d *Dispatcher) Run(arb *Arbiter)

type Docker

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

func NewDocker

func NewDocker() Docker

type HubParams

type HubParams struct {
	Config  *bdscommon.HubConfig
	Scanner string
	Workers int
	Version string
}

type Job

type Job struct {
	ScanImage *ScanImage
	// contains filtered or unexported fields
}

func (Job) Done

func (job Job) Done()

func (Job) GetAnnotationInfo

func (job Job) GetAnnotationInfo() (result bool, info bdscommon.ImageInfo)

func (Job) Load

func (job Job) Load()

func (Job) MergeAnnotationResults

func (job Job) MergeAnnotationResults(oldInfo bdscommon.ImageInfo, newInfo bdscommon.ImageInfo) bdscommon.ImageInfo

func (Job) UpdateAnnotationInfo

func (job Job) UpdateAnnotationInfo(newInfo bdscommon.ImageInfo) bool

type ScanImage

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

type ScanResult

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

type Watcher

type Watcher struct {
	Namespace string
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(os *osclient.Client, c *Controller) *Watcher

Create a new watcher

func (*Watcher) ImageAdded

func (w *Watcher) ImageAdded(is *imageapi.ImageStream)

func (*Watcher) ImageDeleted

func (w *Watcher) ImageDeleted(is *imageapi.ImageStream)

func (*Watcher) ImageUpdated

func (w *Watcher) ImageUpdated(is *imageapi.ImageStream)

care should be used with updates. Per kube docs:

OnUpdate is also called when a re-list happens, and it will
  get called even if nothing changed. This is useful for periodically
  evaluating or syncing something.

func (*Watcher) PodCreated

func (w *Watcher) PodCreated(pod *kapi.Pod)

func (*Watcher) Run

func (w *Watcher) Run()

type Worker

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

func NewWorker

func NewWorker(index int, workerPool chan chan Job, arbiter *Arbiter) Worker

func (Worker) RequestScanAuthorization

func (w Worker) RequestScanAuthorization(job Job)

func (Worker) Start

func (w Worker) Start()

Jump to

Keyboard shortcuts

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