Export contains access mode helper method

Will be used during validation of PVs and PVCs
This commit is contained in:
Chris Henzie
2021-06-14 19:31:57 -07:00
parent 83e3ee780a
commit 358d2e0bd1
5 changed files with 25 additions and 25 deletions

View File

@@ -87,23 +87,23 @@ func TestIsStandardContainerResource(t *testing.T) {
func TestGetAccessModesFromString(t *testing.T) {
modes := GetAccessModesFromString("ROX")
if !containsAccessMode(modes, core.ReadOnlyMany) {
if !ContainsAccessMode(modes, core.ReadOnlyMany) {
t.Errorf("Expected mode %s, but got %+v", core.ReadOnlyMany, modes)
}
modes = GetAccessModesFromString("ROX,RWX")
if !containsAccessMode(modes, core.ReadOnlyMany) {
if !ContainsAccessMode(modes, core.ReadOnlyMany) {
t.Errorf("Expected mode %s, but got %+v", core.ReadOnlyMany, modes)
}
if !containsAccessMode(modes, core.ReadWriteMany) {
if !ContainsAccessMode(modes, core.ReadWriteMany) {
t.Errorf("Expected mode %s, but got %+v", core.ReadWriteMany, modes)
}
modes = GetAccessModesFromString("RWO,ROX,RWX")
if !containsAccessMode(modes, core.ReadOnlyMany) {
if !ContainsAccessMode(modes, core.ReadOnlyMany) {
t.Errorf("Expected mode %s, but got %+v", core.ReadOnlyMany, modes)
}
if !containsAccessMode(modes, core.ReadWriteMany) {
if !ContainsAccessMode(modes, core.ReadWriteMany) {
t.Errorf("Expected mode %s, but got %+v", core.ReadWriteMany, modes)
}
}