feat(scheduler): use context in the scheduler package

+ Use context instead of stopCh
+ Add context to the scheduling framework interface
This commit is contained in:
draveness
2019-08-28 19:12:02 +08:00
parent f7091992c0
commit 47a6c5b693
42 changed files with 426 additions and 352 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package prebind
import (
"context"
"fmt"
v1 "k8s.io/api/core/v1"
@@ -39,7 +40,7 @@ func (sr StatelessPreBindExample) Name() string {
}
// PreBind is the functions invoked by the framework at "prebind" extension point.
func (sr StatelessPreBindExample) PreBind(state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status {
func (sr StatelessPreBindExample) PreBind(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status {
if pod == nil {
return framework.NewStatus(framework.Error, fmt.Sprintf("pod cannot be nil"))
}