reconciler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 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 Base

type Base struct {
	// KubeClientSet allows us to talk to the k8s for core APIs
	KubeClientSet kubernetes.Interface

	// PipelineClientSet allows us to configure pipeline objects
	PipelineClientSet pipelineclientset.Interface

	// TriggersClientSet allows us to configure triggers objects
	TriggersClientSet triggersclientset.Interface

	// CachingClientSet allows us to instantiate Image objects
	CachingClientSet cachingclientset.Interface

	// ConfigMapWatcher allows us to watch for ConfigMap changes.
	ConfigMapWatcher configmap.Watcher

	// Recorder is an event recorder for recording Event resources to the
	// Kubernetes API.
	Recorder record.EventRecorder

	// Sugared logger is easier to use but is not as performant as the
	// raw logger. In performance critical paths, call logger.Desugar()
	// and use the returned raw logger instead. In addition to the
	// performance benefits, raw logger also preserves type-safety at
	// the expense of slightly greater verbosity.
	Logger *zap.SugaredLogger
}

Base implements the core controller logic, given a Reconciler.

func NewBase

func NewBase(opt Options, controllerAgentName string) *Base

NewBase instantiates a new instance of Base implementing the common & boilerplate code between our reconcilers.

type Options

type Options struct {
	KubeClientSet     kubernetes.Interface
	PipelineClientSet pipelineclientset.Interface
	TriggersClientSet triggersclientset.Interface
	CachingClientSet  cachingclientset.Interface

	ConfigMapWatcher configmap.Watcher
	Logger           *zap.SugaredLogger
	Recorder         record.EventRecorder

	ResyncPeriod time.Duration
}

Options defines the common reconciler options. We define this to reduce the boilerplate argument list when creating our controllers.

func (Options) GetTrackerLease

func (o Options) GetTrackerLease() time.Duration

GetTrackerLease returns a multiple of the resync period to use as the duration for tracker leases. This attempts to ensure that resyncs happen to refresh leases frequently enough that we don't miss updates to tracked objects.

Directories

Path Synopsis
v1alpha1

Jump to

Keyboard shortcuts

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