Skip to content

Commit

Permalink
Fix to add PVC Metadata to VolumeLabels
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 fc6a1bb commit 430e466
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 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 Expand Up @@ -650,4 +653,4 @@ func (s *OsdCsiServer) ListSnapshots(
// The function ListSnapshots is also not published as
// supported by this implementation
return nil, status.Error(codes.Unimplemented, "ListSnapshots is not implemented")
}

0 comments on commit 430e466

Please sign in to comment.