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 | Add a Flag to Change the Value of allow_bucket_creation #7827

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

shirady
Copy link
Contributor

@shirady shirady commented Feb 18, 2024

Explain the changes

  1. Add a flag to change the value of allow_bucket_creation.
  2. Edit details message when BucketCreationNotAllowed is thrown.
  3. Add the option for boolean flags to pass 'true' and 'false' (wide, show_secrets, regenerate).
  4. Add a new error InvalidBooleanValue.
  5. Reduce the number of spaces in the help menu (without glacier changes to match the existing style, since it changes in PR [NC | NSFS] Fix WAL processing failure #7848).

Issues: Fixed BZ 2262992 #7786

  1. Currently, the allow_bucket_creation value is inferred from the new_buckets_path: if the user passes a value to new_buckets_path then it is true, otherwise, it is false.
  2. The fix is partial for the BZ 2262992, because the automated tests are using from_file flag, after this PR is merged we need to merge also PR NSFS | NC | Use --from_file Option in Account Create #7779 as a fix.
  3. GAP - I think we need to extract wide not part of the fetch data or extract and remove it before writing the config file (opened issue NSFS | NC | wide Property Should Be Removed from fetch_bucket_data And fetch_account_data #7871).

Testing Instructions:

Manual Tests:

  1. Use the new flag bucket_creation and see the value of allow_bucket_creation changes, for example:
  • First, create the FS_ROOT and a directory for a bucket: mkdir -p /tmp/nsfs_root1/my-bucket and give permissions chmod 777 /tmp/nsfs_root1/ chmod 777 /tmp/nsfs_root1/my-bucket.
    This will be the argument for:
    • new_buckets_path flag /tmp/nsfs_root1 (that we will use in the account commands)
    • path in the buckets commands /tmp/nsfs_root1/my-bucket (that we will use in bucket commands).
  • Create an account with new_buckets_path (allow_bucket_creation inferred to be true): sudo node src/cmd/manage_nsfs account add --name <account-name> --new_buckets_path /tmp/nsfs_root1 --uid <uid> --gid <gid>
  • Update the account (so allow_bucket_creation will be false): sudo node src/cmd/manage_nsfs account update --name <account-name> --allow_bucket_creation false.
  1. Use the boolean flags with true/false values, for example: sudo node src/cmd/manage_nsfs account status --name <account-name> --show_secrets=true

Unit Tests:

please run:

  • sudo node ./node_modules/.bin/_mocha src/test/unit_tests/test_nc_nsfs_cli.js.

  • sudo npx jest test_nc_nsfs_account_cli.test.js.

  • Doc added/updated

  • Tests added

@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 18, 2024
@shirady shirady requested a review from romayalon February 18, 2024 13:39
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
src/manage_nsfs/manage_nsfs_constants.js Outdated Show resolved Hide resolved
src/cmd/manage_nsfs.js Outdated Show resolved Hide resolved
@shirady shirady force-pushed the allow-bucket-creation branch 2 times, most recently from 7c7ad9b to 743d83d Compare February 28, 2024 11:10
@shirady shirady changed the title NSFS | NC | Add a Flag to Change the Value Of allow_bucket_creation NSFS | NC | Add a Flag to Change the Value of allow_bucket_creation Feb 28, 2024
@shirady shirady force-pushed the allow-bucket-creation branch 2 times, most recently from 65fde15 to 77ff879 Compare February 28, 2024 12:38
@shirady shirady requested a review from romayalon February 29, 2024 07:26
@shirady shirady force-pushed the allow-bucket-creation branch from c3a7380 to 84dd91b Compare February 29, 2024 11:45
@shirady shirady requested a review from liranmauda March 3, 2024 09:50
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Mar 3, 2024
@shirady shirady force-pushed the allow-bucket-creation branch 2 times, most recently from 72aa470 to 9674b59 Compare March 3, 2024 12:49
src/cmd/manage_nsfs.js Show resolved Hide resolved
src/cmd/manage_nsfs.js Show resolved Hide resolved
@shirady shirady force-pushed the allow-bucket-creation branch 5 times, most recently from d24e69b to 2a3d0a9 Compare March 4, 2024 15:50
@shirady shirady requested a review from naveenpaul1 March 4, 2024 16:31
@shirady shirady force-pushed the allow-bucket-creation branch 3 times, most recently from 5f8393c to f986bf9 Compare March 5, 2024 06:57
…licitly

1. Add a flag to change the value of allow_bucket_creation.
2. Edit details message when BucketCreationNotAllowed is thrown.
3. Add the option for boolean flags to pass 'true' and 'false' (wide, show_secrets, regenerate).
4. Add a new error InvalidBooleanValue.
5. Reduce the number of spaces in the help menu.

Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
@shirady shirady force-pushed the allow-bucket-creation branch from 824cf0d to 57474ee Compare March 5, 2024 10:33
@shirady shirady merged commit baac99d into noobaa:master Mar 5, 2024
10 checks passed
@shirady shirady deleted the allow-bucket-creation branch March 5, 2024 11:36
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