Skip to content

Commit

Permalink
[Portworx] Also check for CSI provisioner name for ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
disrani-px committed Dec 4, 2018
1 parent 505906f commit 8b7ded8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/volume/portworx/portworx.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ const (
// default API port
apiPort = 9001

// provisionerName is the name for the driver provisioner
provisionerName = "kubernetes.io/portworx-volume"
// provisioner names for portworx volumes
provisionerName = "kubernetes.io/portworx-volume"
csiProvisionerName = "com.openstorage.pxd"

// pvcProvisionerAnnotation is the annotation on PVC which has the provisioner name
pvcProvisionerAnnotation = "volume.beta.kubernetes.io/storage-provisioner"
Expand Down Expand Up @@ -358,7 +359,7 @@ func (p *portworx) OwnsPVC(pvc *v1.PersistentVolumeClaim) bool {
provisioner = storageClass.Provisioner
}

if provisioner != provisionerName && provisioner != snapshot.GetProvisionerName() {
if provisioner != provisionerName && provisioner != csiProvisionerName && provisioner != snapshot.GetProvisionerName() {
logrus.Debugf("Provisioner in Storageclass not Portworx or from the snapshot Provisioner: %v", provisioner)
return false
}
Expand Down

0 comments on commit 8b7ded8

Please sign in to comment.