remove uses of platforms.Platform alias

Commit 3c8469a782 removed uses of the api
types.Platform type from public interfaces, instead using the type from
the OCI image spec.

For convenience, it also introduced an alias in the platforms package.
While this alias allows packages that already import containerd's
platforms package (now a separate module), it may also cause confusion
(it's not clear that it's an alias for the OCI type), and for packages
that do not depend on containerd's platforms package / module may now
be resulting in an extra dependency.

Let's remove the use of this alias, and instead use the OCI type directly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-05-28 14:56:30 +02:00
parent 45e30913bc
commit 446e63579c
10 changed files with 32 additions and 29 deletions

View File

@@ -22,6 +22,7 @@ import (
"github.com/containerd/errdefs"
"github.com/containerd/go-cni"
"github.com/containerd/platforms"
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/containerd/containerd/api/types"
containerd "github.com/containerd/containerd/v2/client"
@@ -62,7 +63,7 @@ func (f *fakeSandboxService) SandboxStatus(ctx context.Context, sandboxer string
return sandbox.ControllerStatus{}, errdefs.ErrNotImplemented
}
func (f *fakeSandboxService) SandboxPlatform(ctx context.Context, sandboxer string, sandboxID string) (platforms.Platform, error) {
func (f *fakeSandboxService) SandboxPlatform(ctx context.Context, sandboxer string, sandboxID string) (imagespec.Platform, error) {
return platforms.DefaultSpec(), nil
}
@@ -80,7 +81,7 @@ func (f fakeSandboxController) Start(ctx context.Context, sandboxID string) (san
return sandbox.ControllerInstance{}, errdefs.ErrNotImplemented
}
func (f fakeSandboxController) Platform(_ctx context.Context, _sandboxID string) (platforms.Platform, error) {
func (f fakeSandboxController) Platform(_ctx context.Context, _sandboxID string) (imagespec.Platform, error) {
return platforms.DefaultSpec(), nil
}