jobspec: define DiffID for Constraint and Affinity (#26134)

This commit is contained in:
Elijah Wright
2025-06-25 08:42:25 -07:00
committed by GitHub
parent 7647491588
commit f76d9e0cec

View File

@@ -9954,6 +9954,11 @@ func (c *Constraint) Validate() error {
return mErr.ErrorOrNil()
}
// DiffID fulfills the DiffableWithID interface.
func (c *Constraint) DiffID() string {
return c.String()
}
type Constraints []*Constraint
// Equal compares Constraints as a set
@@ -10070,6 +10075,11 @@ func (a *Affinity) Validate() error {
return mErr.ErrorOrNil()
}
// DiffID fulfills the DiffableWithID interface.
func (a *Affinity) DiffID() string {
return a.String()
}
// Spread is used to specify desired distribution of allocations according to weight
type Spread struct {
// Attribute is the node attribute used as the spread criteria