Skip to content

Commit

Permalink
feat: add delete handler
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Nov 25, 2024
1 parent 418cece commit f888a87
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/driver/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ func (d *Driver) ControllerGetCapabilities(context.Context, *csi.ControllerGetCa
csi.ControllerServiceCapability_RPC_LIST_VOLUMES,
csi.ControllerServiceCapability_RPC_GET_CAPACITY,
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT,
}

var csc []*csi.ControllerServiceCapability
Expand Down Expand Up @@ -590,7 +591,21 @@ func (d *Driver) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*c
}

// DeleteSnapshot is part of implementing Snapshot & Restore functionality, but we don't support that
func (d *Driver) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
log.Info().
Str("snapshot_id", req.GetSnapshotId()).
Msg("Request: DeleteSnapshot")

if req.GetSnapshotId() == "" {
return nil, status.Error(codes.InvalidArgument, "must provide SnapshotId to DeleteSnapshot")
}

log.Debug().
Str("snapshot_id", req.GetSnapshotId()).
Msg("Deleting snapshot in Civo API")

// TODO

return nil, status.Error(codes.Unimplemented, "")
}

Expand Down

0 comments on commit f888a87

Please sign in to comment.