controller

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationPrefix = "k8s-copier.fig.org/"
)

Variables

Functions

func ApplyReplaceRule

func ApplyReplaceRule(c *Controller, rule *Rule, target *ResourceInstance) error

func FindInListers

func FindInListers(dls []cache.GenericLister, namespace, name string) (runtime.Object, error)

Types

type Controller

type Controller struct {
	Context context.Context
	// contains filtered or unexported fields
}

func New

func New(ctx *context.Context, config *rest.Config, namespaces []string) *Controller

New returns a new controller.

func (*Controller) AddInformers

func (*Controller) AddTarget

func (c *Controller) AddTarget(target string) error

func (*Controller) FindResourceInstance

func (c *Controller) FindResourceInstance(resource *Resource) (*ResourceInstance, error)

func (*Controller) Run

func (c *Controller) Run(workers int, stopCh <-chan struct{}) error

func (*Controller) Start

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

type JSONSource

type JSONSource struct {
	Data interface{}
}

func (*JSONSource) GetData

func (src *JSONSource) GetData() (interface{}, error)

func (*JSONSource) Register

func (src *JSONSource) Register(c *Controller, stopCh <-chan struct{}, rule *Rule, target *ResourceInstance) error

type QueuingEventHandler

type QueuingEventHandler struct {
	GVR   *schema.GroupVersionResource
	Queue workqueue.RateLimitingInterface
}

func (*QueuingEventHandler) Enqueue

func (q *QueuingEventHandler) Enqueue(obj interface{})

func (*QueuingEventHandler) OnAdd

func (q *QueuingEventHandler) OnAdd(obj interface{})

func (*QueuingEventHandler) OnDelete

func (q *QueuingEventHandler) OnDelete(obj interface{})

func (*QueuingEventHandler) OnUpdate

func (q *QueuingEventHandler) OnUpdate(old, new interface{})

type Resource

type Resource struct {
	Name      string
	Namespace string
	Kind      string
}

func (*Resource) Key

func (r *Resource) Key() string

type ResourceInstance

type ResourceInstance struct {
	*Resource
	GVR    schema.GroupVersionResource
	Object interface{}
}

type ResourceSource

type ResourceSource struct {
	Control *Controller
	Spec    *Resource
	Path    []string
}

func (*ResourceSource) GetData

func (src *ResourceSource) GetData() (interface{}, error)

func (*ResourceSource) Register

func (src *ResourceSource) Register(c *Controller, stopCh <-chan struct{}, rule *Rule, target *ResourceInstance) error

type Rule

type Rule struct {
	Apply      func(*Controller, *Rule, *ResourceInstance) error
	Target     *Resource
	TargetPath string
	Source     Source
}

func ParseRule

func ParseRule(target, source, defaultNamespace string) (*Rule, error)

type Source

type Source interface {
	GetData() (interface{}, error)
	Register(*Controller, <-chan struct{}, *Rule, *ResourceInstance) error
}

func ParseSource

func ParseSource(source, defaultNamespace string) (Source, error)

Jump to

Keyboard shortcuts

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