diff --git a/pkg/scheduler/framework/interface.go b/pkg/scheduler/framework/interface.go index 1ad31c8e96e..30887a12ad6 100644 --- a/pkg/scheduler/framework/interface.go +++ b/pkg/scheduler/framework/interface.go @@ -73,6 +73,7 @@ type PluginScore struct { type Code int // These are predefined codes used in a Status. +// Note: when you add a new status, you have to add it in `codes` slice below. const ( // Success means that plugin ran correctly and found pod schedulable. // NOTE: A nil status is also considered as "Success". diff --git a/pkg/scheduler/framework/interface_test.go b/pkg/scheduler/framework/interface_test.go index a3b6a31fcc0..05e603484b6 100644 --- a/pkg/scheduler/framework/interface_test.go +++ b/pkg/scheduler/framework/interface_test.go @@ -123,23 +123,6 @@ func TestStatus(t *testing.T) { } } -// The String() method relies on the value and order of the status codes to function properly. -func TestStatusCodes(t *testing.T) { - assertStatusCode(t, Success, 0) - assertStatusCode(t, Error, 1) - assertStatusCode(t, Unschedulable, 2) - assertStatusCode(t, UnschedulableAndUnresolvable, 3) - assertStatusCode(t, Wait, 4) - assertStatusCode(t, Skip, 5) - assertStatusCode(t, Pending, 6) -} - -func assertStatusCode(t *testing.T, code Code, value int) { - if int(code) != value { - t.Errorf("Status code %q should have a value of %v but got %v", code.String(), value, int(code)) - } -} - func TestPreFilterResultMerge(t *testing.T) { tests := map[string]struct { receiver *PreFilterResult