Make sure that storage request of pvc is not zero

This commit is contained in:
NickrenREN
2017-11-06 21:23:27 +08:00
parent 338ee7f5d5
commit 3a22b5f5e0
2 changed files with 26 additions and 0 deletions

View File

@@ -765,6 +765,28 @@ func TestValidatePersistentVolumeClaim(t *testing.T) {
},
}),
},
"zero-storage-request": {
isExpectedFailure: true,
claim: testVolumeClaim("foo", "ns", core.PersistentVolumeClaimSpec{
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: "key2",
Operator: "Exists",
},
},
},
AccessModes: []core.PersistentVolumeAccessMode{
core.ReadWriteOnce,
core.ReadOnlyMany,
},
Resources: core.ResourceRequirements{
Requests: core.ResourceList{
core.ResourceName(api.ResourceStorage): resource.MustParse("0G"),
},
},
}),
},
"invalid-storage-class-name": {
isExpectedFailure: true,
claim: testVolumeClaim("foo", "ns", core.PersistentVolumeClaimSpec{