]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Make API backward compatible with size param change
authorAfreen Misbah <afreen@ibm.com>
Tue, 18 Feb 2025 11:24:19 +0000 (16:54 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 4 Mar 2025 07:49:51 +0000 (13:19 +0530)
- We changed the api with size and now its an issue for other folks utilizing the API
- Hence making it compatible to work backwards as well

Fixes https://tracker.ceph.com/issues/70020

Signed-off-by: Afreen Misbah <afreen@ibm.com>
(cherry picked from commit 5d5cf5b42250d9107c6d20dbefadbb8700eb1e9c)

src/pybind/mgr/dashboard/controllers/nvmeof.py
src/pybind/mgr/dashboard/openapi.yaml

index 182cdf10e3288047cd59470cc6066d097f9f501f..0b8deecc364c319a402500b0abc083d7cdedc42a 100644 (file)
@@ -251,6 +251,7 @@ else:
                 "rbd_pool": Param(str, "RBD pool name"),
                 "rbd_image_name": Param(str, "RBD image name"),
                 "create_image": Param(bool, "Create RBD image"),
+                "size": Param(int, "RBD image size"),
                 "rbd_image_size": Param(int, "RBD image size"),
                 "block_size": Param(int, "NVMeoF namespace block size"),
                 "load_balancing_group": Param(int, "Load balancing group"),
@@ -265,7 +266,8 @@ else:
             rbd_image_name: str,
             rbd_pool: str = "rbd",
             create_image: Optional[bool] = True,
-            rbd_image_size: Optional[int] = 1024,
+            size: Optional[int] = 1024,
+            rbd_image_size: Optional[int] = None,
             block_size: int = 512,
             load_balancing_group: Optional[int] = None,
             gw_group: Optional[str] = None,
@@ -277,7 +279,7 @@ else:
                     rbd_pool_name=rbd_pool,
                     block_size=block_size,
                     create_image=create_image,
-                    size=rbd_image_size,
+                    size=rbd_image_size or size,
                     anagrpid=load_balancing_group,
                 )
             )
index a24d3cdd75a23c8891a5e40974124531be2e9910..d9be9f43fdf70a366e81719d46bcd0469fbd57ff 100644 (file)
@@ -8420,13 +8420,16 @@ paths:
                   description: RBD image name
                   type: string
                 rbd_image_size:
-                  default: 1024
                   description: RBD image size
                   type: integer
                 rbd_pool:
                   default: rbd
                   description: RBD pool name
                   type: string
+                size:
+                  default: 1024
+                  description: RBD image size
+                  type: integer
               required:
               - rbd_image_name
               type: object