Skip to content

Commit

Permalink
Report gitjob failure after two tries
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Sep 24, 2020
1 parent 5084b40 commit a2a6bad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controllers/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
two = int32(2)
)

func Register(ctx context.Context,
mapper meta.RESTMapper,
apply apply.Apply,
Expand Down Expand Up @@ -372,6 +376,7 @@ func (h *handler) OnChange(gitrepo *fleet.GitRepo, status fleet.GitRepoStatus) (
Branch: branch,
},
JobSpec: batchv1.JobSpec{
BackoffLimit: &two,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
CreationTimestamp: metav1.Time{Time: time.Unix(0, 0)},
Expand Down

0 comments on commit a2a6bad

Please sign in to comment.