mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rbd: have GetCreationTime() return a time.Time struct
Do not use protobuf types when there is no need. Just use the standard time.Time format instead. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
2fd92573f4
commit
6d1ab1b8d9
@ -20,6 +20,9 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
)
|
||||
@ -118,6 +121,16 @@ func (rbdSnap *rbdSnapshot) toVolume() *rbdVolume {
|
||||
}
|
||||
}
|
||||
|
||||
func (rbdSnap *rbdSnapshot) ToCSI(ctx context.Context) (*csi.Snapshot, error) {
|
||||
return &csi.Snapshot{
|
||||
SizeBytes: rbdSnap.VolSize,
|
||||
SnapshotId: rbdSnap.VolID,
|
||||
SourceVolumeId: rbdSnap.SourceVolumeID,
|
||||
CreationTime: timestamppb.New(*rbdSnap.CreatedAt),
|
||||
ReadyToUse: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func undoSnapshotCloning(
|
||||
ctx context.Context,
|
||||
parentVol *rbdVolume,
|
||||
|
Reference in New Issue
Block a user