Skip to content

Commit

Permalink
Merge pull request #63 from mauricio-sardinas/master
Browse files Browse the repository at this point in the history
reduce job restarts and pull images
  • Loading branch information
zzxwill authored Jul 16, 2021
2 parents ec6859d + a855e4d commit 63d9f92
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions controllers/configuration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ func assembleTerraformJob(name, jobName string, configuration *v1beta1.Configura
envs []v1.EnvVar, executionType TerraformExecutionType) *batchv1.Job {
var parallelism int32 = 1
var completions int32 = 1
var ttlSecondsAfterFinished int32 = 0

initContainerVolumeMounts := []v1.VolumeMount{
{
Expand Down Expand Up @@ -334,8 +333,6 @@ func assembleTerraformJob(name, jobName string, configuration *v1beta1.Configura
}},
},
Spec: batchv1.JobSpec{
// TODO(zzxwill) Not enabled in Kubernetes cluster lower than v1.21
TTLSecondsAfterFinished: &ttlSecondsAfterFinished,
Parallelism: &parallelism,
Completions: &completions,
Template: v1.PodTemplateSpec{
Expand All @@ -345,7 +342,7 @@ func assembleTerraformJob(name, jobName string, configuration *v1beta1.Configura
InitContainers: []v1.Container{{
Name: "prepare-input-terraform-configurations",
Image: terraformInitContainerImg,
ImagePullPolicy: v1.PullAlways,
ImagePullPolicy: v1.PullIfNotPresent,
Command: []string{
"sh",
"-c",
Expand All @@ -358,7 +355,7 @@ func assembleTerraformJob(name, jobName string, configuration *v1beta1.Configura
Containers: []v1.Container{{
Name: "terraform-executor",
Image: terraformImage,
ImagePullPolicy: v1.PullAlways,
ImagePullPolicy: v1.PullIfNotPresent,
Command: []string{
"bash",
"-c",
Expand Down

0 comments on commit 63d9f92

Please sign in to comment.