remove unnecessary time type

remove unnecessary time type, improve volume_manager.go
This commit is contained in:
knight 2018-10-11 21:06:46 +08:00 committed by GitHub
parent e6c5fb4666
commit 5ed6da9d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,21 +50,21 @@ import (
const ( const (
// reconcilerLoopSleepPeriod is the amount of time the reconciler loop waits // reconcilerLoopSleepPeriod is the amount of time the reconciler loop waits
// between successive executions // between successive executions
reconcilerLoopSleepPeriod time.Duration = 100 * time.Millisecond reconcilerLoopSleepPeriod = 100 * time.Millisecond
// reconcilerSyncStatesSleepPeriod is the amount of time the reconciler reconstruct process // reconcilerSyncStatesSleepPeriod is the amount of time the reconciler reconstruct process
// waits between successive executions // waits between successive executions
reconcilerSyncStatesSleepPeriod time.Duration = 3 * time.Minute reconcilerSyncStatesSleepPeriod = 3 * time.Minute
// desiredStateOfWorldPopulatorLoopSleepPeriod is the amount of time the // desiredStateOfWorldPopulatorLoopSleepPeriod is the amount of time the
// DesiredStateOfWorldPopulator loop waits between successive executions // DesiredStateOfWorldPopulator loop waits between successive executions
desiredStateOfWorldPopulatorLoopSleepPeriod time.Duration = 100 * time.Millisecond desiredStateOfWorldPopulatorLoopSleepPeriod = 100 * time.Millisecond
// desiredStateOfWorldPopulatorGetPodStatusRetryDuration is the amount of // desiredStateOfWorldPopulatorGetPodStatusRetryDuration is the amount of
// time the DesiredStateOfWorldPopulator loop waits between successive pod // time the DesiredStateOfWorldPopulator loop waits between successive pod
// cleanup calls (to prevent calling containerruntime.GetPodStatus too // cleanup calls (to prevent calling containerruntime.GetPodStatus too
// frequently). // frequently).
desiredStateOfWorldPopulatorGetPodStatusRetryDuration time.Duration = 2 * time.Second desiredStateOfWorldPopulatorGetPodStatusRetryDuration = 2 * time.Second
// podAttachAndMountTimeout is the maximum amount of time the // podAttachAndMountTimeout is the maximum amount of time the
// WaitForAttachAndMount call will wait for all volumes in the specified pod // WaitForAttachAndMount call will wait for all volumes in the specified pod
@ -75,11 +75,11 @@ const (
// request to the pod). // request to the pod).
// Value is slightly offset from 2 minutes to make timeouts due to this // Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable. // constant recognizable.
podAttachAndMountTimeout time.Duration = 2*time.Minute + 3*time.Second podAttachAndMountTimeout = 2*time.Minute + 3*time.Second
// podAttachAndMountRetryInterval is the amount of time the GetVolumesForPod // podAttachAndMountRetryInterval is the amount of time the GetVolumesForPod
// call waits before retrying // call waits before retrying
podAttachAndMountRetryInterval time.Duration = 300 * time.Millisecond podAttachAndMountRetryInterval = 300 * time.Millisecond
// waitForAttachTimeout is the maximum amount of time a // waitForAttachTimeout is the maximum amount of time a
// operationexecutor.Mount call will wait for a volume to be attached. // operationexecutor.Mount call will wait for a volume to be attached.
@ -87,7 +87,7 @@ const (
// minutes to complete for some volume plugins in some cases. While this // minutes to complete for some volume plugins in some cases. While this
// operation is waiting it only blocks other operations on the same device, // operation is waiting it only blocks other operations on the same device,
// other devices are not affected. // other devices are not affected.
waitForAttachTimeout time.Duration = 10 * time.Minute waitForAttachTimeout = 10 * time.Minute
) )
// VolumeManager runs a set of asynchronous loops that figure out which volumes // VolumeManager runs a set of asynchronous loops that figure out which volumes