Re-added SHUFFLE_BASE_IMAGE_NAME usage, and made REGISTRY+BASE IMAGE setting ensure that PullAlways is used to always use latest local image

This commit is contained in:
Frikky
2025-09-16 16:00:47 +02:00
parent fc9c01abbb
commit 5da98c1d0c
2 changed files with 25 additions and 6 deletions
+8
View File
@@ -662,6 +662,14 @@ func deployk8sApp(image string, identifier string, env []string) error {
},
}
if len(os.Getenv("REGISTRY_URL")) > 0 && len(os.Getenv("SHUFFLE_BASE_IMAGE_NAME")) > 0 {
log.Printf("[INFO] Setting image pull policy to Always as private registry is used.")
//containerAttachment.ImagePullPolicy = corev1.PullAlways
deployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = corev1.PullAlways
} else {
deployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = corev1.PullIfNotPresent
}
_, err = clientset.AppsV1().Deployments(kubernetesNamespace).Create(context.Background(), deployment, metav1.CreateOptions{})
if err != nil {
log.Printf("[ERROR] Failed creating deployment: %v", err)