types

package
v0.19.5 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base added in v0.19.0

type Base interface {
	Name() string
}

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 ControllerStarter added in v0.19.0

type ControllerStarter interface {
	Register(ctx *synccontext.RegisterContext) error
}

ControllerStarter is a generic controller that can be used if the syncer abstraction does not fit the use case

type Exporter

type Exporter interface {
	Base
	Register()
}

type FakeSyncer

type FakeSyncer interface {
	Object

	FakeSyncToVirtual(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 {
	Base
	Resource() client.Object
}

type ObjectExcluder

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

ObjectExcluder can be used to add custom object exclude logic to the syncer

type Options

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

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

	// SyncToHost is called when a virtual object was created and needs to be synced down to the physical cluster
	SyncToHost(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 ToVirtualSyncer added in v0.19.0

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

Jump to

Keyboard shortcuts

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