NC | Online upgrade process small fix & refactoring #8467
Merged
+95
−47
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.
Explain the changes
a. changed init_nc_system() to set config_directory properties only on a completely new system. otherwise, config_directory data will be set only via nc_upgrade_manager. Due to this change, I had to check config_directory data exists also on throw_if_config_dir_locked(), and if not, this is an old system.json and we do not allow updating config directory in that case, hence we will throw an error.
a. Moved init_nc_system from nsfs.js to config_fs.js, re-arranged the function and added some helper functions.
b. Added missing JSdocs.
Issues: Fixed #xxx / Gap #xxx
Wondering if there can be scenarios where the user wants to create a bucket/account without starting the S3 service ever, if so, we don't have any version information about the already existing accounts/buckets, we won't know if updates on the config directory should be allowed or not in that case. - optional solution, create system.json via the CLI.
Testing Instructions: