Skip to content

Commit 92aee22

Browse files
author
caiweidong
committed
Remove the unused variabe: syncDuration in volumemanager
1 parent f4d1253 commit 92aee22

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

pkg/kubelet/volumemanager/reconciler/reconciler.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ type Reconciler interface {
7575
// this node, and therefore the volume manager should not
7676
// loopSleepDuration - the amount of time the reconciler loop sleeps between
7777
// successive executions
78-
// syncDuration - the amount of time the syncStates sleeps between
79-
// successive executions
8078
// waitForAttachTimeout - the amount of time the Mount function will wait for
8179
// the volume to be attached
8280
// nodeName - the Name for this node, used by Attach and Detach methods
@@ -94,7 +92,6 @@ func NewReconciler(
9492
kubeClient clientset.Interface,
9593
controllerAttachDetachEnabled bool,
9694
loopSleepDuration time.Duration,
97-
syncDuration time.Duration,
9895
waitForAttachTimeout time.Duration,
9996
nodeName types.NodeName,
10097
desiredStateOfWorld cache.DesiredStateOfWorld,
@@ -108,7 +105,6 @@ func NewReconciler(
108105
kubeClient: kubeClient,
109106
controllerAttachDetachEnabled: controllerAttachDetachEnabled,
110107
loopSleepDuration: loopSleepDuration,
111-
syncDuration: syncDuration,
112108
waitForAttachTimeout: waitForAttachTimeout,
113109
nodeName: nodeName,
114110
desiredStateOfWorld: desiredStateOfWorld,

pkg/kubelet/volumemanager/reconciler/reconciler_test.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ import (
4646
const (
4747
// reconcilerLoopSleepDuration is the amount of time the reconciler loop
4848
// waits between successive executions
49-
reconcilerLoopSleepDuration time.Duration = 1 * time.Nanosecond
50-
reconcilerSyncStatesSleepPeriod time.Duration = 10 * time.Minute
49+
reconcilerLoopSleepDuration time.Duration = 1 * time.Nanosecond
5150
// waitForAttachTimeout is the maximum amount of time a
5251
// operationexecutor.Mount call will wait for a volume to be attached.
5352
waitForAttachTimeout time.Duration = 1 * time.Second
@@ -78,7 +77,6 @@ func Test_Run_Positive_DoNothing(t *testing.T) {
7877
kubeClient,
7978
false, /* controllerAttachDetachEnabled */
8079
reconcilerLoopSleepDuration,
81-
reconcilerSyncStatesSleepPeriod,
8280
waitForAttachTimeout,
8381
nodeName,
8482
dsw,
@@ -122,7 +120,6 @@ func Test_Run_Positive_VolumeAttachAndMount(t *testing.T) {
122120
kubeClient,
123121
false, /* controllerAttachDetachEnabled */
124122
reconcilerLoopSleepDuration,
125-
reconcilerSyncStatesSleepPeriod,
126123
waitForAttachTimeout,
127124
nodeName,
128125
dsw,
@@ -200,7 +197,6 @@ func Test_Run_Positive_VolumeMountControllerAttachEnabled(t *testing.T) {
200197
kubeClient,
201198
true, /* controllerAttachDetachEnabled */
202199
reconcilerLoopSleepDuration,
203-
reconcilerSyncStatesSleepPeriod,
204200
waitForAttachTimeout,
205201
nodeName,
206202
dsw,
@@ -279,7 +275,6 @@ func Test_Run_Positive_VolumeAttachMountUnmountDetach(t *testing.T) {
279275
kubeClient,
280276
false, /* controllerAttachDetachEnabled */
281277
reconcilerLoopSleepDuration,
282-
reconcilerSyncStatesSleepPeriod,
283278
waitForAttachTimeout,
284279
nodeName,
285280
dsw,
@@ -369,7 +364,6 @@ func Test_Run_Positive_VolumeUnmountControllerAttachEnabled(t *testing.T) {
369364
kubeClient,
370365
true, /* controllerAttachDetachEnabled */
371366
reconcilerLoopSleepDuration,
372-
reconcilerSyncStatesSleepPeriod,
373367
waitForAttachTimeout,
374368
nodeName,
375369
dsw,
@@ -460,7 +454,6 @@ func Test_Run_Positive_VolumeAttachAndMap(t *testing.T) {
460454
kubeClient,
461455
false, /* controllerAttachDetachEnabled */
462456
reconcilerLoopSleepDuration,
463-
reconcilerSyncStatesSleepPeriod,
464457
waitForAttachTimeout,
465458
nodeName,
466459
dsw,
@@ -545,7 +538,6 @@ func Test_Run_Positive_BlockVolumeMapControllerAttachEnabled(t *testing.T) {
545538
kubeClient,
546539
true, /* controllerAttachDetachEnabled */
547540
reconcilerLoopSleepDuration,
548-
reconcilerSyncStatesSleepPeriod,
549541
waitForAttachTimeout,
550542
nodeName,
551543
dsw,
@@ -631,7 +623,6 @@ func Test_Run_Positive_BlockVolumeAttachMapUnmapDetach(t *testing.T) {
631623
kubeClient,
632624
false, /* controllerAttachDetachEnabled */
633625
reconcilerLoopSleepDuration,
634-
reconcilerSyncStatesSleepPeriod,
635626
waitForAttachTimeout,
636627
nodeName,
637628
dsw,
@@ -727,7 +718,6 @@ func Test_Run_Positive_VolumeUnmapControllerAttachEnabled(t *testing.T) {
727718
kubeClient,
728719
true, /* controllerAttachDetachEnabled */
729720
reconcilerLoopSleepDuration,
730-
reconcilerSyncStatesSleepPeriod,
731721
waitForAttachTimeout,
732722
nodeName,
733723
dsw,
@@ -1007,7 +997,6 @@ func Test_Run_Positive_VolumeFSResizeControllerAttachEnabled(t *testing.T) {
1007997
kubeClient,
1008998
true, /* controllerAttachDetachEnabled */
1009999
reconcilerLoopSleepDuration,
1010-
reconcilerSyncStatesSleepPeriod,
10111000
waitForAttachTimeout,
10121001
nodeName,
10131002
dsw,
@@ -1185,7 +1174,6 @@ func Test_Run_Positive_VolumeMountControllerAttachEnabledRace(t *testing.T) {
11851174
kubeClient,
11861175
true, /* controllerAttachDetachEnabled */
11871176
reconcilerLoopSleepDuration,
1188-
reconcilerSyncStatesSleepPeriod,
11891177
waitForAttachTimeout,
11901178
nodeName,
11911179
dsw,

pkg/kubelet/volumemanager/volume_manager.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ const (
5252
// between successive executions
5353
reconcilerLoopSleepPeriod = 100 * time.Millisecond
5454

55-
// reconcilerSyncStatesSleepPeriod is the amount of time the reconciler reconstruct process
56-
// waits between successive executions
57-
reconcilerSyncStatesSleepPeriod = 3 * time.Minute
58-
5955
// desiredStateOfWorldPopulatorLoopSleepPeriod is the amount of time the
6056
// DesiredStateOfWorldPopulator loop waits between successive executions
6157
desiredStateOfWorldPopulatorLoopSleepPeriod = 100 * time.Millisecond
@@ -187,7 +183,6 @@ func NewVolumeManager(
187183
kubeClient,
188184
controllerAttachDetachEnabled,
189185
reconcilerLoopSleepPeriod,
190-
reconcilerSyncStatesSleepPeriod,
191186
waitForAttachTimeout,
192187
nodeName,
193188
vm.desiredStateOfWorld,

0 commit comments

Comments
 (0)