mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
fix: Add context comment and adjust logger usage in volume_host
This commit is contained in:
parent
6a7c2e22f5
commit
20cc3d7e3d
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue