Skip to content

Commit

Permalink
check that the PVC provisioning request is for the current node
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanda committed Oct 4, 2019
1 parent 807ef93 commit fa836f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ func (p *csiProvisioner) ProvisionExt(options controller.ProvisionOptions) (*v1.
}
}

if options.SelectedNode.Name != os.Getenv("NODE_NAME") {
return nil, controller.ProvisioningNoChange, &controller.IgnoredError{
Reason: fmt.Sprintf("Selected node (%s) is not current node (%s)", options.SelectedNode.Name, os.Getenv("NODE_NAME")),
}
}

migratedVolume := false
if p.supportsMigrationFromInTreePluginName != "" {
// NOTE: we cannot depend on PVC.Annotations[volume.beta.kubernetes.io/storage-provisioner] to get
Expand Down

0 comments on commit fa836f8

Please sign in to comment.