Skip to content

env_kind.go: load image into kind cluster#73

Merged
saswatamcode merged 3 commits intoefficientgo:mainfrom
leonnicolas:kind-load-image-into-kind-cluster
Sep 2, 2025
Merged

env_kind.go: load image into kind cluster#73
saswatamcode merged 3 commits intoefficientgo:mainfrom
leonnicolas:kind-load-image-into-kind-cluster

Conversation

@leonnicolas
Copy link
Copy Markdown
Contributor

@leonnicolas leonnicolas commented Nov 16, 2024

This commit load the image into the kind cluster with

kind load docker-image <image-name>

We need to do this if the image is not in a public registry.
It also stops using docker manifest inspect.
Instead we should rather check if the image is present locally.
If so we can load it into the cluster, otherwise we have to pull it first.

Signed-off-by: leonnicolas leonloechner@gmx.de

This commit load the image into the kind cluster with
```
kind load docker-image <image-name>
```
We need to do this if the image is not in a public registry.
Honestly, the purpose of the `preLoadImage()` function is not clear to me.

Signed-off-by: leonnicolas <leonloechner@gmx.de>
Comment thread env_kind.go Outdated
Pull only the image if it isn't present on the machine and always load
it into the cluster.
Comment thread env_kind.go Outdated

if _, err = r.env.execContext(ctx, "docker", "image", "inspect", r.opts.Image).CombinedOutput(); err == nil {
return nil
if image, err := r.env.execContext(ctx, "docker", "image", "ls", r.opts.Image, "--format", "{{.Repository}}:{{.Tag}}").CombinedOutput(); err != nil {
Copy link
Copy Markdown
Collaborator

@saswatamcode saswatamcode Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the benefit of not using docker image inspect here.
If the image isn't present locally it would respond with No such image, and you can pull?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. I think I was confusing docker image inspect with docker manifest inspect. So this line can remain as it was.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: leonnicolas <leonloechner@gmx.de>
@leonnicolas leonnicolas requested a review from saswatamcode April 1, 2025 15:35
@bwplotka
Copy link
Copy Markdown
Contributor

bwplotka commented Sep 2, 2025

cc @saswatamcode ping

Copy link
Copy Markdown
Collaborator

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@saswatamcode saswatamcode merged commit 413bbd3 into efficientgo:main Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants