HDDS-3752. Patch for o3fs issue with not listing bucket contents WITHOUT trailin… #2088
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
...Originally when ls -R o3fs://bucket.vol issued, resulted in No such file/directory error. Fixed path so that contents of bucket listed when command issued without trailing slash. Patch affects one file, the BasicOzoneFileSystem filesystem abstraction. Patch overrides the fixRelativePart method to allow Path to be resolved correctly for OzoneFileSystem implementation.
What changes were proposed in this pull request?
Patch fixed issue with OzoneFileSystem implementation of FileSystem for o3fs space when -ls command request without trailing slash of 2nd level bucket (vol/bucket). Problem is that request interpreted as a 'relative' address resolving to the 'working directory' which is evaluated to an error 'Directory or File Not Found'.
Patch to BasicOzoneFileSystem overrides the fixRelativePart method to resolve the Path to the correct Path (adding a trailing slash). BasicOzoneFileSystem implementation of FileSystem then correctly evaluates the path.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-3752
How was this patch tested?
Passed unit and integration tests.
Manual testing:

Tested though ozone fs cli commands (see attached images).
Pre-patch:
Fix with patch:
