From 8e9c61afa3988cf03e08a2ed6fdf2af5bc5bfa23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 21 Jun 2026 18:38:08 +0800 Subject: [PATCH] platform: Fix missing api version check for usb/ip --- experimental/libbox/command_client.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/experimental/libbox/command_client.go b/experimental/libbox/command_client.go index 1ab368785..c46b8d627 100644 --- a/experimental/libbox/command_client.go +++ b/experimental/libbox/command_client.go @@ -711,6 +711,16 @@ func (c *CommandClient) GetStartedAt() (int64, error) { }) } +func (c *CommandClient) GetAPIVersion() (int32, error) { + return callWithResult(c, func(ctx context.Context, client daemon.StartedServiceClient) (int32, error) { + version, err := client.GetVersion(ctx, &emptypb.Empty{}) + if err != nil { + return 0, E.Cause(err, "get version") + } + return version.ApiVersion, nil + }) +} + func (c *CommandClient) SetGroupExpand(groupTag string, isExpand bool) error { _, err := callWithResult(c, func(ctx context.Context, client daemon.StartedServiceClient) (*emptypb.Empty, error) { return client.SetGroupExpand(ctx, &daemon.SetGroupExpandRequest{