noobaa / noobaa-operator

Operator for NooBaa - object data service for hybrid and multi cloud environments :cloud: :wrench:
https://www.noobaa.io
Apache License 2.0
102 stars 99 forks source link

CLI Account Small Issues #1382

Open shirady opened 3 months ago

shirady commented 3 months ago

Environment info

NooBaa Operator Version: Current master (5.17.0) Platform: Kubernetes v1.27.3 | Rancher Desktop 1.12.3

Actual behavior

  1. If someone tries to run: nb account create --allow_bucket_create false -n test1 (without the account name) it creates an account with the name false.
  2. Flags names contain underscore instead of hyphen, for example: --allow_bucket_create.
  3. When using the nb account delete get the error: FATA[0000] ❌ Missing expected arguments: <bucket-class-name> which doesn't have the same argument as the usage: noobaa account delete <noobaa-account-name> [flags] [options].

Expected behavior

  1. It should throw an error Missing expected arguments: <noobaa-account-name>.
  2. Flags names should contain hyphens between words, for example: --allow_bucket_create
  3. It should throw error FATA[0000] ❌ Missing expected arguments: <noobaa-account-name> on nb account delete.

Steps to reproduce

Deploy noobaa system on k8s cluster (can use local deployment). Every number is for one issue:

  1. nb account create --allow_bucket_create false -n test1
  2. nb account create --help
  3. noobaa account delete

More information - Screenshots / Logs / Other output

Output: nb account create --allow_bucket_create false -n test1

INFO[0000] ✅ Exists: NooBaa "noobaa"
INFO[0000] ✅ Created: NooBaaAccount "false"
INFO[0000]
INFO[0000] NOTE:
INFO[0000]   - This command has finished applying changes to the cluster.
INFO[0000]   - From now on, it only loops and reads the status, to monitor the operator work.
INFO[0000]   - You may Ctrl-C at any time to stop the loop and watch it manually.
INFO[0000]
INFO[0000] NooBaaAccount Wait Ready:
INFO[0000] ⏳ NooBaaAccount "false" Phase is "": waiting...
INFO[0003] ✅ NooBaaAccount "false" Phase is Ready
INFO[0003]
INFO[0003]
INFO[0003] ✅ Exists: NooBaaAccount "false"
INFO[0003] ✅ NooBaaAccount "false" Phase is Ready

# NooBaaAccount spec:
allow_bucket_creation: true
default_resource: noobaa-default-backing-store
force_md5_etag: false

INFO[0003] ✅ Exists: Secret "noobaa-account-false"
Connection info:
  AWS_SECRET_ACCESS_KEY  : ****
  AWS_ACCESS_KEY_ID      : ****