From d99bac12e6d7e569c078692da057c2f0a6872433 Mon Sep 17 00:00:00 2001 From: Conor Nolan Date: Fri, 10 May 2019 11:58:21 +0100 Subject: [PATCH] Update Remove/AddPod to Container (#26) More intuitive TopologyHints --- pkg/kubelet/cm/topologymanager/policy.go | 2 +- .../cm/topologymanager/topology_manager.go | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/kubelet/cm/topologymanager/policy.go b/pkg/kubelet/cm/topologymanager/policy.go index 5b9208c7072..ac5bfa443e7 100644 --- a/pkg/kubelet/cm/topologymanager/policy.go +++ b/pkg/kubelet/cm/topologymanager/policy.go @@ -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 } diff --git a/pkg/kubelet/cm/topologymanager/topology_manager.go b/pkg/kubelet/cm/topologymanager/topology_manager.go index b79254b07f9..8c1cf9fb799 100644 --- a/pkg/kubelet/cm/topologymanager/topology_manager.go +++ b/pkg/kubelet/cm/topologymanager/topology_manager.go @@ -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 }