Skip to content

Commit

Permalink
Merge pull request #7425 from medyagh/remove_overlay
Browse files Browse the repository at this point in the history
remove kic overlay network for docker-runtime
  • Loading branch information
medyagh authored Apr 7, 2020
2 parents a57dc85 + 75bc442 commit d84b942
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions hack/preload-images/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"k8s.io/minikube/pkg/minikube/localpath"
)

func generateTarball(kubernetesVersion, tarballFilename string) error {
func generateTarball(kubernetesVersion, containerRuntime, tarballFilename string) error {
defer func() {
if err := deleteMinikube(); err != nil {
fmt.Println(err)
Expand Down Expand Up @@ -68,7 +68,11 @@ func generateTarball(kubernetesVersion, tarballFilename string) error {
return errors.Wrap(err, "kubeadm images")
}

for _, img := range append(imgs, kic.OverlayImage) {
if containerRuntime != "docker" { // kic overlay image is only needed by containerd and cri-o https://github.com/kubernetes/minikube/issues/7428
imgs = append(imgs, kic.OverlayImage)
}

for _, img := range imgs {
cmd := exec.Command("docker", "exec", profile, "docker", "pull", img)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand All @@ -93,6 +97,7 @@ func generateTarball(kubernetesVersion, tarballFilename string) error {
}

func createImageTarball(tarballFilename string) error {
// directories to save into tarball
dirs := []string{
fmt.Sprintf("./lib/docker/%s", dockerStorageDriver),
"./lib/docker/image",
Expand Down
2 changes: 1 addition & 1 deletion hack/preload-images/preload_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {
continue
}
fmt.Printf("A preloaded tarball for k8s version %s doesn't exist, generating now...\n", kv)
if err := generateTarball(kv, tf); err != nil {
if err := generateTarball(kv, cr, tf); err != nil {
exit.WithError(fmt.Sprintf("generating tarball for k8s version %s with %s", kv, cr), err)
}
if err := uploadTarball(tf); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/minikube/bootstrapper/kubeadm/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ func (k *Bootstrapper) init(cfg config.ClusterConfig) error {
return errors.Wrap(err, "run")
}

if cfg.Driver == driver.Docker {
// this is required for containerd and cri-o runtime. till we close https://github.com/kubernetes/minikube/issues/7428
if driver.IsKIC(cfg.Driver) && cfg.KubernetesConfig.ContainerRuntime != "docker" {
if err := k.applyKicOverlay(cfg); err != nil {
return errors.Wrap(err, "apply kic overlay")
}
Expand Down

0 comments on commit d84b942

Please sign in to comment.