Skip to content

Commit f42f07c

Browse files
Wei WengWei Weng
authored andcommitted
Revert "enum for stateful set test yaml"
This reverts commit b1518f3.
1 parent 4d8f7eb commit f42f07c

8 files changed

+10
-55
lines changed

test/e2e/enveloped_object_placement_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ var _ = Describe("placing wrapped resources using a CRP", func() {
226226
// read the test resources.
227227
readDeploymentTestManifest(&testDeployment)
228228
readDaemonSetTestManifest(&testDaemonSet)
229-
readStatefulSetTestManifest(&testStatefulSet, StatefulSetWithStorage)
229+
readStatefulSetTestManifest(&testStatefulSet, true)
230230
readEnvelopeResourceTestManifest(&testResourceEnvelope)
231231
})
232232

test/e2e/resource_placement_hub_workload_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var _ = Describe("placing workloads using a CRP with PickAll policy", Label("res
3939
// Read the test manifests
4040
readDeploymentTestManifest(&testDeployment)
4141
readDaemonSetTestManifest(&testDaemonSet)
42-
readStatefulSetTestManifest(&testStatefulSet, StatefulSetWithStorage)
42+
readStatefulSetTestManifest(&testStatefulSet, false)
4343
workNamespace := appNamespace()
4444

4545
// Create namespace and workloads

test/e2e/resource_placement_rollout_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var _ = Describe("placing namespaced scoped resources using a RP with rollout",
6969
testDaemonSet = appv1.DaemonSet{}
7070
readDaemonSetTestManifest(&testDaemonSet)
7171
testStatefulSet = appv1.StatefulSet{}
72-
readStatefulSetTestManifest(&testStatefulSet, StatefulSetBasic)
72+
readStatefulSetTestManifest(&testStatefulSet, false)
7373
testService = corev1.Service{}
7474
readServiceTestManifest(&testService)
7575
testJob = batchv1.Job{}

test/e2e/resources/statefulset-with-storage.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.
File renamed without changes.

test/e2e/rollout_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ var _ = Describe("placing wrapped resources using a CRP", Ordered, func() {
342342

343343
BeforeAll(func() {
344344
// Create the test resources.
345-
readStatefulSetTestManifest(&testStatefulSet, StatefulSetBasic)
345+
readStatefulSetTestManifest(&testStatefulSet, false)
346346
readEnvelopeResourceTestManifest(&testStatefulSetEnvelope)
347347
wantSelectedResources = []placementv1beta1.ResourceIdentifier{
348348
{

test/e2e/utils_test.go

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ import (
5757
"github.com/kubefleet-dev/kubefleet/test/e2e/framework"
5858
)
5959

60-
// StatefulSetVariant represents different StatefulSet configurations for testing
61-
type StatefulSetVariant int
62-
63-
const (
64-
// StatefulSetBasic is a StatefulSet without any persistent volume claims
65-
StatefulSetBasic StatefulSetVariant = iota
66-
// StatefulSetInvalidStorage is a StatefulSet with a non-existent storage class
67-
StatefulSetInvalidStorage
68-
// StatefulSetWithStorage is a StatefulSet with a valid standard storage class
69-
StatefulSetWithStorage
70-
)
71-
7260
var (
7361
croTestAnnotationKey = "cro-test-annotation"
7462
croTestAnnotationValue = "cro-test-annotation-val"
@@ -1544,18 +1532,13 @@ func readDaemonSetTestManifest(testDaemonSet *appsv1.DaemonSet) {
15441532
Expect(err).Should(Succeed())
15451533
}
15461534

1547-
func readStatefulSetTestManifest(testStatefulSet *appsv1.StatefulSet, variant StatefulSetVariant) {
1535+
func readStatefulSetTestManifest(testStatefulSet *appsv1.StatefulSet, withVolume bool) {
15481536
By("Read the statefulSet resource")
1549-
var manifestPath string
1550-
switch variant {
1551-
case StatefulSetBasic:
1552-
manifestPath = "resources/statefulset-basic.yaml"
1553-
case StatefulSetInvalidStorage:
1554-
manifestPath = "resources/statefulset-invalid-storage.yaml"
1555-
case StatefulSetWithStorage:
1556-
manifestPath = "resources/statefulset-with-storage.yaml"
1557-
}
1558-
Expect(utils.GetObjectFromManifest(manifestPath, testStatefulSet)).Should(Succeed())
1537+
if withVolume {
1538+
Expect(utils.GetObjectFromManifest("resources/statefulset-with-volume.yaml", testStatefulSet)).Should(Succeed())
1539+
} else {
1540+
Expect(utils.GetObjectFromManifest("resources/test-statefulset.yaml", testStatefulSet)).Should(Succeed())
1541+
}
15591542
}
15601543

15611544
func readServiceTestManifest(testService *corev1.Service) {

0 commit comments

Comments
 (0)