Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix long file names in case of duplicates #844

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/cli_tests/0_s3mgrt_migrate_alternate2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ func Test0S3MigrationAlternatePart2(testSetup *testing.T) {
// This func needs to be in sync with the original func.
func getUniqueShortObjKey(objectKey string) string {
// Max length to which objectKey would be trimmed to.
const maxLength = 100
// Keeping this less than 100 chars to prevent longer name in case of uploading duplicate
sunilmhta marked this conversation as resolved.
Show resolved Hide resolved
// files with `_copy` suffixes.
const maxLength = 90

if len(objectKey) > maxLength {
// Generate a SHA-1 hash of the object key
Expand Down
Loading