Skip to content

Commit

Permalink
Explicitly set image pulling policy
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Jul 6, 2023
1 parent 3b19609 commit 526c668
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions service/kubernetes/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ func NewJobService(log mlog.LoggerIFace, cfg JobServiceConfig) (*JobService, err
func (s *JobService) Init(_ job.ServiceConfig) error {
// May be best not to mess with k8s image pulling policy for now.
// It's probably okay for images to be pulled upon first pod execution.
// In the future we may consider executing a dry-run job on start for the purpose of
// preloading the image.
return nil
}

Expand Down Expand Up @@ -183,8 +185,9 @@ func (s *JobService) CreateJob(cfg job.Config, onStopCb job.StopCb) (job.Job, er
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: jobName,
Image: cfg.Runner,
Name: jobName,
Image: cfg.Runner,
ImagePullPolicy: corev1.PullIfNotPresent,
VolumeMounts: []corev1.VolumeMount{
{
Name: jobName,
Expand Down

0 comments on commit 526c668

Please sign in to comment.