fix: Add context comment and adjust logger usage in volume_host

This commit is contained in:
kaveh 2026-04-27 22:35:49 +02:00
parent 6a7c2e22f5
commit 20cc3d7e3d

View file

@ -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)
}