Skip to content

the inputs for capacity bytes in edit option of storage pool are not validated to be positive #14221

Description

@sathvikaragi

problem

The updateStoragePool API currently accepts zero or negative values for capacity-related parameters. Add positive-number validation so invalid values are rejected with Invalid parameter error. This prevents invalid storage pool capacity settings from reaching backend processing.

versions

The versions of ACS, hypervisors, storage, network etc..

Checked on 4.23

The steps to reproduce the bug

  1. Click on edit option for storage pool
  2. Input a negative number for capacity bytes
    3.click on OK to edit it.

you see an error as : Unable to update on DB, due to: Data truncation: Out of range value for column 'capacity_bytes' at row 1

instead of throwing an error for invalid parameter.
...

What to do about it?

Before this fix : When I tried to update a default primary storage pool using a negative value

Image

when I tried to input 0 as capacity bytes for storage pool: It is updating it to 0

Image

Add positive-number validation to the capacity bytes parameter in the updateStoragePool API. If a user provides zero or a negative value, reject the request immediately with a clear invalid-parameter error instead of sending it for backend processing.

After the fix:

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions