MCPcopy
hub / github.com/containerd/containerd / GetSnapshotterCapabilities

Method GetSnapshotterCapabilities

client/client.go:961–976  ·  view source on GitHub ↗

GetSnapshotterCapabilities returns the capabilities of a snapshotter.

(ctx context.Context, snapshotterName string)

Source from the content-addressed store, hash-verified

959
960// GetSnapshotterCapabilities returns the capabilities of a snapshotter.
961func (c *Client) GetSnapshotterCapabilities(ctx context.Context, snapshotterName string) ([]string, error) {
962 filters := []string{fmt.Sprintf("type==%s, id==%s", plugins.SnapshotPlugin, snapshotterName)}
963 in := c.IntrospectionService()
964
965 resp, err := in.Plugins(ctx, filters...)
966 if err != nil {
967 return nil, err
968 }
969
970 if len(resp.Plugins) <= 0 {
971 return nil, fmt.Errorf("inspection service could not find snapshotter %s plugin", snapshotterName)
972 }
973
974 sn := resp.Plugins[0]
975 return sn.Capabilities, nil
976}
977
978type RuntimeVersion struct {
979 Version string

Callers 3

PullMethod · 0.95
resolveSnapshotOptionsFunction · 0.80
unpackImageFunction · 0.80

Calls 2

IntrospectionServiceMethod · 0.95
PluginsMethod · 0.65

Tested by

no test coverage detected