Documentation ¶
Index ¶
- func AnySyncerViewChanged(old, new metav1.Object) bool
- func FilteredSyncerViewsChanged(old, new metav1.Object, keepSyncTarget func(syncTargetKey string) bool) bool
- func SyncerViewChanged(old, new metav1.Object, syncTargetKey string) bool
- func UpstreamViewChanged(old, new Object, equality func(old, new interface{}) bool) bool
- type Object
- type SyncerViewRetriever
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnySyncerViewChanged ¶
SyncerViewChanged returns true if the syncer view fields changed between old and new for at least one of the SyncTargets on which the resource is synced.
func FilteredSyncerViewsChanged ¶
func FilteredSyncerViewsChanged(old, new metav1.Object, keepSyncTarget func(syncTargetKey string) bool) bool
FilteredSyncerViewsChanged returns true if the syncer view fields changed between old and new for at least one of the SyncTarget filtered by the [keepSynctarget] function.
func SyncerViewChanged ¶
SyncerViewChanged returns true if the syncer view fields changed between old and new for the given SyncTarget.
func UpstreamViewChanged ¶
UpstreamViewChanged check equality between old and new, ignoring the syncer view annotations.
Types ¶
type SyncerViewRetriever ¶
type SyncerViewRetriever[T Object] interface { // GetFilteredSyncerViews retrieves the syncer views of the resource for // all the SyncTargets filtered by the [keepSyncTarget] function GetFilteredSyncerViews(ctx context.Context, gvr schema.GroupVersionResource, upstreamResource T, keepSyncTarget func(key string) bool) (map[string]T, error) // GetAllSyncerViews retrieves the syncer views of the resource for // all the SyncTargets on which the resource is being synced GetAllSyncerViews(ctx context.Context, gvr schema.GroupVersionResource, upstreamResource T) (map[string]T, error) // GetSyncerView retrieves the syncer view of the resource for // the given SyncTarget GetSyncerView(ctx context.Context, gvr schema.GroupVersionResource, upstreamResource T, syncTargetKey string) (T, error) }
SyncerViewRetriever allows retrieving the syncer views on an upstream object. It is designed to use the same transformation and overriding logic as the one used by the Syncer virtual workspace.
func NewDefaultSyncerViewManager ¶
func NewDefaultSyncerViewManager[T Object]() SyncerViewRetriever[T]
NewDefaultSyncerViewManager creates a SyncerViewRetriever based on the default transfomation and summarizing rules providers.
func NewSyncerViewRetriever ¶
func NewSyncerViewRetriever[T Object](transformationProvider transformations.TransformationProvider, summarizingRulesprovider transformations.SummarizingRulesProvider) SyncerViewRetriever[T]
NewSyncerViewRetriever creates a SyncerViewRetriever based on a given transformations.TransformationProvider and a given transformations.SummarizingRulesProvider. Retrieving the syncer views on an upstream object should use the same transformation and overriding logic as the one used by the Syncer virtual workspace. So the 2 arguments should be chosen accordingly.