adding support for expanding in use persistent volumes for Flex

This commit is contained in:
Aniket Kulkarni
2018-08-22 15:48:46 -04:00
parent 7cbb999518
commit 75350d11e9
23 changed files with 361 additions and 37 deletions

View File

@@ -208,13 +208,16 @@ func (expc *expandController) pvcUpdate(oldObj, newObj interface{}) {
return
}
// Filter PVCs for which the corresponding volume plugins don't allow expansion.
volumeSpec := volume.NewSpecFromPersistentVolume(pv, false)
volumePlugin, err := expc.volumePluginMgr.FindExpandablePluginBySpec(volumeSpec)
if err != nil || volumePlugin == nil {
err = fmt.Errorf("didn't find a plugin capable of expanding the volume; " +
"waiting for an external controller to process this PVC")
expc.recorder.Event(newPVC, v1.EventTypeNormal, events.ExternalExpanding,
eventType := v1.EventTypeNormal
if err != nil {
eventType = v1.EventTypeWarning
}
expc.recorder.Event(newPVC, eventType, events.ExternalExpanding,
fmt.Sprintf("Ignoring the PVC: %v.", err))
glog.V(3).Infof("Ignoring the PVC %q (uid: %q) : %v.",
util.GetPersistentVolumeClaimQualifiedName(newPVC), newPVC.UID, err)