Add ctx to registry interfaces

This commit is contained in:
derekwaynecarr
2014-09-26 15:18:42 -04:00
parent f377d3eba8
commit 09365fed8d
13 changed files with 81 additions and 81 deletions

View File

@@ -24,5 +24,5 @@ import (
type Registry interface {
// ApplyBinding should apply the binding. That is, it should actually
// assign or place pod binding.PodID on machine binding.Host.
ApplyBinding(binding *api.Binding) error
ApplyBinding(ctx api.Context, binding *api.Binding) error
}

View File

@@ -67,7 +67,7 @@ func (b *REST) Create(ctx api.Context, obj runtime.Object) (<-chan runtime.Objec
return nil, fmt.Errorf("incorrect type: %#v", obj)
}
return apiserver.MakeAsync(func() (runtime.Object, error) {
if err := b.registry.ApplyBinding(binding); err != nil {
if err := b.registry.ApplyBinding(ctx, binding); err != nil {
return nil, err
}
return &api.Status{Status: api.StatusSuccess}, nil