mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 03:53:33 +00:00
chore: replace machine filter with placement constraint in service spec
This commit is contained in:
@@ -16,10 +16,22 @@ type Constraint interface {
|
||||
}
|
||||
|
||||
func constraintsFromSpec(spec api.ServiceSpec) []Constraint {
|
||||
return []Constraint{}
|
||||
var constraints []Constraint
|
||||
|
||||
if len(spec.Placement.Machines) > 0 {
|
||||
constraints = append(constraints, &PlacementConstraint{
|
||||
Machines: spec.Placement.Machines,
|
||||
})
|
||||
}
|
||||
|
||||
// TODO: inspect and add VolumeConstraint.
|
||||
|
||||
return constraints
|
||||
}
|
||||
|
||||
type PlacementConstraint struct {
|
||||
// Machines is a list of machine names or IDs where service containers are allowed to be deployed.
|
||||
// If empty, containers can be deployed to any available machine in the cluster.
|
||||
Machines []string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user