v1beta1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterGroupsMap

type ClusterGroupsMap map[GroupKey]sets.Set[string]

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 GroupKey

type GroupKey struct {
	GroupName  string `json:"groupName,omitempty"`
	GroupIndex int32  `json:"groupIndex,omitempty"`
}

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)
}

Jump to

Keyboard shortcuts

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