Skip to content

Commit

Permalink
added ttl value
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDieckmann committed Feb 12, 2021
1 parent e5cff59 commit 1c25902
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scheduler/startJob.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const JOBTTL = 100

func createBaseJobConf(
id string,
namespace string,
Expand Down Expand Up @@ -50,12 +52,17 @@ func createBaseJobConf(
resourceRequests[v1.ResourceCPU] = cpuQuantity
resourceRequests[v1.ResourceMemory] = memoryQuantity

//Required to convert const to int32 ref
var TmpTTLValue int32
TmpTTLValue = JOBTTL

job := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("bakta-job-%v", id),
Namespace: namespace,
},
Spec: batchv1.JobSpec{
TTLSecondsAfterFinished: &TmpTTLValue,
Template: v1.PodTemplateSpec{
Spec: v1.PodSpec{
RestartPolicy: "Never",
Expand Down

0 comments on commit 1c25902

Please sign in to comment.