mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
chore: do not set default volume driver to local, distinguish behaviour when it's set or not
This commit is contained in:
+9
-2
@@ -1,7 +1,6 @@
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -104,7 +103,15 @@ func assertContainerMountsMatchSpec(t *testing.T, mounts []mount.Mount, spec api
|
||||
|
||||
assert.Len(t, mounts, len(expectedMounts), "Expected %d mounts", len(expectedMounts))
|
||||
for i, m := range mounts {
|
||||
assert.True(t, reflect.DeepEqual(m, expectedMounts[i]), "Expected mount type=%s,src=%s,dst=%s to match spec")
|
||||
// The mount generated from the spec may not define the driver which means to use the default driver
|
||||
// if creating a new volume or mounting an existing one no matter what its driver is.
|
||||
// So skip driver comparison if the driver is not set in the spec.
|
||||
if expectedMounts[i].VolumeOptions != nil && expectedMounts[i].VolumeOptions.DriverConfig == nil &&
|
||||
m.VolumeOptions != nil {
|
||||
expectedMounts[i].VolumeOptions.DriverConfig = m.VolumeOptions.DriverConfig
|
||||
}
|
||||
assert.Equal(t, expectedMounts[i], m,
|
||||
"Expected mount type=%s,src=%s,dst=%s to match spec", m.Type, m.Source, m.Target)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -595,15 +595,8 @@ func TestDeployment(t *testing.T) {
|
||||
serviceName := "test-replicated-with-volume-single-machine"
|
||||
volumeName := serviceName
|
||||
t.Cleanup(func() {
|
||||
err := cli.RemoveService(ctx, serviceName)
|
||||
if !errors.Is(err, api.ErrNotFound) {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
err = cli.RemoveVolume(ctx, c.Machines[1].Name, volumeName, false)
|
||||
if !errors.Is(err, api.ErrNotFound) {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
removeServices(t, cli, serviceName)
|
||||
removeVolumes(t, cli, volumeName)
|
||||
})
|
||||
|
||||
vol, err := cli.CreateVolume(ctx, c.Machines[1].Name, volume.CreateOptions{Name: volumeName})
|
||||
|
||||
Reference in New Issue
Block a user