Skip to content

Commit fa98657

Browse files
committed
Update after code review
1 parent b56deac commit fa98657

File tree

3 files changed

+19
-65
lines changed

3 files changed

+19
-65
lines changed

pkg/controller/jobs/pod/pod_multikueue_adapter.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,10 @@ func syncLocalPodWithRemote(
167167
}
168168

169169
// Patch the status of the local pod to match the remote pod
170-
if err := clientutil.PatchStatus(ctx, localClient, localPod, func() (bool, error) {
170+
return clientutil.PatchStatus(ctx, localClient, localPod, func() (bool, error) {
171171
localPod.Status = remotePod.Status
172172
return true, nil
173-
}); err != nil {
174-
return err
175-
}
176-
return nil
173+
})
177174
}
178175

179176
// If the remote pod does not exist, create it

test/e2e/multikueue/e2e_test.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -423,38 +423,12 @@ var _ = ginkgo.Describe("MultiKueue", func() {
423423
}, util.Timeout, util.Interval).Should(gomega.Succeed())
424424
})
425425
})
426-
finishReason := "PodCompleted"
427-
finishPodConditions := []corev1.PodCondition{
428-
{
429-
Type: corev1.PodReadyToStartContainers,
430-
Status: corev1.ConditionFalse,
431-
Reason: "",
432-
},
433-
{
434-
Type: corev1.PodInitialized,
435-
Status: corev1.ConditionTrue,
436-
Reason: finishReason},
437-
{
438-
Type: corev1.PodReady,
439-
Status: corev1.ConditionFalse,
440-
Reason: finishReason,
441-
},
442-
{
443-
Type: corev1.ContainersReady,
444-
Status: corev1.ConditionFalse,
445-
Reason: finishReason},
446-
{
447-
Type: corev1.PodScheduled,
448-
Status: corev1.ConditionTrue,
449-
Reason: "",
450-
},
451-
}
426+
452427
ginkgo.By("Waiting for the group to get status updates", func() {
453428
gomega.Eventually(func(g gomega.Gomega) {
454429
g.Expect(k8sManagerClient.List(ctx, pods, client.InNamespace(managerNs.Name))).To(gomega.Succeed())
455430
for _, p := range pods.Items {
456431
g.Expect(p.Status.Phase).To(gomega.Equal(corev1.PodSucceeded))
457-
g.Expect(p.Status.Conditions).To(gomega.BeComparableTo(finishPodConditions, cmpopts.IgnoreFields(corev1.PodCondition{}, "LastTransitionTime")))
458432
}
459433
}, util.LongTimeout, util.Interval).Should(gomega.Succeed())
460434
})

test/integration/multikueue/jobs_test.go

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,17 +1129,10 @@ var _ = ginkgo.Describe("MultiKueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
11291129

11301130
gomega.Eventually(func(g gomega.Gomega) {
11311131
g.Expect(managerTestCluster.client.Get(managerTestCluster.ctx, wlLookupKey, createdWorkload)).To(gomega.Succeed())
1132-
acs := workload.FindAdmissionCheck(createdWorkload.Status.AdmissionChecks, multikueueAC.Name)
1132+
acs := workload.FindAdmissionCheck(createdWorkload.Status.AdmissionChecks, multiKueueAC.Name)
11331133
g.Expect(acs).NotTo(gomega.BeNil())
11341134
g.Expect(acs.State).To(gomega.Equal(kueue.CheckStatePending))
11351135
g.Expect(acs.Message).To(gomega.Equal(`The workload got reservation on "worker1"`))
1136-
ok, err := utiltesting.HasEventAppeared(managerTestCluster.ctx, managerTestCluster.client, corev1.Event{
1137-
Reason: "MultiKueue",
1138-
Type: corev1.EventTypeNormal,
1139-
Message: `The workload got reservation on "worker1"`,
1140-
})
1141-
g.Expect(err).NotTo(gomega.HaveOccurred())
1142-
g.Expect(ok).To(gomega.BeTrue())
11431136
}, util.Timeout, util.Interval).Should(gomega.Succeed())
11441137

11451138
gomega.Eventually(func(g gomega.Gomega) {
@@ -1160,39 +1153,29 @@ var _ = ginkgo.Describe("MultiKueue", ginkgo.Ordered, ginkgo.ContinueOnFailure,
11601153
createdPod.Status.Phase = corev1.PodSucceeded
11611154
createdPod.Status.Conditions = append(createdPod.Status.Conditions,
11621155
corev1.PodCondition{
1163-
Type: corev1.PodReadyToStartContainers,
1164-
Status: corev1.ConditionFalse,
1165-
LastProbeTime: metav1.Now(),
1166-
LastTransitionTime: metav1.Now(),
1167-
Reason: "",
1156+
Type: corev1.PodReadyToStartContainers,
1157+
Status: corev1.ConditionFalse,
1158+
Reason: "",
11681159
},
11691160
corev1.PodCondition{
1170-
Type: corev1.PodInitialized,
1171-
Status: corev1.ConditionTrue,
1172-
LastProbeTime: metav1.Now(),
1173-
LastTransitionTime: metav1.Now(),
1174-
Reason: string(corev1.PodSucceeded),
1161+
Type: corev1.PodInitialized,
1162+
Status: corev1.ConditionTrue,
1163+
Reason: string(corev1.PodSucceeded),
11751164
},
11761165
corev1.PodCondition{
1177-
Type: corev1.PodReady,
1178-
Status: corev1.ConditionFalse,
1179-
LastProbeTime: metav1.Now(),
1180-
LastTransitionTime: metav1.Now(),
1181-
Reason: string(corev1.PodSucceeded),
1166+
Type: corev1.PodReady,
1167+
Status: corev1.ConditionFalse,
1168+
Reason: string(corev1.PodSucceeded),
11821169
},
11831170
corev1.PodCondition{
1184-
Type: corev1.ContainersReady,
1185-
Status: corev1.ConditionFalse,
1186-
LastProbeTime: metav1.Now(),
1187-
LastTransitionTime: metav1.Now(),
1188-
Reason: string(corev1.PodSucceeded),
1171+
Type: corev1.ContainersReady,
1172+
Status: corev1.ConditionFalse,
1173+
Reason: string(corev1.PodSucceeded),
11891174
},
11901175
corev1.PodCondition{
1191-
Type: corev1.PodScheduled,
1192-
Status: corev1.ConditionTrue,
1193-
LastProbeTime: metav1.Now(),
1194-
LastTransitionTime: metav1.Now(),
1195-
Reason: "",
1176+
Type: corev1.PodScheduled,
1177+
Status: corev1.ConditionTrue,
1178+
Reason: "",
11961179
},
11971180
)
11981181
g.Expect(worker1TestCluster.client.Status().Update(worker1TestCluster.ctx, &createdPod)).To(gomega.Succeed())

0 commit comments

Comments
 (0)