GetSnapshotterCapabilities returns the capabilities of a snapshotter.
(ctx context.Context, snapshotterName string)
| 959 | |
| 960 | // GetSnapshotterCapabilities returns the capabilities of a snapshotter. |
| 961 | func (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 | |
| 978 | type RuntimeVersion struct { |
| 979 | Version string |
no test coverage detected