Update Remove/AddPod to Container (#26)

More intuitive TopologyHints
This commit is contained in:
Conor Nolan 2019-05-10 11:58:21 +01:00 committed by lmdaly
parent e64c558a11
commit d99bac12e6
2 changed files with 8 additions and 10 deletions

View File

@ -25,5 +25,5 @@ type Policy interface {
//Returns Policy Name
Name() string
//Returns Pod Admit Handler Response based on hints and policy type
CanAdmitPodResult(result TopologyHints) lifecycle.PodAdmitResult
CanAdmitPodResult(admit bool) lifecycle.PodAdmitResult
}

View File

@ -30,26 +30,24 @@ type Manager interface {
//wants to be consoluted when making topology hints
AddHintProvider(HintProvider)
//Adds pod to Manager for tracking
AddPod(pod *v1.Pod, containerID string) error
AddContainer(pod *v1.Pod, containerID string) error
//Removes pod from Manager tracking
RemovePod(containerID string) error
RemoveContainer(containerID string) error
//Interface for storing pod topology hints
Store
}
//HintProvider interface is to be implemented by Hint Providers
type HintProvider interface {
GetTopologyHints(pod v1.Pod, container v1.Container) TopologyHints
GetTopologyHints(pod v1.Pod, container v1.Container) ([]TopologyHint, bool)
}
//Store interface is to allow Hint Providers to retrieve pod affinity
type Store interface {
GetAffinity(podUID string, containerName string) TopologyHints
GetAffinity(podUID string, containerName string) TopologyHint
}
//TopologyHints is a struct containing Sokcet Affinity for a Pod
//and whether Affinity is true or false
type TopologyHints struct {
SocketAffinity []socketmask.SocketMask
Affinity bool
// TopologyHint is a struct containing Socket Mask for a Pod
type TopologyHint struct {
SocketAffinity socketmask.SocketMask
}