GCS gateway allows apps to supply their own marker (#4495)

Most s3 compatible apps use object keys returned in listing as
marker. This change allows this behaviour with gateway-gcs too.
This commit is contained in:
Krishnan Parthasarathi
2017-06-10 02:48:20 +00:00
committed by Harshavardhana
parent d86973dcca
commit 4fb5fc72d7
3 changed files with 69 additions and 10 deletions
+32
View File
@@ -164,3 +164,35 @@ func TestIsGCSPrefix(t *testing.T) {
}
}
}
// Test for isGCSMarker.
func TestIsGCSMarker(t *testing.T) {
testCases := []struct {
marker string
expected bool
}{
{
marker: "##miniogcs123",
expected: true,
},
{
marker: "##mini_notgcs123",
expected: false,
},
{
marker: "#minioagainnotgcs123",
expected: false,
},
{
marker: "obj1",
expected: false,
},
}
for i, tc := range testCases {
if actual := isGCSMarker(tc.marker); actual != tc.expected {
t.Errorf("Test %d: marker is %s, expected %v but got %v",
i+1, tc.marker, tc.expected, actual)
}
}
}