crd

package
v0.0.0-...-062eff5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAll

GetAll returns all known CRDs

func Purge

Purge deletes the destination CRDs as a synchronous operation.

Types

type Mapping

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

Mapping maps a set of source APIGroup/Version pairs to destination APIGroup/Version pairs.

func NewMapping

func NewMapping(forward map[schema.GroupVersion]schema.GroupVersion) (Mapping, error)

NewMapping returns a new mapping based on the provided input GroupVersion map.

func (Mapping) GetGroupVersion

func (m Mapping) GetGroupVersion(group string) (source, destination schema.GroupVersion, found bool)

GetGroupVersion returns the GroupVersion mapping pairs for a given APIGroup.

func (Mapping) GetVersion

func (m Mapping) GetVersion(group string) string

GetVersion Returns the version of an APIGroup.

func (Mapping) String

func (m Mapping) String() string

String output of Mapping.

type SyncListener

type SyncListener struct {
	OnDestinationAdded   func(name string, kind string, listKind string)
	OnDestinationRemoved func(name string)
}

SyncListener defines an interface for a listener that will get notified as destination Crds are added/removed.

type Synchronizer

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

Synchronizer is a Kubernetes controller that keeps a synchronized copy of an source set of CRDs in destination APIGroup/Version(s). The mapping from source to destination is specified by a mapping object. A passed-in listener can be used to detect when target CRDs are added/deleted.

func NewSynchronizer

func NewSynchronizer(crdi v1beta1.CustomResourceDefinitionInterface, mapping Mapping, resyncPeriod time.Duration, listener SyncListener) *Synchronizer

NewSynchronizer returns a new instance of a Synchronizer. The returned Synchronizer is not started: this needs to be done explicitly using start()/Stop() methods.

func (*Synchronizer) Start

func (s *Synchronizer) Start() error

Start commences synchronizing CRDs.

func (*Synchronizer) Stop

func (s *Synchronizer) Stop()

Stop the Synchronizer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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