chore: implement VolumesConstraint to only schedule on machines with required volumes

This commit is contained in:
Pavel Sviderski
2025-04-17 21:34:52 +10:00
parent 03c2681792
commit 1acb0ff110
5 changed files with 288 additions and 5 deletions
+9
View File
@@ -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()