From 4cb7479312953e83d25695cbf0da431b772722c8 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Thu, 26 Aug 2021 08:30:42 +0800 Subject: [PATCH] set AllowLongNodeID to true by default since 1.23 --- pkg/registry/storage/csinode/strategy.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pkg/registry/storage/csinode/strategy.go b/pkg/registry/storage/csinode/strategy.go index 21f168e1d49..5341f1bd36d 100644 --- a/pkg/registry/storage/csinode/strategy.go +++ b/pkg/registry/storage/csinode/strategy.go @@ -47,11 +47,8 @@ func (csiNodeStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) func (csiNodeStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { csiNode := obj.(*storage.CSINode) - - // in 1.22, on create, set AllowLongNodeID=false - // in 1.23, on create, set AllowLongNodeID=true validateOptions := validation.CSINodeValidationOptions{ - AllowLongNodeID: false, + AllowLongNodeID: true, } errs := validation.ValidateCSINode(csiNode, validateOptions) @@ -77,16 +74,8 @@ func (csiNodeStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Ob func (csiNodeStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { newCSINodeObj := obj.(*storage.CSINode) oldCSINodeObj := old.(*storage.CSINode) - // in 1.22 on update, set AllowLongNodeID to true only if the old object already has a long node ID - // in 1.23 on update, set AllowLongNodeID=true - allowLongNodeID := false - for _, nodeDriver := range oldCSINodeObj.Spec.Drivers { - if validation.CSINodeLongerID(nodeDriver.NodeID) { - allowLongNodeID = true - } - } validateOptions := validation.CSINodeValidationOptions{ - AllowLongNodeID: allowLongNodeID, + AllowLongNodeID: true, } errorList := validation.ValidateCSINode(newCSINodeObj, validateOptions)