Remove synchronous assignPod call from create pod

This commit is contained in:
Daniel Smith
2014-08-19 16:41:51 -07:00
parent 3af9655c36
commit 29e9e13188
6 changed files with 64 additions and 65 deletions

View File

@@ -25,10 +25,9 @@ import (
)
type PodRegistry struct {
Err error
Machine string
Pod *api.Pod
Pods []api.Pod
Err error
Pod *api.Pod
Pods []api.Pod
sync.Mutex
mux *watch.Mux
@@ -66,10 +65,9 @@ func (r *PodRegistry) GetPod(podId string) (*api.Pod, error) {
return r.Pod, r.Err
}
func (r *PodRegistry) CreatePod(machine string, pod api.Pod) error {
func (r *PodRegistry) CreatePod(pod api.Pod) error {
r.Lock()
defer r.Unlock()
r.Machine = machine
r.Pod = &pod
r.mux.Action(watch.Added, &pod)
return r.Err