source

package
Version: v0.0.0-...-c510420 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package source is a modification of the controller-runtime pkg/source package to use the same Kind based source but without the hard requirement to register them with the k8s API server. This source is meant to be used when the event source is not k8s and the event object cache is based on client-go informers.

NOTE: Based on https://github.com/kubernetes-sigs/controller-runtime/blob/v0.8.3/pkg/source/source.go, modified to enable running the source when the Kind is not registered with k8s API server. This is needed for the cache of external system objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKindWithCache

func NewKindWithCache(object client.Object, cache cache.Cache) source.SyncingSource

NewKindWithCache creates a Source without InjectCache, so that it is assured that the given cache is used and not overwritten. It can be used to watch objects in a different cluster by passing the cache from that other cluster

Types

type Kind

type Kind struct {
	// Type is the type of object to watch.  e.g. &v1.Pod{}
	Type client.Object
	// contains filtered or unexported fields
}

Kind is used to provide a source of events originating inside the cluster from Watches (e.g. Pod Create)

func (*Kind) InjectCache

func (ks *Kind) InjectCache(c cache.Cache) error

InjectCache is internal should be called only by the Controller. InjectCache is used to inject the Cache dependency initialized by the ControllerManager.

func (*Kind) Start

Start is internal and should be called only by the Controller to register an EventHandler with the Informer to enqueue reconcile.Requests.

func (*Kind) String

func (ks *Kind) String() string

func (*Kind) WaitForSync

func (ks *Kind) WaitForSync(ctx context.Context) error

WaitForSync implements SyncingSource to allow controllers to wait with starting workers until the cache is synced.

Source Files

Directories

Path Synopsis
This is taken from https://github.com/kubernetes-sigs/controller-runtime/blob/v0.8.3/pkg/source/internal/eventsource.go.
This is taken from https://github.com/kubernetes-sigs/controller-runtime/blob/v0.8.3/pkg/source/internal/eventsource.go.

Jump to

Keyboard shortcuts

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