From 8ae6e10fd0ccf28f60d505e2aec7aacdcb9470d9 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Mon, 28 Feb 2022 19:32:43 +0530 Subject: [PATCH] csi: correct typo and use strings.Repeat func for long driver name Signed-off-by: Humble Chirammal --- pkg/apis/core/validation/validation_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index b9748b9b418..9144cadb982 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -2583,7 +2583,7 @@ func TestValidateCSIVolumeSource(t *testing.T) { errfield: "driver", }, { - name: "driver name: ok beginnin with number", + name: "driver name: ok beginning with number", csi: &core.CSIPersistentVolumeSource{Driver: "2io.kubernetes.storage-csi.flex", VolumeHandle: "test-123"}, }, { @@ -2608,7 +2608,7 @@ func TestValidateCSIVolumeSource(t *testing.T) { }, { name: "driver name: invalid length > 63", - csi: &core.CSIPersistentVolumeSource{Driver: "comgooglestoragecsigcepdcomgooglestoragecsigcepdcomgooglestoragecsigcepdcomgooglestoragecsigcepd", VolumeHandle: "test-123"}, + csi: &core.CSIPersistentVolumeSource{Driver: strings.Repeat("g", 65), VolumeHandle: "test-123"}, errtype: field.ErrorTypeTooLong, errfield: "driver", },