Documentation ¶
Index ¶
- type ClusterGroupsMap
- type GroupKey
- type PlacementDecisionClustersTracker
- func NewPlacementDecisionClustersTracker(placement *clusterv1beta1.Placement, pdl PlacementDecisionGetter, ...) *PlacementDecisionClustersTracker
- func NewPlacementDecisionClustersTrackerWithGroups(placement *clusterv1beta1.Placement, pdl PlacementDecisionGetter, ...) *PlacementDecisionClustersTracker
- func (pdct *PlacementDecisionClustersTracker) ExistingClusterGroups(groupKeys ...GroupKey) ClusterGroupsMap
- func (pdct *PlacementDecisionClustersTracker) ExistingClusterGroupsBesides(groupKeys ...GroupKey) ClusterGroupsMap
- func (pdct *PlacementDecisionClustersTracker) GetClusterChanges() (sets.Set[string], sets.Set[string], error)
- func (pdct *PlacementDecisionClustersTracker) Refresh() error
- type PlacementDecisionGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterGroupsMap ¶
ClusterGroupsMap is a custom type representing a map of group keys to sets of cluster names.
func (ClusterGroupsMap) ClusterToGroupKey ¶
func (g ClusterGroupsMap) ClusterToGroupKey() map[string]GroupKey
ClusterToGroupKey returns a mapping of cluster names to their respective group keys.
func (ClusterGroupsMap) GetClusters ¶
func (g ClusterGroupsMap) GetClusters() sets.Set[string]
GetClusters returns a set containing all clusters from all group sets.
func (ClusterGroupsMap) GetOrderedGroupKeys ¶
func (g ClusterGroupsMap) GetOrderedGroupKeys() []GroupKey
GetOrderedGroupKeys returns an ordered slice of GroupKeys, sorted by group index.
type PlacementDecisionClustersTracker ¶
type PlacementDecisionClustersTracker struct {
// contains filtered or unexported fields
}
func NewPlacementDecisionClustersTracker ¶
func NewPlacementDecisionClustersTracker(placement *clusterv1beta1.Placement, pdl PlacementDecisionGetter, existingScheduledClusters sets.Set[string]) *PlacementDecisionClustersTracker
NewPlacementDecisionClustersTracker initializes a PlacementDecisionClustersTracker using existing clusters. Clusters are added to the default cluster group with index 0. Set existingScheduledClusters to nil if there are no existing clusters.
func NewPlacementDecisionClustersTrackerWithGroups ¶
func NewPlacementDecisionClustersTrackerWithGroups(placement *clusterv1beta1.Placement, pdl PlacementDecisionGetter, existingScheduledClusterGroups ClusterGroupsMap) *PlacementDecisionClustersTracker
NewPlacementDecisionClustersTrackerWithGroups initializes a PlacementDecisionClustersTracker using existing cluster groups. Set existingScheduledClusterGroups to nil if no groups exist.
func (*PlacementDecisionClustersTracker) ExistingClusterGroups ¶
func (pdct *PlacementDecisionClustersTracker) ExistingClusterGroups(groupKeys ...GroupKey) ClusterGroupsMap
ExistingClusterGroups returns the tracker's existing decision cluster groups for groups listed in groupKeys. Return empty set when groupKeys is empty.
func (*PlacementDecisionClustersTracker) ExistingClusterGroupsBesides ¶
func (pdct *PlacementDecisionClustersTracker) ExistingClusterGroupsBesides(groupKeys ...GroupKey) ClusterGroupsMap
ExistingClusterGroupsBesides returns the tracker's existing decision cluster groups except cluster groups listed in groupKeys. Return all the clusters when groupKeys is empty.
func (*PlacementDecisionClustersTracker) GetClusterChanges ¶
func (pdct *PlacementDecisionClustersTracker) GetClusterChanges() (sets.Set[string], sets.Set[string], error)
GetClusterChanges updates the tracker's decisionClusters and returns added and deleted cluster names.
func (*PlacementDecisionClustersTracker) Refresh ¶
func (pdct *PlacementDecisionClustersTracker) Refresh() error
Refresh refreshes the tracker's decisionClusters.
type PlacementDecisionGetter ¶
type PlacementDecisionGetter interface {
List(selector labels.Selector, namespace string) (ret []*clusterv1beta1.PlacementDecision, err error)
}