Skip to content

Commit

Permalink
update annotations and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvegamyhre committed May 4, 2023
1 parent ee288ab commit 0548d9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/jobset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ func labelAndAnnotateObject(obj metav1.Object, js *jobset.JobSet, rjob *jobset.R
labels[jobset.JobIndexKey] = strconv.Itoa(jobIdx)

annotations := cloneMap(obj.GetAnnotations())
labels[jobset.JobSetNameKey] = js.Name
labels[jobset.ReplicatedJobNameKey] = rjob.Name
annotations[jobset.JobSetNameKey] = js.Name
annotations[jobset.ReplicatedJobNameKey] = rjob.Name
annotations[jobset.ReplicatedJobReplicas] = strconv.Itoa(rjob.Replicas)
annotations[jobset.JobIndexKey] = strconv.Itoa(jobIdx)

Expand Down
4 changes: 4 additions & 0 deletions pkg/controllers/jobset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ func makeJob(args *makeJobArgs) *testutils.JobWrapper {
RestartsKey: strconv.Itoa(args.restarts),
}).
JobAnnotations(map[string]string{
jobset.JobSetNameKey: args.jobSetName,
jobset.ReplicatedJobNameKey: args.replicatedJobName,
jobset.ReplicatedJobReplicas: strconv.Itoa(args.replicas),
jobset.JobIndexKey: strconv.Itoa(args.jobIdx),
}).
Expand All @@ -731,6 +733,8 @@ func makeJob(args *makeJobArgs) *testutils.JobWrapper {
RestartsKey: strconv.Itoa(args.restarts),
}).
PodAnnotations(map[string]string{
jobset.JobSetNameKey: args.jobSetName,
jobset.ReplicatedJobNameKey: args.replicatedJobName,
jobset.ReplicatedJobReplicas: strconv.Itoa(args.replicas),
jobset.JobIndexKey: strconv.Itoa(args.jobIdx),
})
Expand Down

0 comments on commit 0548d9b

Please sign in to comment.