mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
Add hint to fake topology manager.
This commit is contained in:
@@ -17,12 +17,14 @@ 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"
|
||||
)
|
||||
|
||||
type fakeManager struct{}
|
||||
type fakeManager struct {
|
||||
hint *TopologyHint
|
||||
}
|
||||
|
||||
//NewFakeManager returns an instance of FakeManager
|
||||
func NewFakeManager() Manager {
|
||||
@@ -30,9 +32,21 @@ func NewFakeManager() Manager {
|
||||
return &fakeManager{}
|
||||
}
|
||||
|
||||
// NewFakeManagerWithHint returns an instance of fake topology manager with specified topology hints
|
||||
func NewFakeManagerWithHint(hint *TopologyHint) Manager {
|
||||
klog.InfoS("NewFakeManagerWithHint")
|
||||
return &fakeManager{
|
||||
hint: hint,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *fakeManager) GetAffinity(podUID string, containerName string) TopologyHint {
|
||||
klog.InfoS("GetAffinity", "podUID", podUID, "containerName", containerName)
|
||||
return TopologyHint{}
|
||||
if m.hint == nil {
|
||||
return TopologyHint{}
|
||||
}
|
||||
|
||||
return *m.hint
|
||||
}
|
||||
|
||||
func (m *fakeManager) AddHintProvider(h HintProvider) {
|
||||
|
Reference in New Issue
Block a user