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
+12
View File
@@ -184,3 +184,15 @@ func RemoveZeroBytes(src []byte) []byte {
}
return bs
}
// GetImagePullPolicy returns the image pull policy base on the input value.
func GetImagePullPolicy(policy string) apiv1.PullPolicy {
switch policy {
case "Always":
return apiv1.PullAlways
case "Never":
return apiv1.PullNever
default:
return apiv1.PullIfNotPresent
}
}