Skip to content

Commit 114dc5c

Browse files
author
Arvind Thirumurugan
committed
use utils function
1 parent 028709b commit 114dc5c

File tree

1 file changed

+4
-48
lines changed

1 file changed

+4
-48
lines changed

test/e2e/placement_eviction_test.go

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding, taint clus
3131
createWorkResources()
3232

3333
// Create the CRP.
34-
crp := &placementv1beta1.ClusterResourcePlacement{
35-
ObjectMeta: metav1.ObjectMeta{
36-
Name: crpName,
37-
// Add a custom finalizer; this would allow us to better observe
38-
// the behavior of the controllers.
39-
Finalizers: []string{customDeletionBlockerFinalizer},
40-
},
41-
Spec: placementv1beta1.ClusterResourcePlacementSpec{
42-
ResourceSelectors: workResourceSelector(),
43-
},
44-
}
45-
Expect(hubClient.Create(ctx, crp)).To(Succeed(), "Failed to create CRP %s", crpName)
34+
createCRP(crpName)
4635
})
4736

4837
AfterAll(func() {
@@ -115,18 +104,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding, no taint s
115104
createWorkResources()
116105

117106
// Create the CRP.
118-
crp := &placementv1beta1.ClusterResourcePlacement{
119-
ObjectMeta: metav1.ObjectMeta{
120-
Name: crpName,
121-
// Add a custom finalizer; this would allow us to better observe
122-
// the behavior of the controllers.
123-
Finalizers: []string{customDeletionBlockerFinalizer},
124-
},
125-
Spec: placementv1beta1.ClusterResourcePlacementSpec{
126-
ResourceSelectors: workResourceSelector(),
127-
},
128-
}
129-
Expect(hubClient.Create(ctx, crp)).To(Succeed(), "Failed to create CRP %s", crpName)
107+
createCRP(crpName)
130108
})
131109

132110
AfterAll(func() {
@@ -179,18 +157,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
179157
createWorkResources()
180158

181159
// Create the CRP.
182-
crp := &placementv1beta1.ClusterResourcePlacement{
183-
ObjectMeta: metav1.ObjectMeta{
184-
Name: crpName,
185-
// Add a custom finalizer; this would allow us to better observe
186-
// the behavior of the controllers.
187-
Finalizers: []string{customDeletionBlockerFinalizer},
188-
},
189-
Spec: placementv1beta1.ClusterResourcePlacementSpec{
190-
ResourceSelectors: workResourceSelector(),
191-
},
192-
}
193-
Expect(hubClient.Create(ctx, crp)).To(Succeed(), "Failed to create CRP %s", crpName)
160+
createCRP(crpName)
194161
})
195162

196163
AfterAll(func() {
@@ -260,18 +227,7 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
260227
createWorkResources()
261228

262229
// Create the CRP.
263-
crp := &placementv1beta1.ClusterResourcePlacement{
264-
ObjectMeta: metav1.ObjectMeta{
265-
Name: crpName,
266-
// Add a custom finalizer; this would allow us to better observe
267-
// the behavior of the controllers.
268-
Finalizers: []string{customDeletionBlockerFinalizer},
269-
},
270-
Spec: placementv1beta1.ClusterResourcePlacementSpec{
271-
ResourceSelectors: workResourceSelector(),
272-
},
273-
}
274-
Expect(hubClient.Create(ctx, crp)).To(Succeed(), "Failed to create CRP %s", crpName)
230+
createCRP(crpName)
275231
})
276232

277233
AfterAll(func() {

0 commit comments

Comments
 (0)