Skip to content

Commit

Permalink
Merge pull request #111 from danielvegamyhre/automated-cherry-pick-of…
Browse files Browse the repository at this point in the history
…-#110-upstream-release-0.1

Automated cherry pick of #110: update annotations
  • Loading branch information
k8s-ci-robot authored May 4, 2023
2 parents c1d085d + 0548d9b commit 8cae020
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controllers/jobset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ func labelAndAnnotateObject(obj metav1.Object, js *jobset.JobSet, rjob *jobset.R
labels[jobset.JobIndexKey] = strconv.Itoa(jobIdx)

annotations := cloneMap(obj.GetAnnotations())
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 8cae020

Please sign in to comment.