Applied comments.

This commit is contained in:
Jerzy Szczepkowski
2015-02-05 20:32:51 +01:00
parent 0010e02148
commit 18c5fa1ae7
4 changed files with 20 additions and 17 deletions

View File

@@ -214,8 +214,8 @@ func (r *Registry) assignPod(ctx api.Context, podID string, machine string) erro
err = r.AtomicUpdate(contKey, &api.BoundPods{}, func(in runtime.Object) (runtime.Object, error) {
boundPodList := in.(*api.BoundPods)
boundPodList.Items = append(boundPodList.Items, *boundPod)
if e := constraint.Allowed(boundPodList.Items); e != nil {
return nil, fmt.Errorf("the assignment would cause the following constraint violation: %v", e)
if errors := constraint.Allowed(boundPodList.Items); len(errors) > 0 {
return nil, fmt.Errorf("the assignment would cause the following constraints violation: %v", errors)
}
return boundPodList, nil
})