move pod-check forward

This commit is contained in:
zhangxiaoyu-zidif 2017-11-13 15:46:23 +08:00
parent d6cabaf706
commit 6e50240ce1

View File

@ -328,6 +328,10 @@ func (vm *volumeManager) MarkVolumesAsReportedInUse(
}
func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error {
if pod == nil {
return nil
}
expectedVolumes := getExpectedVolumes(pod)
if len(expectedVolumes) == 0 {
// No volumes to verify
@ -402,9 +406,6 @@ func filterUnmountedVolumes(mountedVolumes sets.String, expectedVolumes []string
// consider the volume setup step for this pod satisfied.
func getExpectedVolumes(pod *v1.Pod) []string {
expectedVolumes := []string{}
if pod == nil {
return expectedVolumes
}
for _, podVolume := range pod.Spec.Volumes {
expectedVolumes = append(expectedVolumes, podVolume.Name)