Skip to content

Commit d4a30e8

Browse files
author
Ryan Zhang
committed
fix the test
1 parent b97f62d commit d4a30e8

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

test/e2e/placement_selecting_resources_test.go

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,23 +1189,15 @@ var _ = Describe("validating CRP when selected resources cross the 1MB limit", O
11891189
// This test verifies that resources are selected and ordered correctly according to the sortResources logic
11901190
var _ = Describe("creating CRP and checking selected resources order", Ordered, func() {
11911191
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
1192-
nsName := fmt.Sprintf("test-ns-order-%d", GinkgoParallelProcess())
1192+
ns := appNamespace()
1193+
nsName := ns.Name
11931194
var configMap *corev1.ConfigMap
11941195
var secret *corev1.Secret
11951196
var pvc *corev1.PersistentVolumeClaim
11961197
var role *rbacv1.Role
11971198
BeforeAll(func() {
11981199
By("creating test resources in specific order for ordering verification")
1199-
// Create a namespace for our test resources
1200-
ns := &corev1.Namespace{
1201-
ObjectMeta: metav1.ObjectMeta{
1202-
Name: nsName,
1203-
Labels: map[string]string{
1204-
"test-label": "selected",
1205-
},
1206-
},
1207-
}
1208-
Expect(hubClient.Create(ctx, ns)).To(Succeed(), "Failed to create test namespace")
1200+
Expect(hubClient.Create(ctx, &ns)).To(Succeed(), "Failed to create test namespace")
12091201

12101202
// Create ConfigMap
12111203
configMap = &corev1.ConfigMap{
@@ -1293,12 +1285,7 @@ var _ = Describe("creating CRP and checking selected resources order", Ordered,
12931285
ensureCRPAndRelatedResourcesDeleted(crpName, allMemberClusters)
12941286

12951287
// Delete the namespace which will cascade delete all resources
1296-
ns := &corev1.Namespace{
1297-
ObjectMeta: metav1.ObjectMeta{
1298-
Name: nsName,
1299-
},
1300-
}
1301-
Expect(client.IgnoreNotFound(hubClient.Delete(ctx, ns))).To(Succeed(), "Failed to delete test namespace")
1288+
Expect(client.IgnoreNotFound(hubClient.Delete(ctx, &ns))).To(Succeed(), "Failed to delete test namespace")
13021289
})
13031290

13041291
It("should update CRP status with the correct order of the selected resources", func() {

0 commit comments

Comments
 (0)