syncer

package
v0.16.0-beta.13 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteObject

func DeleteObject(ctx *synccontext.SyncContext, pObj client.Object, reason string) (ctrl.Result, error)

func RegisterFakeSyncer

func RegisterFakeSyncer(ctx *synccontext.RegisterContext, syncer FakeSyncer) error

func RegisterSyncer

func RegisterSyncer(ctx *synccontext.RegisterContext, syncer Syncer) error

Types

type ControllerModifier

type ControllerModifier interface {
	ModifyController(ctx *synccontext.RegisterContext, builder *builder.Builder) (*builder.Builder, error)
}

ControllerModifier is used to modify the created controller for the syncer

type Exporter added in v0.14.0

type Exporter interface {
	Name() string
	Register()
}

type FakeSyncer

type FakeSyncer interface {
	Object

	FakeSyncUp(ctx *synccontext.SyncContext, req types.NamespacedName) (ctrl.Result, error)
	FakeSync(ctx *synccontext.SyncContext, vObj client.Object) (ctrl.Result, error)
}

type IndicesRegisterer

type IndicesRegisterer interface {
	RegisterIndices(ctx *synccontext.RegisterContext) error
}

IndicesRegisterer registers additional indices for the controller

type Initializer

type Initializer interface {
	Init(registerContext *synccontext.RegisterContext) error
}

Initializer is used to create and update the prerequisites of the syncer before the controller is started

type Object

type Object interface {
	Name() string
	Resource() client.Object
}

type ObjectExcluder added in v0.14.0

type ObjectExcluder interface {
	ExcludeVirtual(vObj client.Object) bool
	ExcludePhysical(vObj client.Object) bool
}

type Options added in v0.14.0

type Options struct {
	// DisableUIDDeletion disables automatic deletion of physical objects if the uid between physical
	// and virtual doesn't match anymore.
	DisableUIDDeletion bool

	IsClusterScopedCRD   bool
	HasStatusSubresource bool
}

type OptionsProvider added in v0.14.0

type OptionsProvider interface {
	WithOptions() *Options
}

type Starter

type Starter interface {
	ReconcileStart(ctx *synccontext.SyncContext, req ctrl.Request) (bool, error)
	ReconcileEnd()
}

type Syncer

type Syncer interface {
	Object
	translator.NameTranslator

	// SyncDown is called when a virtual object was created and needs to be synced down to the physical cluster
	SyncDown(ctx *synccontext.SyncContext, vObj client.Object) (ctrl.Result, error)
	// Sync is called to sync a virtual object with a physical object
	Sync(ctx *synccontext.SyncContext, pObj client.Object, vObj client.Object) (ctrl.Result, error)
}

type UpSyncer

type UpSyncer interface {
	// SyncUp is called when a physical object exists but the virtual object does not exist
	SyncUp(ctx *synccontext.SyncContext, pObj client.Object) (ctrl.Result, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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