overrider

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package overrider defines common utils for working with override.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAllMatchingOverridesForResourceSnapshot added in v0.12.0

func FetchAllMatchingOverridesForResourceSnapshot(
	ctx context.Context,
	c client.Client,
	manager informer.Manager,
	crp string,
	masterResourceSnapshot *placementv1beta1.ClusterResourceSnapshot,
) ([]*placementv1alpha1.ClusterResourceOverrideSnapshot, []*placementv1alpha1.ResourceOverrideSnapshot, error)

FetchAllMatchingOverridesForResourceSnapshot fetches all the matching overrides which are attached to the selected resources. TODO: to improve the performance, we can add the index on the placement field of the override snapshots.

func IsClusterMatched

func IsClusterMatched(cluster *clusterv1beta1.MemberCluster, rule placementv1alpha1.OverrideRule) (bool, error)

IsClusterMatched checks if the cluster is matched with the override rules.

func PickFromResourceMatchedOverridesForTargetCluster added in v0.12.0

func PickFromResourceMatchedOverridesForTargetCluster(
	ctx context.Context,
	c client.Client,
	targetCluster string,
	croList []*placementv1alpha1.ClusterResourceOverrideSnapshot,
	roList []*placementv1alpha1.ResourceOverrideSnapshot,
) ([]string, []placementv1beta1.NamespacedName, error)

PickFromResourceMatchedOverridesForTargetCluster filter the overrides that are matched with resources to the target cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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