mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
add VolumeScheduler with one flaky test
This commit is contained in:
@@ -61,6 +61,18 @@ func (s *ServiceSpec) Volume(name string) (VolumeSpec, bool) {
|
||||
return VolumeSpec{}, false
|
||||
}
|
||||
|
||||
// MountedDockerVolumes returns the list of volumes of VolumeTypeVolume type that are mounted into the container.
|
||||
func (s *ServiceSpec) MountedDockerVolumes() []VolumeSpec {
|
||||
volumes := make(map[string]VolumeSpec)
|
||||
for _, m := range s.Container.VolumeMounts {
|
||||
if v, ok := s.Volume(m.VolumeName); ok && v.Type == VolumeTypeVolume {
|
||||
volumes[v.Name] = v
|
||||
}
|
||||
}
|
||||
|
||||
return slices.Collect(maps.Values(volumes))
|
||||
}
|
||||
|
||||
func (s *ServiceSpec) SetDefaults() ServiceSpec {
|
||||
spec := s.Clone()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user