fix(container): do not error on pull image failure
This commit is contained in:
parent
1e759b6f42
commit
18d5ef3db1
@ -178,9 +178,7 @@ func (a *Client) RunContainer(ctx context.Context, params RunContainerParams) (<
|
||||
defer close(errC)
|
||||
|
||||
if err := a.pullImageIfNeeded(ctx, params.ContainerConfig.Image, containerStateC); err != nil {
|
||||
a.logger.Error("Error pulling image", "err", err)
|
||||
sendError(fmt.Errorf("image pull: %w", err))
|
||||
return
|
||||
a.logger.Warn("Error pulling image", "err", err)
|
||||
}
|
||||
|
||||
containerConfig := *params.ContainerConfig
|
||||
|
@ -44,7 +44,7 @@ func TestClientRunContainer(t *testing.T) {
|
||||
dockerClient.
|
||||
EXPECT().
|
||||
ImagePull(mock.Anything, "alpine", image.PullOptions{}).
|
||||
Return(io.NopCloser(bytes.NewReader(nil)), nil)
|
||||
Return(io.NopCloser(bytes.NewReader(nil)), errors.New("error pulling image should not be fatal"))
|
||||
dockerClient.
|
||||
EXPECT().
|
||||
ContainerCreate(mock.Anything, mock.Anything, mock.Anything, mock.Anything, (*ocispec.Platform)(nil), mock.Anything).
|
||||
|
Loading…
x
Reference in New Issue
Block a user