crd

package
v0.0.0-...-fd0897c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAll

func GetAll(config *rest.Config) ([]apiext.CustomResourceDefinition, error)

GetAll returns all known CRDs

func Purge

func Purge(config *rest.Config, mapping Mapping) error

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(config *rest.Config, mapping Mapping, resyncPeriod time.Duration, listener SyncListener) (*Synchronizer, error)

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.

Jump to

Keyboard shortcuts

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