Skip to content

Commit

Permalink
Fix to add PVC Metadata to VolumeLabels (libopenstorage#1208)
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
ggriffiths committed Aug 29, 2019
1 parent 1241c73 commit 7a16091
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 7a16091

Please sign in to comment.