Skip to content

Commit

Permalink
feature: 支持Taints、Tolerations调度能力 TencentBlueKing#398
Browse files Browse the repository at this point in the history
  • Loading branch information
zmberg committed Mar 5, 2020
1 parent ffd9fc2 commit a02738e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bcs-mesos/bcs-scheduler/src/manager/sched/strategy/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ import (

// Check whether an offer matches with the constraints for an application
func ConstraintsFit(version *types.Version, offer *mesos.Offer, store store.Store, taskgroupID string) (bool, error) {

constraints := version.Constraints
//taints & toleration
attribute, _ := offerP.GetOfferAttribute(offer, types.MesosAttributeNoSchedule)
if attribute!=nil {

}

var itemInsance int
if constraints == nil && !isVersionRequestIp(version) {
blog.V(3).Infof("to check constraints: version(%s.%s) not set constraints", version.RunAs, version.ID)
Expand Down Expand Up @@ -113,12 +118,6 @@ func contraintDataFit(constraint *commtypes.ConstraintData, offer *mesos.Offer,
}

var attribute *mesos.Attribute
//taints & toleration
attribute, _ = offerP.GetOfferAttribute(offer, types.MesosAttributeNoSchedule)
if attribute!=nil {

}

// construct an attribute for hostname
if name == "hostname" {
var attr mesos.Attribute
Expand Down Expand Up @@ -331,7 +330,7 @@ func checkGreater(constraint *commtypes.ConstraintData, attribute *mesos.Attribu
return false, nil
}

func checkToleration(offer , attribute *mesos.Attribute) (bool, error) {
func checkToleration(constraint *commtypes.Constraint , offer *mesos.Offer) (bool, error) {
blog.V(3).Infof("constraint Toleration by attribute(name:%s)", constraint.Name)

switch constraint.Type {
Expand Down

0 comments on commit a02738e

Please sign in to comment.