chore: do not set default volume driver to local, distinguish behaviour when it's set or not

This commit is contained in:
Pavel Sviderski
2025-04-21 16:53:43 +10:00
parent 835c310987
commit 143e68cc95
9 changed files with 128 additions and 55 deletions
+1
View File
@@ -138,6 +138,7 @@ func (s *VolumeScheduler) Schedule() (map[string][]api.VolumeSpec, error) {
// For each volume that exists on any machine(s) (which shouldn't be created), intersect each service's
// eligible machines that use the volume with the machines the volume is located on.
//
// Service name -> list of processed volume names (quoted) to format the error message.
quotedServiceVolumes := make(map[string][]string)
for volumeName, volumeMachines := range s.existingVolumeMachines {
+23 -5
View File
@@ -521,6 +521,11 @@ func TestVolumeScheduler_Schedule(t *testing.T) {
{
Name: "vol2",
Type: api.VolumeTypeVolume,
VolumeOptions: &api.VolumeOptions{
Driver: &mount.Driver{
Name: api.VolumeDriverLocal,
},
},
},
{
Name: "vol3",
@@ -547,15 +552,17 @@ func TestVolumeScheduler_Schedule(t *testing.T) {
{
Name: "vol2",
Type: api.VolumeTypeVolume,
VolumeOptions: &api.VolumeOptions{
Driver: &mount.Driver{
Name: api.VolumeDriverLocal,
},
},
},
{
Name: "vol4-alias",
Type: api.VolumeTypeVolume,
VolumeOptions: &api.VolumeOptions{
Name: "vol4",
Driver: &mount.Driver{
Name: api.VolumeDriverLocal,
},
},
},
},
@@ -570,7 +577,7 @@ func TestVolumeScheduler_Schedule(t *testing.T) {
ContainerPath: "/data2",
},
{
VolumeName: "vol5",
VolumeName: "vol5-with-driver",
ContainerPath: "/data5",
},
},
@@ -587,8 +594,14 @@ func TestVolumeScheduler_Schedule(t *testing.T) {
},
},
{
Name: "vol5",
Name: "vol5-with-driver",
Type: api.VolumeTypeVolume,
VolumeOptions: &api.VolumeOptions{
Name: "vol5",
Driver: &mount.Driver{
Name: api.VolumeDriverLocal,
},
},
},
},
},
@@ -598,6 +611,11 @@ func TestVolumeScheduler_Schedule(t *testing.T) {
{
Name: "vol5",
Type: api.VolumeTypeVolume,
VolumeOptions: &api.VolumeOptions{
Driver: &mount.Driver{
Name: api.VolumeDriverLocal,
},
},
},
},
"machine3": {