mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03: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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user