mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
refactor: remove unused desiredStateOfWorld parameter from DetermineVolumeAction
Signed-off-by: xigang <wangxigang2014@gmail.com>
This commit is contained in:
@@ -508,7 +508,6 @@ func (adc *attachDetachController) podAdd(logger klog.Logger, obj interface{}) {
|
||||
|
||||
volumeActionFlag := util.DetermineVolumeAction(
|
||||
pod,
|
||||
adc.desiredStateOfWorld,
|
||||
true /* default volume action */)
|
||||
|
||||
util.ProcessPodVolumes(logger, pod, volumeActionFlag, /* addVolumes */
|
||||
@@ -532,7 +531,6 @@ func (adc *attachDetachController) podUpdate(logger klog.Logger, oldObj, newObj
|
||||
|
||||
volumeActionFlag := util.DetermineVolumeAction(
|
||||
pod,
|
||||
adc.desiredStateOfWorld,
|
||||
true /* default volume action */)
|
||||
|
||||
util.ProcessPodVolumes(logger, pod, volumeActionFlag, /* addVolumes */
|
||||
@@ -668,7 +666,6 @@ func (adc *attachDetachController) syncPVCByKey(logger klog.Logger, key string)
|
||||
}
|
||||
volumeActionFlag := util.DetermineVolumeAction(
|
||||
pod,
|
||||
adc.desiredStateOfWorld,
|
||||
true /* default volume action */)
|
||||
|
||||
util.ProcessPodVolumes(logger, pod, volumeActionFlag, /* addVolumes */
|
||||
|
||||
@@ -140,7 +140,6 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedPods(logger klog.L
|
||||
default:
|
||||
volumeActionFlag := util.DetermineVolumeAction(
|
||||
informerPod,
|
||||
dswp.desiredStateOfWorld,
|
||||
true /* default volume action */)
|
||||
|
||||
if volumeActionFlag {
|
||||
|
||||
@@ -178,7 +178,7 @@ func getPVSpecFromCache(name string, pvcReadOnly bool, expectedClaimUID types.UI
|
||||
|
||||
// DetermineVolumeAction returns true if volume and pod needs to be added to dswp
|
||||
// and it returns false if volume and pod needs to be removed from dswp
|
||||
func DetermineVolumeAction(pod *v1.Pod, desiredStateOfWorld cache.DesiredStateOfWorld, defaultAction bool) bool {
|
||||
func DetermineVolumeAction(pod *v1.Pod, defaultAction bool) bool {
|
||||
if pod == nil || len(pod.Spec.Volumes) <= 0 {
|
||||
return defaultAction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user