mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
chore: implement VolumesConstraint to only schedule on machines with required volumes
This commit is contained in:
1 parent
03c2681792
commit
1acb0ff110
5 files changed
+288
-5
No files matched your search
@@ -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