Skip to content

Commit

Permalink
Merge pull request #419 from ConnorJC3/do-not-modify-other-drivers-vo…
Browse files Browse the repository at this point in the history
…lumes

Skip modifying volumes owned by other CSI drivers
  • Loading branch information
k8s-ci-robot authored Jul 26, 2024
2 parents d610025 + 374b814 commit 6b7a68f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/modifycontroller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b7a68f

Please sign in to comment.