storage: fix CSIInlineVolume round-trip test

When adding CSIDriver.Spec.VolumeLifecycleModes, the defaulting in
pkg/apis/storage/fuzzer/fuzzer.go did not quite match the one from
pkg/apis/storage/v1beta1/defaults.go, causing a test failure when the
corresponding feature gate is enabled.
This commit is contained in:
Patrick Ohly 2019-08-27 13:55:44 +02:00
parent 39724859b5
commit 6d12f2de10

View File

@ -78,7 +78,7 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
obj.Spec.PodInfoOnMount = new(bool)
*(obj.Spec.PodInfoOnMount) = false
}
if obj.Spec.VolumeLifecycleModes == nil {
if len(obj.Spec.VolumeLifecycleModes) == 0 {
obj.Spec.VolumeLifecycleModes = []storage.VolumeLifecycleMode{
storage.VolumeLifecyclePersistent,
}