From bc445d7595498d2accafc3d48db4d3d37e46e46f Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Fri, 10 May 2019 11:35:09 -0700 Subject: [PATCH] Forward sandbox config to PullImage request Signed-off-by: Justin Terry (VM) --- pkg/server/helpers.go | 4 ++-- pkg/server/sandbox_run.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/server/helpers.go b/pkg/server/helpers.go index 3acda66fb..ec1fae171 100644 --- a/pkg/server/helpers.go +++ b/pkg/server/helpers.go @@ -275,7 +275,7 @@ func getUserFromImage(user string) (*int64, string) { // ensureImageExists returns corresponding metadata of the image reference, if image is not // pulled yet, the function will pull the image. -func (c *criService) ensureImageExists(ctx context.Context, ref string) (*imagestore.Image, error) { +func (c *criService) ensureImageExists(ctx context.Context, ref string, config *runtime.PodSandboxConfig) (*imagestore.Image, error) { image, err := c.localResolve(ref) if err != nil && err != store.ErrNotExist { return nil, errors.Wrapf(err, "failed to get image %q", ref) @@ -284,7 +284,7 @@ func (c *criService) ensureImageExists(ctx context.Context, ref string) (*images return &image, nil } // Pull image to ensure the image exists - resp, err := c.PullImage(ctx, &runtime.PullImageRequest{Image: &runtime.ImageSpec{Image: ref}}) + resp, err := c.PullImage(ctx, &runtime.PullImageRequest{Image: &runtime.ImageSpec{Image: ref}, SandboxConfig: config}) if err != nil { return nil, errors.Wrapf(err, "failed to pull image %q", ref) } diff --git a/pkg/server/sandbox_run.go b/pkg/server/sandbox_run.go index 328edd716..024bbe401 100644 --- a/pkg/server/sandbox_run.go +++ b/pkg/server/sandbox_run.go @@ -92,7 +92,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox ) // Ensure sandbox container image snapshot. - image, err := c.ensureImageExists(ctx, c.config.SandboxImage) + image, err := c.ensureImageExists(ctx, c.config.SandboxImage, config) if err != nil { return nil, errors.Wrapf(err, "failed to get sandbox image %q", c.config.SandboxImage) }