Fix builder & newdeploy not using latest image during CI build (#1033)

This commit is contained in:
Ta-Ching Chen
2018-12-19 22:35:28 +08:00
committed by GitHub
parent 34b9be0bd3
commit 0a135173b4
7 changed files with 34 additions and 44 deletions
+2 -21
View File
@@ -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