From 374b814379da418914c6c4b85d1c521d5ab40f7d Mon Sep 17 00:00:00 2001 From: Connor Catlett Date: Mon, 22 Jul 2024 21:29:57 +0000 Subject: [PATCH] Skip modifying volumes owned by other CSI drivers Signed-off-by: Connor Catlett --- pkg/modifycontroller/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/modifycontroller/controller.go b/pkg/modifycontroller/controller.go index 4df2bfd26..c79fe2f59 100644 --- a/pkg/modifycontroller/controller.go +++ b/pkg/modifycontroller/controller.go @@ -277,8 +277,9 @@ func (ctrl *modifyController) syncPVC(key string) error { // Only trigger modify volume if the following conditions are met // 1. Non empty vac name // 2. PVC is in Bound state + // 3. PV CSI driver name matches local driver vacName := pvc.Spec.VolumeAttributesClassName - if vacName != nil && *vacName != "" && pvc.Status.Phase == v1.ClaimBound { + if vacName != nil && *vacName != "" && pvc.Status.Phase == v1.ClaimBound && pv.Spec.CSI.Driver == ctrl.name { _, _, err, _ := ctrl.modify(pvc, pv) if err != nil { return err