core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByWeight

type ByWeight []*v1alpha1.PlacementPolicy

func (ByWeight) Len

func (a ByWeight) Len() int

func (ByWeight) Less

func (a ByWeight) Less(i, j int) bool

func (ByWeight) Swap

func (a ByWeight) Swap(i, j int)

type Manager

type Manager interface {
	GetPlacementPolicyForPod(context.Context, *corev1.Pod) (*v1alpha1.PlacementPolicy, error)
	GetPodsWithLabels(context.Context, map[string]string) ([]*corev1.Pod, error)
	AnnotatePod(context.Context, *corev1.Pod, *v1alpha1.PlacementPolicy, bool) (*corev1.Pod, error)
	GetPlacementPolicy(context.Context, string, string) (*v1alpha1.PlacementPolicy, error)
}

Manager defines the interfaces for PlacementPolicy management.

type PlacementPolicyManager

type PlacementPolicyManager struct {
	// contains filtered or unexported fields
}

func NewPlacementPolicyManager

func NewPlacementPolicyManager(
	client kubernetes.Interface,
	ppClient ppclientset.Interface,
	snapshotSharedLister framework.SharedLister,
	ppInformer ppinformers.PlacementPolicyInformer,
	podLister corelisters.PodLister) *PlacementPolicyManager

func (*PlacementPolicyManager) AnnotatePod

func (m *PlacementPolicyManager) AnnotatePod(ctx context.Context, pod *corev1.Pod, pp *v1alpha1.PlacementPolicy, preferredNodeWithMatchingLabels bool) (*corev1.Pod, error)

AnnotatePod annotates the pod with the placement policy.

func (*PlacementPolicyManager) GetPlacementPolicy

func (m *PlacementPolicyManager) GetPlacementPolicy(ctx context.Context, namespace, name string) (*v1alpha1.PlacementPolicy, error)

func (*PlacementPolicyManager) GetPlacementPolicyForPod

func (m *PlacementPolicyManager) GetPlacementPolicyForPod(ctx context.Context, pod *corev1.Pod) (*v1alpha1.PlacementPolicy, error)

GetPlacementPolicyForPod returns the placement policy for the given pod

func (*PlacementPolicyManager) GetPodsWithLabels

func (m *PlacementPolicyManager) GetPodsWithLabels(ctx context.Context, podLabels map[string]string) ([]*corev1.Pod, error)

Jump to

Keyboard shortcuts

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