From 1e57dae5ec2aed4c332e87345d873cc2711dc2bd Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Thu, 26 Jan 2023 14:39:05 -0500 Subject: [PATCH 1/2] Ignore error when we can't find plugin capable of expanding the volume intre --- pkg/controller/volume/expand/expand_controller.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkg/controller/volume/expand/expand_controller.go b/pkg/controller/volume/expand/expand_controller.go index ba8467e9637..62f33c8bb1a 100644 --- a/pkg/controller/volume/expand/expand_controller.go +++ b/pkg/controller/volume/expand/expand_controller.go @@ -282,11 +282,6 @@ func (expc *expandController) syncHandler(ctx context.Context, key string) error if err != nil || volumePlugin == nil { msg := fmt.Errorf("didn't find a plugin capable of expanding the volume; " + "waiting for an external controller to process this PVC") - eventType := v1.EventTypeNormal - if err != nil { - eventType = v1.EventTypeWarning - } - expc.recorder.Event(pvc, eventType, events.ExternalExpanding, fmt.Sprintf("Ignoring the PVC: %v.", msg)) klog.Infof("Ignoring the PVC %q (uid: %q) : %v.", key, pvc.UID, msg) // If we are expecting that an external plugin will handle resizing this volume then // is no point in requeuing this PVC. From c9fc35c4963410d1da3fb31b955c1636993b10ac Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 30 Jan 2023 10:35:21 -0500 Subject: [PATCH 2/2] reword the warning that gets printed on external expansion --- pkg/controller/volume/expand/expand_controller.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/controller/volume/expand/expand_controller.go b/pkg/controller/volume/expand/expand_controller.go index 62f33c8bb1a..31a01ae56c4 100644 --- a/pkg/controller/volume/expand/expand_controller.go +++ b/pkg/controller/volume/expand/expand_controller.go @@ -280,9 +280,13 @@ func (expc *expandController) syncHandler(ctx context.Context, key string) error volumePlugin, err := expc.volumePluginMgr.FindExpandablePluginBySpec(volumeSpec) if err != nil || volumePlugin == nil { - msg := fmt.Errorf("didn't find a plugin capable of expanding the volume; " + - "waiting for an external controller to process this PVC") - klog.Infof("Ignoring the PVC %q (uid: %q) : %v.", key, pvc.UID, msg) + msg := "waiting for an external controller to expand this PVC" + eventType := v1.EventTypeNormal + if err != nil { + eventType = v1.EventTypeWarning + } + expc.recorder.Event(pvc, eventType, events.ExternalExpanding, msg) + klog.Infof("waiting for an external controller to expand the PVC %q (uid: %q)", key, pvc.UID) // If we are expecting that an external plugin will handle resizing this volume then // is no point in requeuing this PVC. return nil