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:
@@ -32,6 +32,7 @@ import (
|
||||
|
||||
"github.com/fission/fission"
|
||||
"github.com/fission/fission/crd"
|
||||
fetcherConfig "github.com/fission/fission/environments/fetcher/config"
|
||||
"github.com/fission/fission/executor/fscache"
|
||||
"github.com/fission/fission/executor/newdeploy"
|
||||
"github.com/fission/fission/executor/poolmgr"
|
||||
@@ -214,6 +215,11 @@ func StartExecutor(logger *zap.Logger, fissionNamespace string, functionNamespac
|
||||
return errors.Wrap(err, "error waiting for CRDs")
|
||||
}
|
||||
|
||||
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Error making fetcher config")
|
||||
}
|
||||
|
||||
restClient := fissionClient.GetCrdClient()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to get kubernetes client")
|
||||
@@ -228,12 +234,12 @@ func StartExecutor(logger *zap.Logger, fissionNamespace string, functionNamespac
|
||||
gpm := poolmgr.MakeGenericPoolManager(
|
||||
logger,
|
||||
fissionClient, kubernetesClient,
|
||||
functionNamespace, poolID)
|
||||
functionNamespace, fetcherConfig, poolID)
|
||||
|
||||
ndm := newdeploy.MakeNewDeploy(
|
||||
logger,
|
||||
fissionClient, kubernetesClient, restClient,
|
||||
functionNamespace, poolID)
|
||||
functionNamespace, fetcherConfig, poolID)
|
||||
|
||||
api := MakeExecutor(logger, gpm, ndm, fissionClient, fsCache)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user