mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
memory manager: provide memory manager static policy unittests
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
This commit is contained in:
parent
d7175a831c
commit
f7845ed4e9
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,7 @@ limitations under the License.
|
||||
package topologymanager
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
|
||||
"k8s.io/kubernetes/pkg/kubelet/util/format"
|
||||
@ -56,3 +56,21 @@ func (m *fakeManager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAd
|
||||
Admit: true,
|
||||
}
|
||||
}
|
||||
|
||||
type fakeManagerWithHint struct {
|
||||
fakeManager
|
||||
hint *TopologyHint
|
||||
}
|
||||
|
||||
// NewFakeManagerWithHint returns an instance of FakeManager with specified topology hints
|
||||
func NewFakeManagerWithHint(hint *TopologyHint) Manager {
|
||||
return &fakeManagerWithHint{
|
||||
fakeManager: fakeManager{},
|
||||
hint: hint,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *fakeManagerWithHint) GetAffinity(podUID string, containerName string) TopologyHint {
|
||||
klog.Infof("[fake topologymanager] GetAffinity podUID: %v container name: %v", podUID, containerName)
|
||||
return *m.hint
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user