mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
client: remove toPlatforms()
Just use apitypes.OCIPlatformFromProto(). Suggested-by: Jin Dong <djdongjin95@gmail.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
This commit is contained in:
1 parent
cb93966b9f
commit
f8367b8ad2
1 file changed
+1
-13
+1
-13
@@ -953,22 +953,10 @@ func (c *Client) GetSnapshotterSupportedPlatforms(ctx context.Context, snapshott
|
||||
}
|
||||
|
||||
sn := resp.Plugins[0]
|
||||
snPlatforms := toPlatforms(sn.Platforms)
|
||||
snPlatforms := apitypes.OCIPlatformFromProto(sn.Platforms)
|
||||
return platforms.Any(snPlatforms...), nil
|
||||
}
|
||||
|
||||
func toPlatforms(pt []*apitypes.Platform) []ocispec.Platform {
|
||||
platforms := make([]ocispec.Platform, len(pt))
|
||||
for i, p := range pt {
|
||||
platforms[i] = ocispec.Platform{
|
||||
Architecture: p.Architecture,
|
||||
OS: p.OS,
|
||||
Variant: p.Variant,
|
||||
}
|
||||
}
|
||||
return platforms
|
||||
}
|
||||
|
||||
// GetSnapshotterCapabilities returns the capabilities of a snapshotter.
|
||||
func (c *Client) GetSnapshotterCapabilities(ctx context.Context, snapshotterName string) ([]string, error) {
|
||||
filters := []string{fmt.Sprintf("type==%s, id==%s", plugins.SnapshotPlugin, snapshotterName)}
|
||||
|
||||
Reference in new issue
Block a user