Remove retries from poolmgr eagerPoolCreator

This was initially added to avoid restarts if poolmgr starts before
fission api; but we don't really need that since k8s will restart
it. Also, poolmgr now talks to the k8s api directly instead of the
fission api.
This commit is contained in:
Soam Vasani
2017-08-09 22:37:55 -07:00
parent 7d83f5713a
commit 42261d8810
+1 -6
View File
@@ -137,8 +137,6 @@ func (gpm *GenericPoolManager) CleanupPools(envs []tpr.Environment) {
} }
func (gpm *GenericPoolManager) eagerPoolCreator() { func (gpm *GenericPoolManager) eagerPoolCreator() {
failureCount := 0
maxFailures := 5
pollSleep := time.Duration(2 * time.Second) pollSleep := time.Duration(2 * time.Second)
for { for {
time.Sleep(pollSleep) time.Sleep(pollSleep)
@@ -146,10 +144,7 @@ func (gpm *GenericPoolManager) eagerPoolCreator() {
// get list of envs from controller // get list of envs from controller
envs, err := gpm.fissionClient.Environments(api.NamespaceAll).List(api.ListOptions{}) envs, err := gpm.fissionClient.Environments(api.NamespaceAll).List(api.ListOptions{})
if err != nil { if err != nil {
failureCount++ log.Fatalf("Failed to get environment list: %v", err)
if failureCount >= maxFailures {
log.Fatalf("Failed %v times: %v", maxFailures, err)
}
} }
// Create pools for all envs. TODO: we should make this a bit less eager, only // Create pools for all envs. TODO: we should make this a bit less eager, only