Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/resources/jobs/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func NewStarterJob(k6 *v1alpha1.TestRun, hostname []string) *batchv1.Job {
resourceRequirements = k6.GetSpec().Starter.Resources
}

var zero32 int32

return &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-starter", k6.NamespacedName().Name),
Expand All @@ -70,6 +72,7 @@ func NewStarterJob(k6 *v1alpha1.TestRun, hostname []string) *batchv1.Job {
Annotations: starterAnnotations,
},
Spec: batchv1.JobSpec{
BackoffLimit: &zero32,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: starterLabels,
Expand Down
4 changes: 4 additions & 0 deletions pkg/resources/jobs/starter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
func TestNewStarterJob(t *testing.T) {

automountServiceAccountToken := true
zero := int32(0)

expectedOutcome := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -30,6 +31,7 @@ func TestNewStarterJob(t *testing.T) {
},
},
Spec: batchv1.JobSpec{
BackoffLimit: &zero,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand Down Expand Up @@ -106,6 +108,7 @@ func TestNewStarterJob(t *testing.T) {
func TestNewStarterJobIstio(t *testing.T) {

automountServiceAccountToken := true
zero := int32(0)

expectedOutcome := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -121,6 +124,7 @@ func TestNewStarterJobIstio(t *testing.T) {
},
},
Spec: batchv1.JobSpec{
BackoffLimit: &zero,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand Down
4 changes: 4 additions & 0 deletions pkg/resources/jobs/stopper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func TestNewStopperJob(t *testing.T) {
automountServiceAccountToken := true
zero := int32(0)

expectedOutcome := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -28,6 +29,7 @@ func TestNewStopperJob(t *testing.T) {
},
},
Spec: batchv1.JobSpec{
BackoffLimit: &zero,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand Down Expand Up @@ -93,6 +95,7 @@ func TestNewStopperJob(t *testing.T) {

func TestNewStopJobIstio(t *testing.T) {
automountServiceAccountToken := true
zero := int32(0)

expectedOutcome := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -108,6 +111,7 @@ func TestNewStopJobIstio(t *testing.T) {
},
},
Spec: batchv1.JobSpec{
BackoffLimit: &zero,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand Down