Skip to content

Commit 44cabdb

Browse files
committed
do not copy protobuf message
it contains mutex in new version
1 parent 428b523 commit 44cabdb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/hostpath/controllerserver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ func (hp *hostPath) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest
461461
})
462462
}
463463

464-
klog.V(5).Infof("Volumes are: %+v", *volumeRes)
464+
klog.V(5).Infof("Volumes are: %+v", volumeRes)
465465
return volumeRes, nil
466466
}
467467

@@ -678,15 +678,15 @@ func (hp *hostPath) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReq
678678
return &csi.ListSnapshotsResponse{}, nil
679679
}
680680

681-
var snapshots []csi.Snapshot
681+
var snapshots []*csi.Snapshot
682682
// case 3: no parameter is set, so we return all the snapshots.
683683
hpSnapshots := hp.state.GetSnapshots()
684684
sort.Slice(hpSnapshots, func(i, j int) bool {
685685
return hpSnapshots[i].Id < hpSnapshots[j].Id
686686
})
687687

688688
for _, snap := range hpSnapshots {
689-
snapshot := csi.Snapshot{
689+
snapshot := &csi.Snapshot{
690690
SnapshotId: snap.Id,
691691
SourceVolumeId: snap.VolID,
692692
CreationTime: snap.CreationTime,
@@ -741,7 +741,7 @@ func (hp *hostPath) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReq
741741

742742
for i = 0; i < len(entries); i++ {
743743
entries[i] = &csi.ListSnapshotsResponse_Entry{
744-
Snapshot: &snapshots[j],
744+
Snapshot: snapshots[j],
745745
}
746746
j++
747747
}

0 commit comments

Comments
 (0)