From 9df5f3d84844915937d51a1a3ead8731b91d1605 Mon Sep 17 00:00:00 2001 From: yuanruji Date: Wed, 9 Oct 2024 11:54:37 +0800 Subject: [PATCH] 333 --- .../common/db-resource/internal/model/TbRpDetail.go | 12 ++---------- .../db-resource/internal/svr/dbmapi/dbm_spec.go | 8 +++++++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dbm-services/common/db-resource/internal/model/TbRpDetail.go b/dbm-services/common/db-resource/internal/model/TbRpDetail.go index c9e94d2973..f55361f2f5 100644 --- a/dbm-services/common/db-resource/internal/model/TbRpDetail.go +++ b/dbm-services/common/db-resource/internal/model/TbRpDetail.go @@ -155,16 +155,8 @@ func (t TbRpDetail) MatchDbmSpec(spec dbmapi.DbmSpec) bool { return false } } - // 如果规格配置了上限 - switch { - case diskSpec.MaxSize > 0: - if !isWithinRange(realDiskInfo.Size, diskSpec.MinSize, diskSpec.MaxSize) { - return false - } - case diskSpec.MaxSize <= 0 && diskSpec.MinSize > 0: - if realDiskInfo.Size < diskSpec.MinSize { - return false - } + if realDiskInfo.Size < diskSpec.Size { + return false } } } diff --git a/dbm-services/common/db-resource/internal/svr/dbmapi/dbm_spec.go b/dbm-services/common/db-resource/internal/svr/dbmapi/dbm_spec.go index de239a6193..1880cb9a85 100644 --- a/dbm-services/common/db-resource/internal/svr/dbmapi/dbm_spec.go +++ b/dbm-services/common/db-resource/internal/svr/dbmapi/dbm_spec.go @@ -34,7 +34,13 @@ type DbmSpec struct { DeviceClass []string `json:"device_class"` Mem meta.MeasureRange `json:"mem"` Cpu meta.MeasureRange `json:"cpu"` - StorageSpecs []meta.DiskSpec `json:"storage_spec"` + StorageSpecs []RealDiskSpec `json:"storage_spec"` +} + +type RealDiskSpec struct { + DiskType string `json:"type"` + Size int `json:"size"` + MountPoint string `json:"mount_point"` } // DbmSpecBaseResp dbm 规格信息