Skip to content

Commit

Permalink
Add an exception for 'latest' images
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-zuyev committed Jun 8, 2021
1 parent 557d3a5 commit 6261f9d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/minikube/download/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package download

import (
"fmt"
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -192,7 +193,13 @@ func CacheToDaemon(img string) error {

tag, ref, err := parseImage(img)
if err != nil {
return nil
return err
}
// do not use cache if image is set in format <name>:latest
if _, ok := ref.(name.Tag); ok {
if tag.Name() == "latest" {
return fmt.Errorf("can't cache 'latest' tag")
}
}

i, err := tarball.ImageFromPath(p, tag)
Expand Down

0 comments on commit 6261f9d

Please sign in to comment.