mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat: Add method 'Sku' to CandidatePropertyGetter
This commit is contained in:
+6
@@ -30,6 +30,7 @@ import (
|
||||
computemodels "yunion.io/x/onecloud/pkg/compute/models"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/api"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/core"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/data_manager/sku"
|
||||
schedmodels "yunion.io/x/onecloud/pkg/scheduler/models"
|
||||
)
|
||||
|
||||
@@ -124,6 +125,11 @@ func (b baseHostGetter) HostSchedtags() []computemodels.SSchedtag {
|
||||
return b.h.HostSchedtags
|
||||
}
|
||||
|
||||
func (b baseHostGetter) Sku(instanceType string) *sku.ServerSku {
|
||||
zone := b.Zone()
|
||||
return sku.GetByZone(instanceType, zone.GetId())
|
||||
}
|
||||
|
||||
func (b baseHostGetter) Storages() []*api.CandidateStorage {
|
||||
return b.h.Storages
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
computemodels "yunion.io/x/onecloud/pkg/compute/models"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/api"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/core/score"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/data_manager/sku"
|
||||
schedmodels "yunion.io/x/onecloud/pkg/scheduler/models"
|
||||
)
|
||||
|
||||
@@ -74,6 +75,7 @@ type CandidatePropertyGetter interface {
|
||||
Region() *computemodels.SCloudregion
|
||||
HostType() string
|
||||
HostSchedtags() []computemodels.SSchedtag
|
||||
Sku(string) *sku.ServerSku
|
||||
Storages() []*api.CandidateStorage
|
||||
Networks() []*api.CandidateNetwork
|
||||
OvnCapable() bool
|
||||
|
||||
Reference in New Issue
Block a user