generic

package
v0.21.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMapper

func NewMapper(ctx *synccontext.RegisterContext, obj client.Object, translateName PhysicalNameFunc) (synccontext.Mapper, error)

NewMapper creates a new mapper with a custom physical name func

func NewMapperWithObject

func NewMapperWithObject(ctx *synccontext.RegisterContext, obj client.Object, translateName PhysicalNameWithObjectFunc) (synccontext.Mapper, error)

NewMapperWithObject creates a new mapper with a custom physical name func

func NewMapperWithoutRecorder

func NewMapperWithoutRecorder(ctx *synccontext.RegisterContext, obj client.Object, translateName PhysicalNameWithObjectFunc) (synccontext.Mapper, error)

NewMapperWithoutRecorder creates a new mapper with a recorder to store mappings in the mappings store

func NewMirrorMapper

func NewMirrorMapper(obj client.Object) (synccontext.Mapper, error)

func RecordMapping

func RecordMapping(ctx *synccontext.SyncContext, pName, vName types.NamespacedName, gvk schema.GroupVersionKind) error

func TryToTranslateBackByName

func TryToTranslateBackByName(ctx *synccontext.SyncContext, req types.NamespacedName, gvk schema.GroupVersionKind) types.NamespacedName

TryToTranslateBackByName is used to find out the name mapping automatically in certain scenarios, this doesn't always work, but for some cases this is pretty useful.

func WithRecorder

func WithRecorder(mapper synccontext.Mapper) synccontext.Mapper

Types

type PhysicalNameFunc

type PhysicalNameFunc func(ctx *synccontext.SyncContext, vName, vNamespace string) types.NamespacedName

PhysicalNameFunc is a definition to translate a name

type PhysicalNameWithObjectFunc

type PhysicalNameWithObjectFunc func(ctx *synccontext.SyncContext, vName, vNamespace string, vObj client.Object) types.NamespacedName

PhysicalNameWithObjectFunc is a definition to translate a name that also optionally expects a vObj

Jump to

Keyboard shortcuts

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