mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
chore: implement VolumesConstraint to only schedule on machines with required volumes
This commit is contained in:
@@ -52,6 +52,15 @@ type ServiceSpec struct {
|
||||
Volumes []VolumeSpec
|
||||
}
|
||||
|
||||
func (s *ServiceSpec) Volume(name string) (VolumeSpec, bool) {
|
||||
for _, v := range s.Volumes {
|
||||
if v.Name == name {
|
||||
return v, true
|
||||
}
|
||||
}
|
||||
return VolumeSpec{}, false
|
||||
}
|
||||
|
||||
func (s *ServiceSpec) SetDefaults() ServiceSpec {
|
||||
spec := s.Clone()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user