From 20cc3d7e3d03fd533ea77319da120d7180319c67 Mon Sep 17 00:00:00 2001 From: kaveh Date: Mon, 27 Apr 2026 22:35:49 +0200 Subject: [PATCH] fix: Add context comment and adjust logger usage in volume_host --- pkg/kubelet/volume_host.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/volume_host.go b/pkg/kubelet/volume_host.go index f281bc0a527..3cc18f1ceb7 100644 --- a/pkg/kubelet/volume_host.go +++ b/pkg/kubelet/volume_host.go @@ -191,13 +191,16 @@ func (kvh *kubeletVolumeHost) NewWrapperMounter( volName string, spec volume.Spec, pod *v1.Pod) (volume.Mounter, error) { + // Use context.TODO() because we currently do not have a proper context to pass in. + // Replace this with an appropriate context when refactoring this function to accept a context parameter. + logger := klog.FromContext(context.TODO()) + // The name of wrapper volume is set to "wrapped_{wrapped_volume_name}" wrapperVolumeName := "wrapped_" + volName if spec.Volume != nil { spec.Volume.Name = wrapperVolumeName } - logger := klog.FromContext(context.TODO()) return kvh.kubelet.newVolumeMounterFromPlugins(logger, &spec, pod) }