MCPcopy Index your code
hub / github.com/containerd/containerd / Version

Method Version

client/client.go:869–884  ·  view source on GitHub ↗

Version returns the version of containerd that the client is connected to

(ctx context.Context)

Source from the content-addressed store, hash-verified

867
868// Version returns the version of containerd that the client is connected to
869func (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
887type ServerInfo struct {

Callers

nothing calls this directly

Calls 4

VersionServiceMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65
VersionMethod · 0.65

Tested by

no test coverage detected