Merge branch 'main' into main-v5
This commit is contained in:
commit
95e0045418
@ -121,6 +121,15 @@
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Shanduur",
|
||||
"name": "Mateusz Urbanek",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/32583062?v=4",
|
||||
"profile": "http://shanduur.github.io",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
@ -9,7 +9,7 @@
|
||||
[](https://goreportcard.com/report/github.com/rancher/k3d)
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
[](#contributors-)
|
||||
[](#contributors-)
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||
[](code_of_conduct.md)
|
||||
|
||||
@ -139,6 +139,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||
<td align="center"><a href="http://wsl.dev"><img src="https://avatars2.githubusercontent.com/u/905874?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nuno do Carmo</b></sub></a><br /><a href="#content-nunix" title="Content">🖋</a> <a href="#tutorial-nunix" title="Tutorials">✅</a> <a href="#question-nunix" title="Answering Questions">💬</a></td>
|
||||
<td align="center"><a href="https://github.com/erwinkersten"><img src="https://avatars0.githubusercontent.com/u/4391121?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Erwin Kersten</b></sub></a><br /><a href="https://github.com/rancher/k3d/commits?author=erwinkersten" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="http://www.alexsears.com"><img src="https://avatars.githubusercontent.com/u/3712883?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alex Sears</b></sub></a><br /><a href="https://github.com/rancher/k3d/commits?author=searsaw" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="http://shanduur.github.io"><img src="https://avatars.githubusercontent.com/u/32583062?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mateusz Urbanek</b></sub></a><br /><a href="https://github.com/rancher/k3d/commits?author=Shanduur" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@ -192,22 +192,31 @@ func executeCheckInContainer(ctx context.Context, image string, cmd []string) (i
|
||||
}
|
||||
defer docker.Close()
|
||||
|
||||
if err = pullImage(ctx, docker, image); err != nil {
|
||||
return -1, err
|
||||
}
|
||||
|
||||
resp, err := docker.ContainerCreate(ctx, &container.Config{
|
||||
Image: image,
|
||||
Cmd: cmd,
|
||||
Tty: false,
|
||||
Entrypoint: []string{},
|
||||
}, nil, nil, nil, "")
|
||||
if err != nil {
|
||||
l.Log().Errorf("Failed to create container from image %s with cmd %s", image, cmd)
|
||||
return -1, err
|
||||
// create container
|
||||
var resp container.ContainerCreateCreatedBody
|
||||
for {
|
||||
resp, err = docker.ContainerCreate(ctx, &container.Config{
|
||||
Image: image,
|
||||
Cmd: cmd,
|
||||
Tty: false,
|
||||
Entrypoint: []string{},
|
||||
}, nil, nil, nil, "")
|
||||
if err != nil {
|
||||
if client.IsErrNotFound(err) {
|
||||
if err := pullImage(ctx, docker, image); err != nil {
|
||||
l.Log().Errorf("Failed to create container from image %s with cmd %s", image, cmd)
|
||||
return -1, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
l.Log().Errorf("Failed to create container from image %s with cmd %s", image, cmd)
|
||||
return -1, err
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
if err = startContainer(ctx, resp.ID); err != nil {
|
||||
l.Log().Errorf("Failed to start container from image %s with cmd %s", image, cmd)
|
||||
return -1, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user