Skip to content

Commit

Permalink
333
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq committed Oct 9, 2024
1 parent a4e8fa7 commit 9df5f3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 2 additions & 10 deletions dbm-services/common/db-resource/internal/model/TbRpDetail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 规格信息
Expand Down

0 comments on commit 9df5f3d

Please sign in to comment.