Skip to content

Commit

Permalink
Only do cache bind mounts for local engines
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 24, 2022
1 parent d9448be commit e0a9c26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/drivers/kic/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func CreateContainerNode(p CreateParams) error {
runArgs = append(runArgs, "--ip", p.IP)
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" && !IsExternalDaemonHost(p.OCIBinary) {
// make sure directory exists, to avoid docker creating it as the root user
if err := os.MkdirAll(detect.ImageCacheDir(), 0755); err != nil {
return errors.Wrap(err, "mkdir cache")
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/machine/cache_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func LoadCachedImages(cc *config.ClusterConfig, runner command.Runner, images []
if err == nil {
return nil
}
if driver.IsKIC(cc.Driver) && runtime.GOOS == "linux" {
if driver.IsKIC(cc.Driver) && runtime.GOOS == "linux" && !IsExternalDaemonHost(cc.Driver) {
klog.Infof("%q needs load: %v", image, err)
return volumeLoadCachedImage(runner, cc.KubernetesConfig, image, cacheDir)
}
Expand Down Expand Up @@ -402,7 +402,7 @@ func SaveCachedImages(cc *config.ClusterConfig, runner command.Runner, images []
for _, image := range images {
image := image
g.Go(func() error {
if driver.IsKIC(cc.Driver) && runtime.GOOS == "linux" {
if driver.IsKIC(cc.Driver) && runtime.GOOS == "linux" && !IsExternalDaemonHost(cc.Driver) {
return volumeSaveCachedImage(runner, cc.KubernetesConfig, image, cacheDir)
}
return transferAndSaveCachedImage(runner, cc.KubernetesConfig, image, cacheDir)
Expand Down

0 comments on commit e0a9c26

Please sign in to comment.