Skip to content

Commit 5edc26d

Browse files
committed
feat: add error handling to check DatabaseVolumeSnapshotLimitExceededError
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
1 parent 46b751a commit 5edc26d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/driver/controller_server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,10 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
653653
// VolID: req.SourceVolumeId,
654654
// })
655655
// if err != nil {
656+
// if strings.Contains(err.Error(), "DatabaseVolumeSnapshotLimitExceededError") {
657+
// log.Error().Err(err).Msg("Requested volume snapshot would exceed volume quota available")
658+
// return nil, status.Errorf(codes.ResourceExhausted, "failed to create volume snapshot due to over quota: %s", err)
659+
// }
656660
// log.Error().Err(err).Msg("Unable to create snapshot in Civo API")
657661
// return nil, status.Errorf(codes.Internal, "failed to create volume snapshot: %s", err)
658662
// }

0 commit comments

Comments
 (0)