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:
Niels de Vos
2024-08-05 18:27:15 +02:00
committed by mergify[bot]
parent 2fd92573f4
commit 6d1ab1b8d9
6 changed files with 34 additions and 20 deletions

View File

@ -32,6 +32,7 @@ import (
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
)
const (
@ -1240,7 +1241,7 @@ func (cs *ControllerServer) CreateSnapshot(
SizeBytes: vol.VolSize,
SnapshotId: vol.VolID,
SourceVolumeId: req.GetSourceVolumeId(),
CreationTime: vol.CreatedAt,
CreationTime: timestamppb.New(*vol.CreatedAt),
ReadyToUse: true,
},
}, nil
@ -1300,7 +1301,7 @@ func cloneFromSnapshot(
SizeBytes: rbdSnap.VolSize,
SnapshotId: rbdSnap.VolID,
SourceVolumeId: rbdSnap.SourceVolumeID,
CreationTime: rbdSnap.CreatedAt,
CreationTime: timestamppb.New(*rbdSnap.CreatedAt),
ReadyToUse: true,
},
}, nil