Skip to content

Added a validation check for quota config in bucket#1418

Merged
aayushchouhan09 merged 1 commit intonoobaa:masterfrom
aayushchouhan09:quota-fix
Sep 26, 2024
Merged

Added a validation check for quota config in bucket#1418
aayushchouhan09 merged 1 commit intonoobaa:masterfrom
aayushchouhan09:quota-fix

Conversation

@aayushchouhan09
Copy link
Member

@aayushchouhan09 aayushchouhan09 commented Aug 22, 2024

Explain the changes

  1. Currently, bucket quota is not working as expected it is failing to update quota when we pass max-size in other then bytes format. We have added a validation check for the quota and applied some fixes to work with any format of max-size.

Issues: Fixed #xxx / Gap #xxx

  1. Improvement: Set quota directly on a bucket #1252

Testing Instructions:

  1. Update the bucket quota using various formats (Gi, Ti etc.) and verify the quota is correctly reflected in binary format using cli commands.
  2. Test invalid formats to ensure the system returns an error and does not update the quota.

if updateQuota {
err = nbClient.CreateBucketAPI(nb.CreateBucketParams{Name: bucketName, Tiering: tierName, ForceMd5Etag: forceMd5Etag})
if err == nil && updateQuota {
err = nbClient.UpdateBucketAPI(nb.CreateBucketParams{Name: bucketName, Quota: &quota})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we havn't added quota in create_bucket api, so we need to call update_bucket api with quota again here.

@vh05 @liranmauda Anything you want to add?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have not introduce there because we fully not supporting quota. @liranmauda @dannyzaken Please correct me if wrong

@aayushchouhan09 aayushchouhan09 requested review from a team and romayalon and removed request for a team August 28, 2024 05:31
if updateQuota {
err = nbClient.CreateBucketAPI(nb.CreateBucketParams{Name: bucketName, Tiering: tierName, ForceMd5Etag: forceMd5Etag})
if err == nil && updateQuota {
err = nbClient.UpdateBucketAPI(nb.CreateBucketParams{Name: bucketName, Quota: &quota})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have not introduce there because we fully not supporting quota. @liranmauda @dannyzaken Please correct me if wrong

@aayushchouhan09 aayushchouhan09 requested a review from vh05 September 3, 2024 13:45
Copy link
Contributor

@vh05 vh05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Contributor

@vec-tr vec-tr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squal and push the changes.

Copy link
Contributor

@vh05 vh05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash and push the changes

Signed-off-by: Aayush Chouhan <achouhan@redhat.com>
Copy link
Contributor

@vh05 vh05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\lgtm

@aayushchouhan09 aayushchouhan09 merged commit c6727ce into noobaa:master Sep 26, 2024
@aayushchouhan09 aayushchouhan09 deleted the quota-fix branch September 26, 2024 12:59
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