Listing available algorithm providers in scheduler

List the available algorithm providers with 'kube-scheduler --help' under field `algorithm_provider`
This commit is contained in:
dingh
2015-04-17 14:22:07 +08:00
parent d84393cb08
commit 71b98840c8
2 changed files with 11 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ package factory
import (
"fmt"
"regexp"
"strings"
"sync"
algorithm "github.com/GoogleCloudPlatform/kubernetes/pkg/scheduler"
@@ -300,3 +301,12 @@ func validatePriorityOrDie(priority schedulerapi.PriorityPolicy) {
}
}
}
// ListAlgorithmProviders is called when listing all available algortihm providers in `kube-scheduler --help`
func ListAlgorithmProviders() string {
var availableAlgorithmProviders []string
for name := range algorithmProviderMap {
availableAlgorithmProviders = append(availableAlgorithmProviders, name)
}
return strings.Join(availableAlgorithmProviders, " | ")
}