diff --git a/Makefile b/Makefile index 447c3db5..705f5c39 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ guest/.tinygo-target.json: scheduler/go.mod build-wat: $(wildcard scheduler/test/testdata/*/*.wat) @for f in $^; do \ wasm=$$(echo $$f | sed -e 's/\.wat/\.wasm/'); \ - wat2wasm $$f -o $$wasm --debug-names $$f; \ + wat2wasm -o $$wasm --debug-names $$f; \ done .PHONY: testdata diff --git a/guest/api/types.go b/guest/api/types.go index 187f9eeb..26accba4 100644 --- a/guest/api/types.go +++ b/guest/api/types.go @@ -67,7 +67,6 @@ type FilterPlugin interface { Filter(state CycleState, pod proto.Pod, nodeInfo NodeInfo) *Status } -// TODO: fix // PostFilterPlugin is a WebAssembly implementation of framework.PostFilterPlugin. type PostFilterPlugin interface { Plugin diff --git a/guest/postfilter/postfilter.go b/guest/postfilter/postfilter.go index ce575ff4..fac6f66a 100644 --- a/guest/postfilter/postfilter.go +++ b/guest/postfilter/postfilter.go @@ -22,7 +22,6 @@ import ( internalpostfilter "sigs.k8s.io/kube-scheduler-wasm-extension/guest/internal/postfilter" ) -// TODO fix explanation // SetPlugin should be called in `main` to assign an api.PostFilterPlugin // instance. // @@ -30,13 +29,13 @@ import ( // // func main() { // plugin := filterPlugin{} -// prefilter.SetPlugin(plugin) +// postfilter.SetPlugin(plugin) // filter.SetPlugin(plugin) // } // // type filterPlugin struct{} // -// func (filterPlugin) PreFilter(state api.CycleState, pod proto.Pod, nodeList proto.NodeList) { +// func (filterPlugin) PostFilter(state api.CycleState, pod proto.Pod, filteredNodeStatusMap internalpostfilter.NodeToStatusMap) (int32, status *api.Status) { // // Write state you need on Filter // } // @@ -46,7 +45,7 @@ import ( // return Filter, nil // } // -// Note: This may be set without filter.SetPlugin, if the pre-filter plugin has +// Note: This may be set without filter.SetPlugin, if the post-filter plugin has // the only filtering logic, or only used to configure api.CycleState. func SetPlugin(postfilterPlugin api.PostFilterPlugin) { internalpostfilter.SetPlugin(postfilterPlugin) diff --git a/guest/prefilter/prefilter.go b/guest/prefilter/prefilter.go index 73db7179..26745fa0 100644 --- a/guest/prefilter/prefilter.go +++ b/guest/prefilter/prefilter.go @@ -35,7 +35,7 @@ import ( // // type filterPlugin struct{} // -// func (filterPlugin) PreFilter(state api.CycleState, pod proto.Pod, nodeList proto.NodeList) { +// func (filterPlugin) PreFilter(state api.CycleState, pod proto.Pod) (nodeNames []string, status *Status) { // // Write state you need on Filter // } //