DRY up fetcher configuration (#1168)

Consolidates the addition of the fetcher container to the pod into a new type FetcherConfig and takes care of serviceAccountName if not set. Also added PreStop lifecycle handler if pod set TerminationGracePeriodSeconds
This commit is contained in:
Vishal
2019-05-02 21:39:42 +05:30
committed by GitHub
parent 23f3585245
commit c88033fc0b
13 changed files with 396 additions and 483 deletions
+7 -1
View File
@@ -21,6 +21,7 @@ import (
"go.uber.org/zap"
"github.com/fission/fission/crd"
fetcherConfig "github.com/fission/fission/environments/fetcher/config"
)
// Start the buildermgr service.
@@ -37,7 +38,12 @@ func Start(logger *zap.Logger, storageSvcUrl string, envBuilderNamespace string)
return errors.Wrap(err, "error waiting for CRDs")
}
envWatcher := makeEnvironmentWatcher(bmLogger, fissionClient, kubernetesClient, envBuilderNamespace)
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/packages")
if err != nil {
return errors.Wrap(err, "error making fetcher config")
}
envWatcher := makeEnvironmentWatcher(bmLogger, fissionClient, kubernetesClient, fetcherConfig, envBuilderNamespace)
go envWatcher.watchEnvironments()
pkgWatcher := makePackageWatcher(bmLogger, fissionClient,