mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
cleanup: fix errors in wrapped format and log capitalization in controller
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
This commit is contained in:
@@ -344,7 +344,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
|
||||
volume, err := ctrl.volumes.findBestMatchForClaim(claim, delayBinding)
|
||||
if err != nil {
|
||||
klog.V(2).Infof("synchronizing unbound PersistentVolumeClaim[%s]: Error finding PV for claim: %v", claimToClaimKey(claim), err)
|
||||
return fmt.Errorf("Error finding PV for claim %q: %v", claimToClaimKey(claim), err)
|
||||
return fmt.Errorf("error finding PV for claim %q: %w", claimToClaimKey(claim), err)
|
||||
}
|
||||
if volume == nil {
|
||||
klog.V(4).Infof("synchronizing unbound PersistentVolumeClaim[%s]: no volume found", claimToClaimKey(claim))
|
||||
@@ -410,7 +410,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
|
||||
} else {
|
||||
volume, ok := obj.(*v1.PersistentVolume)
|
||||
if !ok {
|
||||
return fmt.Errorf("Cannot convert object from volume cache to volume %q!?: %+v", claim.Spec.VolumeName, obj)
|
||||
return fmt.Errorf("cannot convert object from volume cache to volume %q!?: %+v", claim.Spec.VolumeName, obj)
|
||||
}
|
||||
klog.V(4).Infof("synchronizing unbound PersistentVolumeClaim[%s]: volume %q requested and found: %s", claimToClaimKey(claim), claim.Spec.VolumeName, getVolumeStatusForLogging(volume))
|
||||
if volume.Spec.ClaimRef == nil {
|
||||
@@ -463,7 +463,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
|
||||
claimMsg := fmt.Sprintf("volume %q already bound to a different claim.", volume.Name)
|
||||
ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, events.FailedBinding, claimMsg)
|
||||
|
||||
return fmt.Errorf("Invalid binding of claim %q to volume %q: volume already claimed by %q", claimToClaimKey(claim), claim.Spec.VolumeName, claimrefToClaimKey(volume.Spec.ClaimRef))
|
||||
return fmt.Errorf("invalid binding of claim %q to volume %q: volume already claimed by %q", claimToClaimKey(claim), claim.Spec.VolumeName, claimrefToClaimKey(volume.Spec.ClaimRef))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,7 +497,7 @@ func (ctrl *PersistentVolumeController) syncBoundClaim(claim *v1.PersistentVolum
|
||||
} else {
|
||||
volume, ok := obj.(*v1.PersistentVolume)
|
||||
if !ok {
|
||||
return fmt.Errorf("Cannot convert object from volume cache to volume %q!?: %#v", claim.Spec.VolumeName, obj)
|
||||
return fmt.Errorf("cannot convert object from volume cache to volume %q!?: %#v", claim.Spec.VolumeName, obj)
|
||||
}
|
||||
|
||||
klog.V(4).Infof("synchronizing bound PersistentVolumeClaim[%s]: volume %q found: %s", claimToClaimKey(claim), claim.Spec.VolumeName, getVolumeStatusForLogging(volume))
|
||||
@@ -615,7 +615,7 @@ func (ctrl *PersistentVolumeController) syncVolume(volume *v1.PersistentVolume)
|
||||
var ok bool
|
||||
claim, ok = obj.(*v1.PersistentVolumeClaim)
|
||||
if !ok {
|
||||
return fmt.Errorf("Cannot convert object from volume cache to volume %q!?: %#v", claim.Spec.VolumeName, obj)
|
||||
return fmt.Errorf("cannot convert object from volume cache to volume %q!?: %#v", claim.Spec.VolumeName, obj)
|
||||
}
|
||||
klog.V(4).Infof("synchronizing PersistentVolume[%s]: claim %s found: %s", volume.Name, claimrefToClaimKey(volume.Spec.ClaimRef), getClaimStatusForLogging(claim))
|
||||
}
|
||||
@@ -1323,7 +1323,7 @@ func (ctrl *PersistentVolumeController) isVolumeReleased(volume *v1.PersistentVo
|
||||
var ok bool
|
||||
claim, ok = obj.(*v1.PersistentVolumeClaim)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("Cannot convert object from claim cache to claim!?: %#v", obj)
|
||||
return false, fmt.Errorf("cannot convert object from claim cache to claim!?: %#v", obj)
|
||||
}
|
||||
}
|
||||
if claim != nil && claim.UID == volume.Spec.ClaimRef.UID {
|
||||
@@ -1422,7 +1422,7 @@ func (ctrl *PersistentVolumeController) doDeleteVolume(volume *v1.PersistentVolu
|
||||
deleter, err := plugin.NewDeleter(spec)
|
||||
if err != nil {
|
||||
// Cannot create deleter
|
||||
return pluginName, false, fmt.Errorf("Failed to create deleter for volume %q: %v", volume.Name, err)
|
||||
return pluginName, false, fmt.Errorf("failed to create deleter for volume %q: %w", volume.Name, err)
|
||||
}
|
||||
|
||||
opComplete := util.OperationCompleteHook(pluginName, "volume_delete")
|
||||
@@ -1832,7 +1832,7 @@ func (ctrl *PersistentVolumeController) findDeletablePlugin(volume *v1.Persisten
|
||||
plugin, err := ctrl.volumePluginMgr.FindDeletablePluginBySpec(spec)
|
||||
if err != nil {
|
||||
// No deleter found. Emit an event and mark the volume Failed.
|
||||
return nil, fmt.Errorf("Error getting deleter volume plugin for volume %q: %v", volume.Name, err)
|
||||
return nil, fmt.Errorf("error getting deleter volume plugin for volume %q: %w", volume.Name, err)
|
||||
}
|
||||
return plugin, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user