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 规格信息