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

NooBaa CLI Re-design and Refactor #8000

Open
romayalon opened this issue Apr 25, 2024 · 0 comments
Open

NooBaa CLI Re-design and Refactor #8000

romayalon opened this issue Apr 25, 2024 · 0 comments
Labels
Non Containerized Non containerized
Milestone

Comments

@romayalon
Copy link
Contributor

romayalon commented Apr 25, 2024

Environment info

  • NooBaa Version: master
  • Platform: Non Containerized

Actual behavior

  1. The current src/cmd/ (CLI) components have a strange hierarchy. Accounts/buckets/whitelist management is under manage_nsfs while other NooBaa CLI commands are placed in the correct location.
  2. The manage_nsfs help has a weird look and should be more user-friendly -
  • Indentation issues.
  • Missing info for each command.
  • check OC CLI for reference.
  • When running with no command we get invalidType error instead of help print.
  1. Add --verbose/--quiet - NooBaa CLI should not print stderr to the user.
  2. Manage_nsfs - The add action should be renamed to create.
  3. Whitelist -
  • Currently, there is no action specified for whitelists, we always update.
  • We need to split the actions to get/delete/update, or remove completely and update/get/delete via editing of config.json.
  • change validation function to use net.blocklist API.
  • change the default empty string ('') default to undefined - which means that only when whitelist is undefined we will allow all, and not on empty string.

Expected behavior

  1. We expect NooBaa CLI to -
    • Be user-friendly.
    • Not writing stderr logs to the user unless specifying --verbose.
    • Have a flattened hierarchy.
    • Account/Bucket add action should be renamed to create.

Steps to reproduce

  1. run node src/cmd

More information - Screenshots / Logs / Other output

Example of indentation missing, missing info and stderr prints:

sudo node src/cmd/manage_nsfs account  --help
Error accrued while getting the data from /etc/noobaa.conf.d/config_dir_redirect: Error: ENOENT: no such file or directory, open '/etc/noobaa.conf.d/config_dir_redirect'
config.get_config_root - could not find custom config_root, will use the default config_root  /etc/noobaa.conf.d
load_nsfs_nc_config.setting config.NSFS_NC_CONF_DIR /etc/noobaa.conf.d
config.load_nsfs_nc_config could not find config.json... skipping
Usage:
account <action> [flags]

List of actions supported:
add
update
list
status
delete

Example of manage_nsfs invalidType error instead of help print -

sudo node src/cmd/manage_nsfs
Error accrued while getting the data from /etc/noobaa.conf.d/config_dir_redirect: Error: ENOENT: no such file or directory, open '/etc/noobaa.conf.d/config_dir_redirect'
config.get_config_root - could not find custom config_root, will use the default config_root  /etc/noobaa.conf.d
load_nsfs_nc_config.setting config.NSFS_NC_CONF_DIR /etc/noobaa.conf.d
config.load_nsfs_nc_config could not find config.json... skipping
{
  "error": {
    "code": "InvalidType",
    "message": "Invalid type, available types are account, bucket or whitelist"
  }
}
@guymguym guymguym modified the milestones: 5.15.4, 5.16.0 Apr 25, 2024
@nimrod-becker nimrod-becker added the Non Containerized Non containerized label May 1, 2024
@nimrod-becker nimrod-becker modified the milestones: 5.16.z, 5.17.0 May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non Containerized Non containerized
Projects
None yet
Development

No branches or pull requests

3 participants