From 6d12f2de1027245f027f992bc693ea904ed06459 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 27 Aug 2019 13:55:44 +0200 Subject: [PATCH] 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. --- pkg/apis/storage/fuzzer/fuzzer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/storage/fuzzer/fuzzer.go b/pkg/apis/storage/fuzzer/fuzzer.go index ea1de3ddacf..a059856cc7f 100644 --- a/pkg/apis/storage/fuzzer/fuzzer.go +++ b/pkg/apis/storage/fuzzer/fuzzer.go @@ -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, }