From 0fa468851475cb5e2ea213604d23a1acd019a432 Mon Sep 17 00:00:00 2001 From: Takuhiro Yoshida Date: Wed, 18 Aug 2021 17:12:22 +0900 Subject: [PATCH] Fix unnecessary warning when PV bound to PVC is not created yet --- pkg/controller/controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index e68f307c5..28b2298d1 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -310,6 +310,11 @@ func (ctrl *resizeController) syncPVC(key string) error { return fmt.Errorf("expected PVC got: %v", pvcObject) } + if pvc.Spec.VolumeName == "" { + klog.V(4).Infof("PV bound to PVC %q is not created yet", util.PVCKey(pvc)) + return nil + } + volumeObj, exists, err := ctrl.volumes.GetByKey(pvc.Spec.VolumeName) if err != nil { return fmt.Errorf("Get PV %q of pvc %q failed: %v", pvc.Spec.VolumeName, util.PVCKey(pvc), err)