Unverified Commit 907329e2 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #55584 from zhangxiaoyu-zidif/move-check-pod-forward

Automatic merge from submit-queue (batch tested with PRs 60376, 55584, 60358, 54631, 60291). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. move pod-check forward **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 5be121ac 6e50240c
...@@ -333,6 +333,10 @@ func (vm *volumeManager) MarkVolumesAsReportedInUse( ...@@ -333,6 +333,10 @@ func (vm *volumeManager) MarkVolumesAsReportedInUse(
} }
func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error { func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error {
if pod == nil {
return nil
}
expectedVolumes := getExpectedVolumes(pod) expectedVolumes := getExpectedVolumes(pod)
if len(expectedVolumes) == 0 { if len(expectedVolumes) == 0 {
// No volumes to verify // No volumes to verify
...@@ -423,9 +427,6 @@ func filterUnmountedVolumes(mountedVolumes sets.String, expectedVolumes []string ...@@ -423,9 +427,6 @@ func filterUnmountedVolumes(mountedVolumes sets.String, expectedVolumes []string
// consider the volume setup step for this pod satisfied. // consider the volume setup step for this pod satisfied.
func getExpectedVolumes(pod *v1.Pod) []string { func getExpectedVolumes(pod *v1.Pod) []string {
expectedVolumes := []string{} expectedVolumes := []string{}
if pod == nil {
return expectedVolumes
}
for _, podVolume := range pod.Spec.Volumes { for _, podVolume := range pod.Spec.Volumes {
expectedVolumes = append(expectedVolumes, podVolume.Name) expectedVolumes = append(expectedVolumes, podVolume.Name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment