Merge pull request #51102 from thaJeztah/move_more_imagebackendopts

daemon/server: move GetImageOpts, ImageInspectOpts to imagebackend
This commit is contained in:
Sebastiaan van Stijn
2025-10-06 14:17:32 +02:00
committed by GitHub
30 changed files with 73 additions and 80 deletions

View File

@@ -75,5 +75,5 @@ type VolumeBackend interface {
type ImageBackend interface {
PullImage(ctx context.Context, ref reference.Named, options imagebackend.PullOptions) error
GetRepositories(context.Context, reference.Named, *registry.AuthConfig) ([]distribution.Repository, error)
GetImage(ctx context.Context, refOrID string, options backend.GetImageOpts) (*image.Image, error)
GetImage(ctx context.Context, refOrID string, options imagebackend.GetImageOpts) (*image.Image, error)
}

View File

@@ -77,7 +77,7 @@ func (c *containerAdapter) pullImage(ctx context.Context) error {
named, err := reference.ParseNormalizedNamed(spec.Image)
if err == nil {
if _, ok := named.(reference.Canonical); ok {
_, err := c.imageBackend.GetImage(ctx, spec.Image, backend.GetImageOpts{})
_, err := c.imageBackend.GetImage(ctx, spec.Image, imagebackend.GetImageOpts{})
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return err
}