Skip to content

Commit

Permalink
Fix to add PVC Metadata to VolumeLabels (#1208)
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
ggriffiths authored Aug 29, 2019
1 parent fc6a1bb commit 273c283
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions csi/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,12 @@ func (s *OsdCsiServer) CreateVolume(
// Get PVC Metadata and add to locator.VolumeLabels
pvcMetadata, err := getPVCMetadata(req.GetParameters())
if err != nil {
for k, v := range pvcMetadata {
locator.VolumeLabels[k] = v
}
return nil, status.Errorf(
codes.Internal,
"Unable to get PVC Metadata: %v", err)
}
for k, v := range pvcMetadata {
locator.VolumeLabels[k] = v
}

// Get parent ID from request: snapshot or volume
Expand Down

0 comments on commit 273c283

Please sign in to comment.