Skip to content

Commit

Permalink
UPSTREAM: 122643: Add a new neverTerminate job behavior just for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
soltysh committed Jan 8, 2024
1 parent e74ad97 commit 8a930ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/e2e/framework/job/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func NewTestJobOnNode(behavior, name string, rPol v1.RestartPolicy, parallelism,
}
}
switch behavior {
case "neverTerminate":
// this job is being used in an upgrade job see test/e2e/upgrades/apps/job.go
// it should never be optimized, as it always has to restart during an upgrade
// and continue running
job.Spec.Template.Spec.Containers[0].Command = []string{"sleep", "1000000"}
case "notTerminate":
job.Spec.Template.Spec.Containers[0].Image = imageutils.GetPauseImageName()
case "fail":
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/upgrades/apps/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (t *JobUpgradeTest) Setup(ctx context.Context, f *framework.Framework) {
t.namespace = f.Namespace.Name

ginkgo.By("Creating a job")
t.job = e2ejob.NewTestJob("notTerminate", "foo", v1.RestartPolicyOnFailure, 2, 2, nil, 6)
t.job = e2ejob.NewTestJob("neverTerminate", "foo", v1.RestartPolicyOnFailure, 2, 2, nil, 6)
job, err := e2ejob.CreateJob(ctx, f.ClientSet, t.namespace, t.job)
t.job = job
framework.ExpectNoError(err)
Expand Down

0 comments on commit 8a930ef

Please sign in to comment.