From 4566b54b4da753911b21ba61d90250178c626757 Mon Sep 17 00:00:00 2001 From: Tim Ebert Date: Fri, 23 Aug 2024 12:24:20 +0200 Subject: [PATCH] Don't track attachments of NFS volumes --- pkg/util/provider/drain/drain.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/util/provider/drain/drain.go b/pkg/util/provider/drain/drain.go index a2fd390e5..575170792 100644 --- a/pkg/util/provider/drain/drain.go +++ b/pkg/util/provider/drain/drain.go @@ -970,6 +970,13 @@ func (o *Options) getVolIDsFromDriver(ctx context.Context, pvNames []string) ([] continue } + // NFS volumes don't need to be attached to nodes only mounted, i.e., they won't appear in the + // node.status.volumesAttached section and there won't be any VolumeAttachments for it (as it's a built-in volume + // plugin, no CSI). + if pv.Spec.PersistentVolumeSource.NFS != nil { + continue + } + // Found PV; append and exit pvSpecs = append(pvSpecs, &pv.Spec) break