Skip to content

Commit 8e9c61a

Browse files
committed
platform: Fix missing api version check for usb/ip
1 parent 64a0e0c commit 8e9c61a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

experimental/libbox/command_client.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,16 @@ func (c *CommandClient) GetStartedAt() (int64, error) {
711711
})
712712
}
713713

714+
func (c *CommandClient) GetAPIVersion() (int32, error) {
715+
return callWithResult(c, func(ctx context.Context, client daemon.StartedServiceClient) (int32, error) {
716+
version, err := client.GetVersion(ctx, &emptypb.Empty{})
717+
if err != nil {
718+
return 0, E.Cause(err, "get version")
719+
}
720+
return version.ApiVersion, nil
721+
})
722+
}
723+
714724
func (c *CommandClient) SetGroupExpand(groupTag string, isExpand bool) error {
715725
_, err := callWithResult(c, func(ctx context.Context, client daemon.StartedServiceClient) (*emptypb.Empty, error) {
716726
return client.SetGroupExpand(ctx, &daemon.SetGroupExpandRequest{

0 commit comments

Comments
 (0)