Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load docker-image: only use sanitized name for retagging #3013

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/cmd/kind/load/docker-image/docker-image.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ func runE(logger log.Logger, flags *flagpole, args []string) error {
imageID := imageIDs[i]
processed := false
for _, node := range candidateNodes {
exists, reTagRequired, imageName := checkIfImageReTagRequired(node, imageID, imageName, nodeutils.ImageTags)
exists, reTagRequired, sanitizedImageName := checkIfImageReTagRequired(node, imageID, imageName, nodeutils.ImageTags)
if exists && !reTagRequired {
continue
}

if reTagRequired {
// We will try to re-tag the image. If the re-tag fails, we will fall back to the default behavior of loading
// the images into the nodes again
logger.V(0).Infof("Image with ID: %s already present on the node %s but is missing the tag %s. re-tagging...", imageID, node.String(), imageName)
if err := nodeutils.ReTagImage(node, imageID, imageName); err != nil {
logger.V(0).Infof("Image with ID: %s already present on the node %s but is missing the tag %s. re-tagging...", imageID, node.String(), sanitizedImageName)
if err := nodeutils.ReTagImage(node, imageID, sanitizedImageName); err != nil {
logger.Errorf("failed to re-tag image on the node %s due to an error %s. Will load it instead...", node.String(), err)
selectedNodes = append(selectedNodes, node)
} else {
Expand Down