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:
Gao Xiang committed 2026-04-01 13:18:27 +08:00
1 parent cb93966b9f
commit f8367b8ad2
1 file changed
+1 -13
+1 -13
View File
@@ -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)}