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 | NC | Use --from_file Option in Account Create #7779

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

shirady
Copy link
Contributor

@shirady shirady commented Jan 31, 2024

Explain the changes

  1. Add the from_file option in the account that would include validation. The JSON file will include options (as key-value structure) that are the same as the flags we suggest.
  2. Change the structure inside the main so that eventually it doesn't matter whether the parameters are from the flags arguments (argv) or file.
  3. Move get_access_keys to a separate function.
  4. Fix indentation in fetch_account_data in the part of access_key as SensitiveString.
  5. Remove an unused parameter from validate_options_type_by_value.
  6. In native_fs_utils.js rename the function read_config_file to read_file.
  7. Update json in doc so _id will appear first (as fixed in this PR).

Issues: Fixed BZ 2260325, BZ 2262997, BZ 2262992

  1. Currently the file that was read in QE tests was a JSON file that was similar to the account config file, so when creating an account using the flag --from_file and in the JSON there is no creation_date property we do not allow the account creation (it fails on the schema validation).
  2. In addition to that, when creating an account using the flag --from_file the account credentials standards were not checked.
  3. For BZ 2262992 - waiting for PR NSFS | NC | Add a Flag to Change the Value of allow_bucket_creation #7827 to be merged before merging this PR.
  4. This PR also fixed the mentioned gap regarding "id" appearing last in the JSON output.
  5. GAP - doing the same changes in bucket add (a following PR after this would be merged).
  6. GAP - might need to refactor set_access_keys() function.

Testing Instructions:

Added unit tests, please run: sudo npx jest test_nc_nsfs_account_cli.test.js

  • Doc added/updated
  • Tests added

@shirady shirady self-assigned this Jan 31, 2024
@shirady shirady changed the title NSFS | NC | Use --from-File Option without creation_date NSFS | NC | Use --from-file Option without creation_date Jan 31, 2024
@shirady

This comment was marked as outdated.

@shirady shirady marked this pull request as draft February 1, 2024 08:19
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch from 336c2ec to a4ecfbe Compare February 4, 2024 12:01
@pull-request-size pull-request-size bot added size/L and removed size/S labels Feb 4, 2024
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch from a4ecfbe to 6d052bf Compare February 15, 2024 10:33
@shirady shirady marked this pull request as ready for review February 15, 2024 10:40
@shirady shirady requested a review from romayalon February 15, 2024 10:47
@shirady shirady changed the title NSFS | NC | Use --from-file Option without creation_date NSFS | NC | Use --from-file Option in Account Create Feb 15, 2024
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch 2 times, most recently from 7669e00 to 3127b3e Compare February 18, 2024 06:20
docs/non_containerized_NSFS.md Outdated Show resolved Hide resolved
docs/non_containerized_NSFS.md Outdated Show resolved Hide resolved
src/manage_nsfs/manage_nsfs_help_utils.js Outdated Show resolved Hide resolved
src/manage_nsfs/manage_nsfs_help_utils.js Show resolved Hide resolved
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
src/cmd/manage_nsfs.js Show resolved Hide resolved
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
src/cmd/manage_nsfs.js Show resolved Hide resolved
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
@shirady shirady requested a review from romayalon February 18, 2024 12:46
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch from 03df133 to 114aa0e Compare February 19, 2024 08:05
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch 3 times, most recently from 4e75204 to 7a6444f Compare March 3, 2024 07:09
@shirady shirady requested a review from liranmauda March 3, 2024 09:50
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch 3 times, most recently from 87eab91 to a7960bc Compare March 5, 2024 11:59
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch 4 times, most recently from 79986b9 to 46187c4 Compare March 6, 2024 16:53
@shirady shirady requested a review from romayalon March 7, 2024 06:06
1. Add the from_file option in the account that would include validation. The JSON file will include options (as key-value structure) that are the same as the flags we suggest.
2. Change the structure inside the main so that eventually it doesn't matter whether the parameters are from the flags arguments (argv) or file.
3. Move get_access_keys to a separate function.
4. Fix indentation in fetch_account_data in the part of access_key as SensitiveString.
5. Remove an unused parameter from validate_options_type_by_value.
6. In native_fs_utils.js rename the function read_config_file to read_file.
7. Update json in doc so _id will appear first (as fixed in this PR).

Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
@shirady shirady force-pushed the nsfs-nc-fix-creation-date-from-file branch from 46187c4 to 0796e79 Compare March 7, 2024 10:09
@shirady shirady merged commit 9eaba1e into noobaa:master Mar 7, 2024
10 checks passed
@shirady shirady deleted the nsfs-nc-fix-creation-date-from-file branch March 7, 2024 11:01
@shirady shirady changed the title NSFS | NC | Use --from-file Option in Account Create NSFS | NC | Use --from-_file Option in Account Create Mar 20, 2024
@shirady shirady changed the title NSFS | NC | Use --from-_file Option in Account Create NSFS | NC | Use --from_file Option in Account Create Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants