Skip to content

Commit f85e0eb

Browse files
authored
test: enable pickN e2e tests for RP (#205)
Signed-off-by: Wantong Jiang <[email protected]>
1 parent 6cbfa8f commit f85e0eb

File tree

3 files changed

+931
-9
lines changed

3 files changed

+931
-9
lines changed

test/e2e/actuals_test.go

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ func placementRolloutCompletedConditions(placementKey types.NamespacedName, gene
193193
}
194194
}
195195

196+
func placementScheduledConditions(placementKey types.NamespacedName, generation int64) []metav1.Condition {
197+
if placementKey.Namespace == "" {
198+
return crpScheduledConditions(generation)
199+
} else {
200+
return rpScheduledConditions(generation)
201+
}
202+
}
203+
196204
func placementSchedulePartiallyFailedConditions(placementKey types.NamespacedName, generation int64) []metav1.Condition {
197205
if placementKey.Namespace == "" {
198206
return crpSchedulePartiallyFailedConditions(generation)
@@ -306,6 +314,28 @@ func rpScheduleFailedConditions(generation int64) []metav1.Condition {
306314
}
307315
}
308316

317+
func rpScheduledConditions(generation int64) []metav1.Condition {
318+
return []metav1.Condition{
319+
{
320+
Type: string(placementv1beta1.ResourcePlacementScheduledConditionType),
321+
Status: metav1.ConditionTrue,
322+
ObservedGeneration: generation,
323+
Reason: scheduler.FullyScheduledReason,
324+
},
325+
}
326+
}
327+
328+
func crpScheduledConditions(generation int64) []metav1.Condition {
329+
return []metav1.Condition{
330+
{
331+
Type: string(placementv1beta1.ClusterResourcePlacementScheduledConditionType),
332+
Status: metav1.ConditionTrue,
333+
ObservedGeneration: generation,
334+
Reason: scheduler.FullyScheduledReason,
335+
},
336+
}
337+
}
338+
309339
func crpScheduleFailedConditions(generation int64) []metav1.Condition {
310340
return []metav1.Condition{
311341
{
@@ -1214,15 +1244,8 @@ func customizedPlacementStatusUpdatedActual(
12141244
if len(wantSelectedClusters) > 0 {
12151245
wantPlacementConditions = placementRolloutCompletedConditions(placementKey, placement.GetGeneration(), false)
12161246
} else {
1217-
wantPlacementConditions = []metav1.Condition{
1218-
// we don't set the remaining resource conditions.
1219-
{
1220-
Type: string(placementv1beta1.ClusterResourcePlacementScheduledConditionType),
1221-
Status: metav1.ConditionTrue,
1222-
Reason: scheduler.FullyScheduledReason,
1223-
ObservedGeneration: placement.GetGeneration(),
1224-
},
1225-
}
1247+
// We don't set the remaining resource conditions.
1248+
wantPlacementConditions = placementScheduledConditions(placementKey, placement.GetGeneration())
12261249
}
12271250

12281251
if len(wantUnselectedClusters) > 0 {

0 commit comments

Comments
 (0)