Documentation
¶
Index ¶
Constants ¶
const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "WorkloadAffinity"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WorkloadAffinity ¶
type WorkloadAffinity struct{}
WorkloadAffinity is a plugin that checks if a cluster matches the workload affinity group constraint. It ensures workloads in the same affinity group are scheduled to the same cluster.
func (*WorkloadAffinity) Filter ¶
func (p *WorkloadAffinity) Filter(context.Context, *workv1alpha2.ResourceBindingSpec, *workv1alpha2.ResourceBindingStatus, *clusterv1alpha1.Cluster) *framework.Result
Filter implements FilterPlugin interface for backward compatibility. TODO(@RainbowMango): Reconsider the plugin architecture to avoid requiring new plugins to implement this interface. This method should never be called as the framework will use FilterWithContext when available.
func (*WorkloadAffinity) FilterWithContext ¶
func (p *WorkloadAffinity) FilterWithContext(filterCtx *framework.FilterContext) *framework.Result
FilterWithContext checks if the cluster matches the workload affinity group constraint. It only implements the new FilterWithContext interface and does not implement the old Filter interface. If the binding has a workload affinity group specified, it ensures the cluster is selected only if it matches the affinity group criteria (same cluster as other workloads in the group).
func (*WorkloadAffinity) Name ¶
func (p *WorkloadAffinity) Name() string
Name returns the plugin name.