Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "ClusterLocality"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterLocality ¶
type ClusterLocality struct{}
ClusterLocality is a score plugin that favors cluster that already have the resource.
func (*ClusterLocality) Name ¶
func (p *ClusterLocality) Name() string
Name returns the plugin name.
func (*ClusterLocality) Score ¶
func (p *ClusterLocality) Score(_ context.Context, spec *workv1alpha2.ResourceBindingSpec, cluster *clusterv1alpha1.Cluster) (int64, *framework.Result)
Score calculates the score on the candidate cluster. If the cluster already have the resource(exists in .spec.Clusters of ResourceBinding or ClusterResourceBinding), then score is 100, otherwise 0.
func (*ClusterLocality) ScoreExtensions ¶
func (p *ClusterLocality) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
Click to show internal directories.
Click to hide internal directories.