Skip to content

Commit

Permalink
load docker-image: only use sanitzed name for retagging
Browse files Browse the repository at this point in the history
  • Loading branch information
rmfitzpatrick committed Dec 1, 2022
1 parent 7d26b50 commit 6552338
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 6552338

Please sign in to comment.