Version returns the version of containerd that the client is connected to
(ctx context.Context)
| 867 | |
| 868 | // Version returns the version of containerd that the client is connected to |
| 869 | func (c *Client) Version(ctx context.Context) (Version, error) { |
| 870 | c.connMu.Lock() |
| 871 | if c.conn == nil { |
| 872 | c.connMu.Unlock() |
| 873 | return Version{}, fmt.Errorf("no grpc connection available: %w", errdefs.ErrUnavailable) |
| 874 | } |
| 875 | c.connMu.Unlock() |
| 876 | response, err := c.VersionService().Version(ctx, &ptypes.Empty{}) |
| 877 | if err != nil { |
| 878 | return Version{}, err |
| 879 | } |
| 880 | return Version{ |
| 881 | Version: response.Version, |
| 882 | Revision: response.Revision, |
| 883 | }, nil |
| 884 | } |
| 885 | |
| 886 | // ServerInfo represents the introspected server information |
| 887 | type ServerInfo struct { |
nothing calls this directly
no test coverage detected