From a11e6a80a1a779e954478e8a3e3a585df37282b8 Mon Sep 17 00:00:00 2001 From: Silvan Kaiser Date: Wed, 24 Jul 2019 11:32:47 +0200 Subject: [PATCH] Removes conflicting Quobyte tenant test error from API validation --- pkg/apis/core/validation/validation.go | 2 -- pkg/apis/core/validation/validation_test.go | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/apis/core/validation/validation.go b/pkg/apis/core/validation/validation.go index a819a701b4e..827cec2a72f 100644 --- a/pkg/apis/core/validation/validation.go +++ b/pkg/apis/core/validation/validation.go @@ -904,8 +904,6 @@ func validateQuobyteVolumeSource(quobyte *core.QuobyteVolumeSource, fldPath *fie allErrs := field.ErrorList{} if len(quobyte.Registry) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("registry"), "must be a host:port pair or multiple pairs separated by commas")) - } else if len(quobyte.Tenant) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("tenant"), "must be a UUID provided by the configuration and may not be omitted ")) } else if len(quobyte.Tenant) >= 65 { allErrs = append(allErrs, field.Required(fldPath.Child("tenant"), "must be a UUID and may not exceed a length of 64 characters")) } else { diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index 7ea25cd1339..e0d77155428 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -3659,16 +3659,12 @@ func TestValidateVolumes(t *testing.T) { Name: "quobyte", VolumeSource: core.VolumeSource{ Quobyte: &core.QuobyteVolumeSource{ - Registry: "registry:7861,reg2", + Registry: "registry:7861", Volume: "/test", Tenant: "", }, }, }, - errs: []verr{{ - etype: field.ErrorTypeRequired, - field: "quobyte.tenant", - }}, }, { name: "too long tenant quobyte", @@ -3676,7 +3672,7 @@ func TestValidateVolumes(t *testing.T) { Name: "quobyte", VolumeSource: core.VolumeSource{ Quobyte: &core.QuobyteVolumeSource{ - Registry: "registry:7861,reg2", + Registry: "registry:7861", Volume: "/test", Tenant: "this is too long to be a valid uuid so this test has to fail on the maximum length validation of the tenant.", },