-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update scheduler logic regarding terminator extenders (#489)
Signed-off-by: Mikhail Scherba <mikhail.scherba@flant.com>
- Loading branch information
Showing
6 changed files
with
434 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
pkg/module_manager/scheduler/extenders/mock/extenders_mock.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// a bunch of mocked extenders for tests | ||
package extenders_mock | ||
|
||
import "github.com/flant/addon-operator/pkg/module_manager/scheduler/extenders" | ||
|
||
type FilterOne struct{} | ||
|
||
func (f *FilterOne) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("FilterOne") | ||
} | ||
|
||
func (f *FilterOne) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *FilterOne) IsTerminator() bool { | ||
return false | ||
} | ||
|
||
type FilterTwo struct{} | ||
|
||
func (f *FilterTwo) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("FilterTwo") | ||
} | ||
|
||
func (f *FilterTwo) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *FilterTwo) IsTerminator() bool { | ||
return false | ||
} | ||
|
||
type FilterThree struct{} | ||
|
||
func (f *FilterThree) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("FilterThree") | ||
} | ||
|
||
func (f *FilterThree) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *FilterThree) IsTerminator() bool { | ||
return false | ||
} | ||
|
||
type FilterFour struct{} | ||
|
||
func (f *FilterFour) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("FilterOne") | ||
} | ||
|
||
func (f *FilterFour) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *FilterFour) IsTerminator() bool { | ||
return false | ||
} | ||
|
||
type TerminatorOne struct{} | ||
|
||
func (f *TerminatorOne) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("TerminatorOne") | ||
} | ||
|
||
func (f *TerminatorOne) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *TerminatorOne) IsTerminator() bool { | ||
return true | ||
} | ||
|
||
type TerminatorTwo struct{} | ||
|
||
func (f *TerminatorTwo) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("TerminatorTwo") | ||
} | ||
|
||
func (f *TerminatorTwo) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *TerminatorTwo) IsTerminator() bool { | ||
return true | ||
} | ||
|
||
type TerminatorThree struct{} | ||
|
||
func (f *TerminatorThree) Name() extenders.ExtenderName { | ||
return extenders.ExtenderName("TerminatorThree") | ||
} | ||
|
||
func (f *TerminatorThree) Filter(_ string, _ map[string]string) (*bool, error) { | ||
return nil, nil | ||
} | ||
|
||
func (f *TerminatorThree) IsTerminator() bool { | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.