@@ -632,7 +632,7 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
632
632
Str ("source_volume_id" , sourceVolID ).
633
633
Msg ("Finding current snapshot in Civo API" )
634
634
635
- snapshots , err := d .CivoClient .ListVolumeSnapshotsByVolumeID ( sourceVolID )
635
+ snapshots , err := d .CivoClient .ListVolumeSnapshots ( )
636
636
if err != nil {
637
637
log .Error ().
638
638
Str ("source_volume_id" , sourceVolID ).
@@ -769,7 +769,7 @@ func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReques
769
769
770
770
snapshot , err := d .CivoClient .GetVolumeSnapshotByVolumeID (sourceVolumeID , snapshotID )
771
771
if err != nil {
772
- if strings .Contains (err .Error (), "DatabaseSnapshotNotFoundError" ) {
772
+ if strings .Contains (err .Error (), "DatabaseSnapshotNotFoundError" ) || strings . Contains ( err . Error (), "ZeroMatchesError" ) {
773
773
log .Info ().
774
774
Str ("snapshot_id" , snapshotID ).
775
775
Str ("source_volume_id" , sourceVolumeID ).
@@ -807,7 +807,7 @@ func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReques
807
807
808
808
snapshot , err := d .CivoClient .GetVolumeSnapshot (snapshotID )
809
809
if err != nil {
810
- if strings .Contains (err .Error (), "DatabaseSnapshotNotFoundError" ) {
810
+ if strings .Contains (err .Error (), "DatabaseSnapshotNotFoundError" ) || strings . Contains ( err . Error (), "ZeroMatchesError" ) {
811
811
log .Info ().
812
812
Str ("snapshot_id" , snapshotID ).
813
813
Msg ("ListSnapshots: no snapshot found, returning with success" )
@@ -940,6 +940,9 @@ func ConvertSnapshot(in *civogo.VolumeSnapshot) (*csi.ListSnapshotsResponse_Entr
940
940
941
941
// ParseTimeToProtoTimestamp parses a time string in RFC3339 format to *timestamppb.Timestamp.
942
942
func ParseTimeToProtoTimestamp (timeStr string ) (* timestamppb.Timestamp , error ) {
943
+ if timeStr == "" {
944
+ return nil , nil
945
+ }
943
946
t , err := time .Parse (time .RFC3339 , timeStr )
944
947
// Only return an error if timeStr is not empty
945
948
if err != nil && timeStr != "" {
0 commit comments