mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-24 02:26:39 +08:00
Support pod container (#19706)
* feat(region,scheduler,host): support pod and container * feat(region,host): container nvidia gpu support * fix(region,host): function parameters --------- Co-authored-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
@@ -19,8 +19,8 @@ import (
|
||||
|
||||
"yunion.io/x/log"
|
||||
|
||||
computeapi "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/algorithm/predicates"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/api"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/core"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/data_manager/schedtag"
|
||||
)
|
||||
@@ -56,7 +56,7 @@ func hostHasContainerTag(c core.Candidater) bool {
|
||||
func hostAllowRunContainer(c core.Candidater) bool {
|
||||
getter := c.Getter()
|
||||
hostType := getter.HostType()
|
||||
if hostType == api.HostTypeKubelet {
|
||||
if hostType == computeapi.HOST_TYPE_CONTAINER {
|
||||
return true
|
||||
}
|
||||
if hostHasContainerTag(c) {
|
||||
@@ -73,7 +73,7 @@ func (f *HypervisorPredicate) Execute(ctx context.Context, u *core.Unit, c core.
|
||||
guestNeedType := u.SchedData().Hypervisor
|
||||
|
||||
if guestNeedType != hostType {
|
||||
if guestNeedType == api.SchedTypeContainer && hostAllowRunContainer(c) {
|
||||
if guestNeedType == computeapi.HYPERVISOR_POD && hostAllowRunContainer(c) {
|
||||
return h.GetResult()
|
||||
}
|
||||
h.Exclude2(f.Name(), hostType, guestNeedType)
|
||||
|
||||
Reference in New Issue
Block a user