Fix builder & newdeploy not using latest image during CI build (#1033)
This commit is contained in:
@@ -249,7 +249,7 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *crd.Function, env *crd.Environmen
|
||||
fission.MergeContainerSpecs(&apiv1.Container{
|
||||
Name: fn.Metadata.Name,
|
||||
Image: env.Spec.Runtime.Image,
|
||||
ImagePullPolicy: apiv1.PullIfNotPresent,
|
||||
ImagePullPolicy: deploy.runtimeImagePullPolicy,
|
||||
TerminationMessagePath: "/dev/termination-log",
|
||||
VolumeMounts: []apiv1.VolumeMount{
|
||||
{
|
||||
|
||||
@@ -52,6 +52,7 @@ type (
|
||||
|
||||
fetcherImg string
|
||||
fetcherImagePullPolicy apiv1.PullPolicy
|
||||
runtimeImagePullPolicy apiv1.PullPolicy
|
||||
namespace string
|
||||
sharedMountPath string
|
||||
sharedSecretPath string
|
||||
@@ -125,17 +126,19 @@ func MakeNewDeploy(
|
||||
namespace: namespace,
|
||||
fsCache: fsCache,
|
||||
|
||||
fetcherImg: fetcherImg,
|
||||
fetcherImagePullPolicy: apiv1.PullIfNotPresent,
|
||||
sharedMountPath: "/userfunc",
|
||||
sharedSecretPath: "/secrets",
|
||||
sharedCfgMapPath: "/configs",
|
||||
useIstio: enableIstio,
|
||||
fetcherImg: fetcherImg,
|
||||
sharedMountPath: "/userfunc",
|
||||
sharedSecretPath: "/secrets",
|
||||
sharedCfgMapPath: "/configs",
|
||||
useIstio: enableIstio,
|
||||
|
||||
requestChannel: make(chan *fnRequest),
|
||||
idlePodReapTime: 2 * time.Minute,
|
||||
}
|
||||
|
||||
nd.runtimeImagePullPolicy = fission.GetImagePullPolicy(os.Getenv("RUNTIME_IMAGE_PULL_POLICY"))
|
||||
nd.fetcherImagePullPolicy = fission.GetImagePullPolicy(os.Getenv("FETCHER_IMAGE_PULL_POLICY"))
|
||||
|
||||
if nd.crdClient != nil {
|
||||
fnStore, fnController := nd.initFuncController()
|
||||
nd.funcStore = fnStore
|
||||
|
||||
+2
-21
@@ -84,17 +84,6 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func getImagePullPolicy(policy string) apiv1.PullPolicy {
|
||||
switch policy {
|
||||
case "Always":
|
||||
return apiv1.PullAlways
|
||||
case "Never":
|
||||
return apiv1.PullNever
|
||||
default:
|
||||
return apiv1.PullIfNotPresent
|
||||
}
|
||||
}
|
||||
|
||||
func MakeGenericPool(
|
||||
fissionClient *crd.FissionClient,
|
||||
kubernetesClient *kubernetes.Clientset,
|
||||
@@ -112,14 +101,6 @@ func MakeGenericPool(
|
||||
if len(fetcherImage) == 0 {
|
||||
fetcherImage = "fission/fetcher"
|
||||
}
|
||||
fetcherImagePullPolicy := os.Getenv("FETCHER_IMAGE_PULL_POLICY")
|
||||
if len(fetcherImagePullPolicy) == 0 {
|
||||
fetcherImagePullPolicy = "IfNotPresent"
|
||||
}
|
||||
runtimeImagePullPolicy := os.Getenv("RUNTIME_IMAGE_PULL_POLICY")
|
||||
if len(runtimeImagePullPolicy) == 0 {
|
||||
runtimeImagePullPolicy = "IfNotPresent"
|
||||
}
|
||||
|
||||
// TODO: in general we need to provide the user a way to configure pools. Initial
|
||||
// replicas, autoscaling params, various timeouts, etc.
|
||||
@@ -144,9 +125,9 @@ func MakeGenericPool(
|
||||
sharedCfgMapPath: "/configs",
|
||||
}
|
||||
|
||||
gp.runtimeImagePullPolicy = getImagePullPolicy(runtimeImagePullPolicy)
|
||||
gp.runtimeImagePullPolicy = fission.GetImagePullPolicy(os.Getenv("RUNTIME_IMAGE_PULL_POLICY"))
|
||||
gp.fetcherImagePullPolicy = fission.GetImagePullPolicy(os.Getenv("FETCHER_IMAGE_PULL_POLICY"))
|
||||
|
||||
gp.fetcherImagePullPolicy = getImagePullPolicy(fetcherImagePullPolicy)
|
||||
log.Printf("fetcher image: %v, pull policy: %v", gp.fetcherImage, gp.fetcherImagePullPolicy)
|
||||
|
||||
// create fetcher SA in this ns, if not already created
|
||||
|
||||
Reference in New Issue
Block a user