Skip to content

Commit

Permalink
storageclassrequest: remove use of StorageProfiles with blockpools
Browse files Browse the repository at this point in the history
Signed-off-by: Jose A. Rivera <[email protected]>
  • Loading branch information
jarrpa committed Mar 19, 2024
1 parent 215205a commit b4ad713
Showing 1 changed file with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func TestCephBlockPool(t *testing.T) {
Name: "test-blockpool",
Namespace: "test-ns",
Labels: map[string]string{
controllers.StorageProfileSpecLabel: fakeStorageProfile.GetSpecHash(),
controllers.StorageProfileLabel: fakeStorageProfile.Name,
},
},
},
Expand All @@ -444,7 +444,7 @@ func TestCephBlockPool(t *testing.T) {
Name: "test-blockpool2",
Namespace: "test-ns",
Labels: map[string]string{
controllers.StorageProfileSpecLabel: fakeStorageProfile.GetSpecHash(),
controllers.StorageProfileLabel: fakeStorageProfile.Name,
},
},
},
Expand Down Expand Up @@ -512,7 +512,7 @@ func TestCephBlockPool(t *testing.T) {
Name: "test-blockpool",
Namespace: "test-ns",
Labels: map[string]string{
controllers.StorageProfileSpecLabel: fakeStorageProfile.GetSpecHash(),
controllers.StorageProfileLabel: fakeStorageProfile.Name,
},
},
},
Expand Down Expand Up @@ -608,22 +608,6 @@ func TestCephBlockPool(t *testing.T) {
err = r.get(expectedRadosNamespace)
assert.NoError(t, err, caseLabel)
}

caseCounter++
caseLabel := fmt.Sprintf("Case %d: StorageProfile has invalid DeviceClass", caseCounter)
fmt.Println(caseLabel)

badStorageProfile := fakeStorageProfile.DeepCopy()
badStorageProfile.Spec.DeviceClass = "nope"

r := createFakeReconciler(t)
r.StorageClassRequest.Spec.Type = "blockpool"
r.StorageClassRequest.Spec.StorageProfile = badStorageProfile.Name
fakeClient := newFakeClientBuilder(r.Scheme)
r.Client = fakeClient.WithRuntimeObjects(badStorageProfile, fakeStorageConsumer).Build()

_, err = r.reconcilePhases()
assert.Error(t, err, caseLabel)
}

func TestCephFsSubVolGroup(t *testing.T) {
Expand Down

0 comments on commit b4ad713

Please sign in to comment.