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

@@ -24,9 +24,10 @@ import (
// Allowed returns true if pods is a collection of bound pods
// which can run without conflict on a single minion.
func Allowed(pods []api.BoundPod) error {
if PortsConflict(pods) {
return fmt.Errorf("conflicting ports")
func Allowed(pods []api.BoundPod) []error {
errors := []error{}
for _, port := range hostPortsConflict(pods) {
errors = append(errors, fmt.Errorf("host port %v is already in use", port))
}
return nil
return errors
}