From 79ef89b7605ff5ddd4d51c1397e25f65713a9918 Mon Sep 17 00:00:00 2001 From: chansuke Date: Sun, 3 Nov 2024 12:53:08 +0900 Subject: [PATCH] Remove unused methods --- scheduler/plugin/host_test.go | 43 ----------------------------------- 1 file changed, 43 deletions(-) diff --git a/scheduler/plugin/host_test.go b/scheduler/plugin/host_test.go index 894d4c3..c2cd949 100644 --- a/scheduler/plugin/host_test.go +++ b/scheduler/plugin/host_test.go @@ -19,16 +19,12 @@ package wasm import ( "bytes" "context" - "sync" "testing" - "time" "github.com/tetratelabs/wazero/experimental/wazerotest" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" k8stest "k8s.io/klog/v2/test" - "k8s.io/kubernetes/pkg/scheduler/framework" "sigs.k8s.io/kube-scheduler-wasm-extension/scheduler/test" ) @@ -99,45 +95,6 @@ func initKlog(t *testing.T, buf *bytes.Buffer) { klog.SetOutput(buf) } -type waitingPod struct { - pod *v1.Pod - pendingPlugins map[string]*time.Timer - s chan *framework.Status - mu sync.RWMutex -} - -func (wp *waitingPod) GetPod() *v1.Pod { - return wp.pod -} - -func (wp *waitingPod) GetPendingPlugins() []string { - wp.mu.RLock() - defer wp.mu.RUnlock() - var plugins []string - for plugin := range wp.pendingPlugins { - plugins = append(plugins, plugin) - } - return plugins -} - -func (wp *waitingPod) Allow(pluginName string) { - wp.mu.Lock() - defer wp.mu.Unlock() - if timer, ok := wp.pendingPlugins[pluginName]; ok { - timer.Stop() - delete(wp.pendingPlugins, pluginName) - } -} - -func (wp *waitingPod) Reject(pluginName, msg string) { - wp.mu.Lock() - defer wp.mu.Unlock() - if timer, ok := wp.pendingPlugins[pluginName]; ok { - timer.Stop() - delete(wp.pendingPlugins, pluginName) - } -} - func Test_k8sHandleGetWaitingPodFn(t *testing.T) { recorder := &test.FakeRecorder{EventMsg: ""} handle := &test.FakeHandle{Recorder: recorder}