MCPcopy
hub / github.com/containerd/containerd / getInstallPath

Method getInstallPath

client/install.go:111–127  ·  view source on GitHub ↗
(ctx context.Context, config InstallConfig)

Source from the content-addressed store, hash-verified

109}
110
111func (c *Client) getInstallPath(ctx context.Context, config InstallConfig) (string, error) {
112 if config.Path != "" {
113 return config.Path, nil
114 }
115 resp, err := c.IntrospectionService().Plugins(ctx, "id==opt")
116 if err != nil {
117 return "", err
118 }
119 if len(resp.Plugins) != 1 {
120 return "", errors.New("opt service not enabled")
121 }
122 path := resp.Plugins[0].Exports["path"]
123 if path == "" {
124 return "", errors.New("opt path not exported")
125 }
126 return path, nil
127}

Callers 1

InstallMethod · 0.95

Calls 2

IntrospectionServiceMethod · 0.95
PluginsMethod · 0.65

Tested by

no test coverage detected