From 41c65f47406057e24492dfdbab4d93bbae137a15 Mon Sep 17 00:00:00 2001 From: David Zhu Date: Thu, 14 Nov 2019 23:51:58 -0800 Subject: [PATCH] Jump out of spec translation early if the spec is not migratable. Unit tests work after all! --- pkg/controller/volume/attachdetach/util/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/volume/attachdetach/util/util.go b/pkg/controller/volume/attachdetach/util/util.go index 72c973d8e17..29545e7dec5 100644 --- a/pkg/controller/volume/attachdetach/util/util.go +++ b/pkg/controller/volume/attachdetach/util/util.go @@ -282,6 +282,10 @@ func translateInTreeSpecToCSIIfNeeded(spec *volume.Spec, nodeName types.NodeName if err != nil { return nil, err } + if !migratable { + // Jump out of translation fast so we don't check the node if the spec itself is not migratable + return spec, nil + } migrationSupportedOnNode, err := isCSIMigrationSupportedOnNode(nodeName, spec, vpm, csiMigratedPluginManager) if err != nil { return nil, err