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

NSFS | GPFS | PUT OBJECT | Fix for upload object of nested key - temp file flow #7227

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

romayalon
Copy link
Contributor

Explain the changes

On PUT OBJECT of nested key (a/b) on GPFS namespace resource - the directory a/ was not created due to setting open_path = dirname(open_path), According to https://nodejs.org/api/path.html#pathdirnamepath - dirname(path) returns directory name of a path, similar to the Unix dirname command. Trailing directory separators are ignored.
Removing the last '/' caused make_path_dirs() to not create a/ because it's searching for the last index of '/' of the path.
Example -
open_path = 'a/b';
open_path = dirname(open_path); // = 'a'
make_path_dirs -> no '/' - nothing to create

Took Guy's code to fix this issue -

  1. By not changing open_path, and setting dir_path = path.dirname(open_path) to a new variable, make_path_dirs created the nested object correctly.

Issues: Fixed #xxx / Gap #xxx

Testing Instructions:

  1. Install NooBaa
  2. Create GPFS namespace resource
  3. put object key = a/b and check it was created correctly
  • Doc added/updated
  • Tests added

Signed-off-by: Romy <romy2232@gmail.com>
@romayalon romayalon merged commit 6a57ea0 into noobaa:master Mar 20, 2023
@dannyzaken dannyzaken mentioned this pull request Apr 17, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants