Merge pull request #68022 from jingxu97/waitForAttachLogging

Add a log in verifyDevicePath
This commit is contained in:
Kubernetes Prow Robot 2021-01-12 23:36:35 -08:00 committed by GitHub
commit 69a8bb7f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -269,6 +269,8 @@ func (attacher *gcePersistentDiskAttacher) WaitForAttach(spec *volume.Spec, devi
// A device path has successfully been created for the PD
klog.Infof("Successfully found attached GCE PD %q.", pdName)
return path, nil
} else {
klog.V(4).Infof("could not verify GCE PD (%q) is attached, device path does not exist", pdName)
}
case <-timer.C:
return "", fmt.Errorf("could not find attached GCE PD %q. Timeout waiting for mount paths to be created", pdName)

View File

@ -428,8 +428,11 @@ func (b *gcePersistentDiskMounter) SetUpAt(dir string, mounterArgs volume.Mounte
return fmt.Errorf("mount of disk %s failed: %v", dir, err)
}
klog.V(4).Infof("mount of disk %s succeeded", dir)
if !b.readOnly {
volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil))
if err := volume.SetVolumeOwnership(b, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)); err != nil {
klog.Errorf("SetVolumeOwnership returns error %v", err)
}
}
return nil
}