mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
pv controller clean code
This commit is contained in:
parent
c6c03477cf
commit
a5b121724d
@ -1045,12 +1045,7 @@ func (ctrl *PersistentVolumeController) reclaimVolume(volume *v1.PersistentVolum
|
|||||||
|
|
||||||
// doRerecycleVolumeOperationcycleVolume recycles a volume. This method is
|
// doRerecycleVolumeOperationcycleVolume recycles a volume. This method is
|
||||||
// running in standalone goroutine and already has all necessary locks.
|
// running in standalone goroutine and already has all necessary locks.
|
||||||
func (ctrl *PersistentVolumeController) recycleVolumeOperation(arg interface{}) {
|
func (ctrl *PersistentVolumeController) recycleVolumeOperation(volume *v1.PersistentVolume) {
|
||||||
volume, ok := arg.(*v1.PersistentVolume)
|
|
||||||
if !ok {
|
|
||||||
glog.Errorf("Cannot convert recycleVolumeOperation argument to volume, got %#v", arg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
glog.V(4).Infof("recycleVolumeOperation [%s] started", volume.Name)
|
glog.V(4).Infof("recycleVolumeOperation [%s] started", volume.Name)
|
||||||
|
|
||||||
// This method may have been waiting for a volume lock for some time.
|
// This method may have been waiting for a volume lock for some time.
|
||||||
@ -1134,13 +1129,7 @@ func (ctrl *PersistentVolumeController) recycleVolumeOperation(arg interface{})
|
|||||||
|
|
||||||
// deleteVolumeOperation deletes a volume. This method is running in standalone
|
// deleteVolumeOperation deletes a volume. This method is running in standalone
|
||||||
// goroutine and already has all necessary locks.
|
// goroutine and already has all necessary locks.
|
||||||
func (ctrl *PersistentVolumeController) deleteVolumeOperation(arg interface{}) error {
|
func (ctrl *PersistentVolumeController) deleteVolumeOperation(volume *v1.PersistentVolume) error {
|
||||||
volume, ok := arg.(*v1.PersistentVolume)
|
|
||||||
if !ok {
|
|
||||||
glog.Errorf("Cannot convert deleteVolumeOperation argument to volume, got %#v", arg)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
glog.V(4).Infof("deleteVolumeOperation [%s] started", volume.Name)
|
glog.V(4).Infof("deleteVolumeOperation [%s] started", volume.Name)
|
||||||
|
|
||||||
// This method may have been waiting for a volume lock for some time.
|
// This method may have been waiting for a volume lock for some time.
|
||||||
@ -1331,13 +1320,7 @@ func (ctrl *PersistentVolumeController) provisionClaim(claim *v1.PersistentVolum
|
|||||||
|
|
||||||
// provisionClaimOperation provisions a volume. This method is running in
|
// provisionClaimOperation provisions a volume. This method is running in
|
||||||
// standalone goroutine and already has all necessary locks.
|
// standalone goroutine and already has all necessary locks.
|
||||||
func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interface{}) {
|
func (ctrl *PersistentVolumeController) provisionClaimOperation(claim *v1.PersistentVolumeClaim) {
|
||||||
claim, ok := claimObj.(*v1.PersistentVolumeClaim)
|
|
||||||
if !ok {
|
|
||||||
glog.Errorf("Cannot convert provisionClaimOperation argument to claim, got %#v", claimObj)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
claimClass := v1helper.GetPersistentVolumeClaimClass(claim)
|
claimClass := v1helper.GetPersistentVolumeClaimClass(claim)
|
||||||
glog.V(4).Infof("provisionClaimOperation [%s] started, class: %q", claimToClaimKey(claim), claimClass)
|
glog.V(4).Infof("provisionClaimOperation [%s] started, class: %q", claimToClaimKey(claim), claimClass)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user