env_kind.go: load image into kind cluster#73
Merged
saswatamcode merged 3 commits intoefficientgo:mainfrom Sep 2, 2025
Merged
Conversation
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>
leonnicolas
commented
Nov 18, 2024
Pull only the image if it isn't present on the machine and always load it into the cluster.
|
|
||
| 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 { |
Collaborator
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
you are right. I think I was confusing docker image inspect with docker manifest inspect. So this line can remain as it was.
Signed-off-by: leonnicolas <leonloechner@gmx.de>
Contributor
|
cc @saswatamcode ping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit load the image into the kind cluster with
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