Merge branch 'master' into int-memory-limits

pull/7938/head
Thomas Stromberg 2020-04-30 11:23:45 -07:00
commit 6b899a5f8e
15 changed files with 173 additions and 206 deletions

View File

@ -1,5 +1,45 @@
# Release Notes
## Version 1.10.0-beta.2 - 2020-04-29
Improvements:
* Upgrade default Kubernetes to v1.18.1 [#7714](https://github.com/kubernetes/minikube/pull/7714)
* Automatically apply CNI on multinode clusters [#7930](https://github.com/kubernetes/minikube/pull/7930)
* Add Metal LB addon [#7308](https://github.com/kubernetes/minikube/pull/7308)
* Add `(host|control-plane).minikube.internal` to /etc/hosts [#7247](https://github.com/kubernetes/minikube/pull/7247)
* Add "sudo" to podman calls [#7631](https://github.com/kubernetes/minikube/pull/7631)
* Add list option for "minikube node" command [#7851](https://github.com/kubernetes/minikube/pull/7851)
* Add option to force docker to use systemd as cgroup manager [#7815](https://github.com/kubernetes/minikube/pull/7815)
* Improve auto-select memory for multinode clusters [#7928](https://github.com/kubernetes/minikube/pull/7928)
* bump dashboard image v2.0.0 [#7849](https://github.com/kubernetes/minikube/pull/7849)
* Upgrade docker driver base image to v0.0.10 [#7858](https://github.com/kubernetes/minikube/pull/7858)
* docker-env: fall back to bash if can not detect shell. [#7887](https://github.com/kubernetes/minikube/pull/7887)
Bug fixes:
* docker/podman drivers: wait for service before open url [#7898](https://github.com/kubernetes/minikube/pull/7898)
* addon registry-alias: change hosts update container image [#7864](https://github.com/kubernetes/minikube/pull/7864)
* Fix sysctl fs.protected_regular=1 typo [#7882](https://github.com/kubernetes/minikube/pull/7882)
* change emoji for: notifying new kubernetes version is available [#7835](https://github.com/kubernetes/minikube/pull/7835)
* contained cni: rename default cni file to have higher priority [#7875](https://github.com/kubernetes/minikube/pull/7875)
Huge thank you for this release towards our contributors:
- Anders F Björklund
- Kenta Iso
- Marcin Niemira
- Medya Ghazizadeh
- Priya Wadhwa
- Radoslaw Smigielski
- Sharif Elgamal
- Thomas Strömberg
- Tobias Klauser
- Travis Mehlinger
- Zhongcheng Lao
- ZouYu
- priyawadhwa
## Version 1.10.0-beta.1 - 2020-04-22
Improvements:

View File

@ -15,7 +15,7 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 10
VERSION_BUILD ?= 0-beta.1
VERSION_BUILD ?= 0-beta.2
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
VERSION ?= v$(RAW_VERSION)

View File

@ -81,7 +81,7 @@ Wants=crio.service
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.18.0/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=/var/run/crio/crio.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
ExecStart=/var/lib/minikube/binaries/v1.18.1/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=/var/run/crio/crio.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
[Install]
`,
@ -107,7 +107,7 @@ Wants=containerd.service
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.18.0/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
ExecStart=/var/lib/minikube/binaries/v1.18.1/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
[Install]
`,
@ -140,7 +140,7 @@ Wants=containerd.service
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.18.0/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.200 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
ExecStart=/var/lib/minikube/binaries/v1.18.1/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.200 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
[Install]
`,
@ -167,7 +167,7 @@ Wants=docker.socket
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.18.0/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=docker --fail-swap-on=false --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-infra-container-image=docker-proxy-image.io/google_containers/pause:3.2 --pod-manifest-path=/etc/kubernetes/manifests
ExecStart=/var/lib/minikube/binaries/v1.18.1/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=docker --fail-swap-on=false --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-infra-container-image=docker-proxy-image.io/google_containers/pause:3.2 --pod-manifest-path=/etc/kubernetes/manifests
[Install]
`,

View File

@ -27,9 +27,9 @@ import (
const (
// DefaultKubernetesVersion is the default kubernetes version
DefaultKubernetesVersion = "v1.18.0"
DefaultKubernetesVersion = "v1.18.1"
// NewestKubernetesVersion is the newest Kubernetes version to test against
NewestKubernetesVersion = "v1.18.0"
NewestKubernetesVersion = "v1.18.1"
// OldestKubernetesVersion is the oldest Kubernetes version to test against
OldestKubernetesVersion = "v1.12.0"
// DefaultClusterName is the default nane for the k8s cluster

View File

@ -24,7 +24,6 @@ import (
"github.com/blang/semver"
"github.com/golang/glog"
"github.com/hashicorp/go-getter"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/localpath"
)
@ -58,28 +57,14 @@ func Binary(binary, version, osName, archName string) (string, error) {
return targetFilepath, nil
}
if err = os.MkdirAll(targetDir, 0777); err != nil {
return "", errors.Wrapf(err, "mkdir %s", targetDir)
}
tmpDst := targetFilepath + ".download"
client := &getter.Client{
Src: url,
Dst: tmpDst,
Mode: getter.ClientModeFile,
Options: []getter.ClientOption{getter.WithProgress(DefaultProgressBar)},
}
glog.Infof("Downloading: %+v", client)
if err := client.Get(); err != nil {
if err := download(url, targetFilepath); err != nil {
return "", errors.Wrapf(err, "download failed: %s", url)
}
if osName == runtime.GOOS && archName == runtime.GOARCH {
if err = os.Chmod(tmpDst, 0755); err != nil {
if err = os.Chmod(targetFilepath, 0755); err != nil {
return "", errors.Wrapf(err, "chmod +x %s", targetFilepath)
}
}
return targetFilepath, os.Rename(tmpDst, targetFilepath)
return targetFilepath, nil
}

View File

@ -1,129 +0,0 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package download
import (
"io/ioutil"
"os"
"runtime"
"testing"
)
func TestCacheBinary(t *testing.T) {
oldMinikubeHome := os.Getenv("MINIKUBE_HOME")
defer os.Setenv("MINIKUBE_HOME", oldMinikubeHome)
minikubeHome, err := ioutil.TempDir("/tmp", "")
if err != nil {
t.Fatalf("error during creating tmp dir: %v", err)
}
defer func() { //clean up tempdir
err := os.RemoveAll(minikubeHome)
if err != nil {
t.Errorf("failed to clean up temp folder %q", minikubeHome)
}
}()
defer os.RemoveAll(minikubeHome)
noWritePermDir, err := ioutil.TempDir("/tmp", "")
if err != nil {
t.Fatalf("error during creating tmp dir: %v", err)
}
defer func() { //clean up tempdir
err := os.RemoveAll(noWritePermDir)
if err != nil {
t.Errorf("failed to clean up temp folder %q", noWritePermDir)
}
}()
err = os.Chmod(noWritePermDir, 0000)
if err != nil {
t.Fatalf("error (%v) during changing permissions of dir %v", err, noWritePermDir)
}
var tc = []struct {
desc, version, osName, archName string
minikubeHome, binary, description string
err bool
}{
{
desc: "ok kubeadm",
version: "v1.16.0",
osName: "linux",
archName: runtime.GOARCH,
binary: "kubeadm",
err: false,
minikubeHome: minikubeHome,
},
{
desc: "minikube home in dir without perms and arm runtime",
version: "v1.16.0",
osName: runtime.GOOS,
archName: "arm",
binary: "kubectl",
err: true,
minikubeHome: noWritePermDir,
},
{
desc: "minikube home in dir without perms",
version: "v1.16.0",
osName: runtime.GOOS,
archName: runtime.GOARCH,
binary: "kubectl",
err: true,
minikubeHome: noWritePermDir,
},
{
desc: "binary foo",
version: "v1.16.0",
osName: runtime.GOOS,
archName: runtime.GOARCH,
binary: "foo",
err: true,
minikubeHome: minikubeHome,
},
{
desc: "version 9000",
version: "v9000",
osName: runtime.GOOS,
archName: runtime.GOARCH,
binary: "foo",
err: true,
minikubeHome: minikubeHome,
},
{
desc: "bad os",
version: "v1.16.0",
osName: "no-such-os",
archName: runtime.GOARCH,
binary: "kubectl",
err: true,
minikubeHome: minikubeHome,
},
}
for _, test := range tc {
t.Run(test.desc, func(t *testing.T) {
os.Setenv("MINIKUBE_HOME", test.minikubeHome)
_, err := Binary(test.binary, test.version, test.osName, test.archName)
if err != nil && !test.err {
t.Fatalf("Got unexpected error %v", err)
}
if err == nil && test.err {
t.Fatalf("Expected error but got %v", err)
}
})
}
}

View File

@ -0,0 +1,88 @@
/*
Copyright 2020 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package download
import (
"flag"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/golang/glog"
"github.com/hashicorp/go-getter"
"github.com/pkg/errors"
)
var (
mockMode = false
)
// EnableMock allows tests to selectively enable if downloads are mocked
func EnableMock(b bool) {
mockMode = b
}
// download is a well-configured atomic download function
func download(src string, dst string) error {
tmpDst := dst + ".download"
client := &getter.Client{
Src: src,
Dst: tmpDst,
Dir: false,
Mode: getter.ClientModeFile,
Options: []getter.ClientOption{getter.WithProgress(DefaultProgressBar)},
Getters: map[string]getter.Getter{
"file": &getter.FileGetter{Copy: false},
"http": &getter.HttpGetter{Netrc: false},
"https": &getter.HttpGetter{Netrc: false},
},
}
if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil {
return errors.Wrap(err, "mkdir")
}
// Don't bother with getter.MockGetter, as we don't provide a way to inspect the outcome
if mockMode {
glog.Infof("Mock download: %s -> %s", src, dst)
// Callers expect the file to exist
_, err := os.Create(dst)
return err
}
// Politely prevent tests from shooting themselves in the foot
if withinUnitTest() {
return fmt.Errorf("unmocked download under test")
}
glog.Infof("Downloading: %s -> %s", src, dst)
if err := client.Get(); err != nil {
return errors.Wrapf(err, "getter: %+v", client)
}
return os.Rename(tmpDst, dst)
}
// withinUnitTset detects if we are in running within a unit-test
func withinUnitTest() bool {
// Nope, it's the integration test
if flag.Lookup("minikube-start-args") != nil || strings.HasPrefix(filepath.Base(os.Args[0]), "e2e-") {
return false
}
return flag.Lookup("test.v") != nil || strings.HasSuffix(os.Args[0], "test")
}

View File

@ -21,8 +21,6 @@ import (
"os"
"github.com/blang/semver"
"github.com/golang/glog"
"github.com/hashicorp/go-getter"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/out"
)
@ -35,25 +33,10 @@ func driverWithChecksumURL(name string, v semver.Version) string {
// Driver downloads an arbitrary driver
func Driver(name string, destination string, v semver.Version) error {
out.T(out.FileDownload, "Downloading driver {{.driver}}:", out.V{"driver": name})
tmpDst := destination + ".download"
url := driverWithChecksumURL(name, v)
client := &getter.Client{
Src: url,
Dst: tmpDst,
Mode: getter.ClientModeFile,
Options: []getter.ClientOption{getter.WithProgress(DefaultProgressBar)},
if err := download(driverWithChecksumURL(name, v), destination); err != nil {
return errors.Wrap(err, "download")
}
glog.Infof("Downloading: %+v", client)
if err := client.Get(); err != nil {
return errors.Wrapf(err, "download failed: %s", url)
}
// Give downloaded drivers a baseline decent file permission
err := os.Chmod(tmpDst, 0755)
if err != nil {
return err
}
return os.Rename(tmpDst, destination)
return os.Chmod(destination, 0755)
}

View File

@ -26,7 +26,6 @@ import (
"time"
"github.com/golang/glog"
"github.com/hashicorp/go-getter"
"github.com/juju/mutex"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/localpath"
@ -134,19 +133,5 @@ func downloadISO(isoURL string, skipChecksum bool) error {
urlWithChecksum = isoURL
}
tmpDst := dst + ".download"
opts := []getter.ClientOption{getter.WithProgress(DefaultProgressBar)}
client := &getter.Client{
Src: urlWithChecksum,
Dst: tmpDst,
Mode: getter.ClientModeFile,
Options: opts,
}
glog.Infof("full url: %s", urlWithChecksum)
if err := client.Get(); err != nil {
return errors.Wrap(err, isoURL)
}
return os.Rename(tmpDst, dst)
return download(urlWithChecksum, dst)
}

View File

@ -30,7 +30,6 @@ import (
"google.golang.org/api/option"
"github.com/golang/glog"
"github.com/hashicorp/go-getter"
"github.com/pkg/errors"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/localpath"
@ -133,16 +132,7 @@ func Preload(k8sVersion, containerRuntime string) error {
out.T(out.FileDownload, "Downloading Kubernetes {{.version}} preload ...", out.V{"version": k8sVersion})
url := remoteTarballURL(k8sVersion, containerRuntime)
tmpDst := targetPath + ".download"
client := &getter.Client{
Src: url,
Dst: tmpDst,
Mode: getter.ClientModeFile,
Options: []getter.ClientOption{getter.WithProgress(DefaultProgressBar)},
}
glog.Infof("Downloading: %+v", client)
if err := client.Get(); err != nil {
if err := download(url, targetPath); err != nil {
return errors.Wrapf(err, "download failed: %s", url)
}
@ -150,10 +140,11 @@ func Preload(k8sVersion, containerRuntime string) error {
return errors.Wrap(err, "saving checksum file")
}
if err := verifyChecksum(k8sVersion, containerRuntime, tmpDst); err != nil {
if err := verifyChecksum(k8sVersion, containerRuntime, targetPath); err != nil {
return errors.Wrap(err, "verify")
}
return os.Rename(tmpDst, targetPath)
return nil
}
func saveChecksumFile(k8sVersion, containerRuntime string) error {

View File

@ -25,6 +25,7 @@ import (
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/bootstrapper"
"k8s.io/minikube/pkg/minikube/command"
"k8s.io/minikube/pkg/minikube/download"
)
type copyFailRunner struct {
@ -82,6 +83,8 @@ func TestCopyBinary(t *testing.T) {
}
func TestCacheBinariesForBootstrapper(t *testing.T) {
download.EnableMock(true)
oldMinikubeHome := os.Getenv("MINIKUBE_HOME")
defer os.Setenv("MINIKUBE_HOME", oldMinikubeHome)

View File

@ -24,6 +24,7 @@ import (
// Driver used by testdata
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/download"
_ "k8s.io/minikube/pkg/minikube/registry/drvs/virtualbox"
"github.com/docker/machine/libmachine/drivers"
@ -70,6 +71,8 @@ var defaultClusterConfig = config.ClusterConfig{
}
func TestCreateHost(t *testing.T) {
download.EnableMock(true)
RegisterMockDriver(t)
api := tests.NewMockAPI(t)
@ -113,6 +116,8 @@ func TestCreateHost(t *testing.T) {
}
func TestStartHostExists(t *testing.T) {
download.EnableMock(true)
RegisterMockDriver(t)
api := tests.NewMockAPI(t)
@ -150,6 +155,8 @@ func TestStartHostExists(t *testing.T) {
}
func TestStartHostErrMachineNotExist(t *testing.T) {
download.EnableMock(true)
RegisterMockDriver(t)
api := tests.NewMockAPI(t)
// Create an incomplete host with machine does not exist error(i.e. User Interrupt Cancel)
@ -195,6 +202,8 @@ func TestStartHostErrMachineNotExist(t *testing.T) {
}
func TestStartStoppedHost(t *testing.T) {
download.EnableMock(true)
RegisterMockDriver(t)
api := tests.NewMockAPI(t)
// Create an initial host.
@ -230,6 +239,8 @@ func TestStartStoppedHost(t *testing.T) {
}
func TestStartHost(t *testing.T) {
download.EnableMock(true)
RegisterMockDriver(t)
api := tests.NewMockAPI(t)
@ -258,6 +269,8 @@ func TestStartHost(t *testing.T) {
}
func TestStartHostConfig(t *testing.T) {
download.EnableMock(true)
RegisterMockDriver(t)
api := tests.NewMockAPI(t)

View File

@ -65,9 +65,9 @@ minikube start [flags]
--insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.
--install-addons If set, install addons. Defaults to true. (default true)
--interactive Allow user prompts for more information (default true)
--iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.10.0-beta.1.iso,https://github.com/kubernetes/minikube/releases/download/v1.10.0-beta.1/minikube-v1.10.0-beta.1.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.10.0-beta.1.iso])
--iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.10.0-beta.2.iso,https://github.com/kubernetes/minikube/releases/download/v1.10.0-beta.2/minikube-v1.10.0-beta.2.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.10.0-beta.2.iso])
--keep-context This will keep the existing kubectl context and will create a minikube context.
--kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.18.0, 'latest' for v1.18.0). Defaults to 'stable'.
--kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.18.1, 'latest' for v1.18.1). Defaults to 'stable'.
--kvm-gpu Enable experimental NVIDIA GPU support in minikube
--kvm-hidden Hide the hypervisor signature from the guest in minikube (kvm2 driver only)
--kvm-network string The KVM network name. (kvm2 driver only) (default "default")

View File

@ -20,6 +20,7 @@ import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"testing"
@ -147,7 +148,11 @@ func TestHyperKitDriverInstallOrUpdate(t *testing.T) {
t.Fatalf("Expected new semver. test: %v, got: %v", tc.name, err)
}
err = driver.InstallOrUpdate("hyperkit", dir, newerVersion, true, true)
if err := exec.Command("sudo", "-n", "ls").Run(); err != nil {
t.Skipf("password required to execute 'ls', skipping remaining test: %v", err)
}
err = driver.InstallOrUpdate("hyperkit", dir, newerVersion, false, true)
if err != nil {
t.Fatalf("Failed to update driver to %v. test: %s, got: %v", newerVersion, tc.name, err)
}

View File

@ -34,6 +34,9 @@ var stderrWhitelist = []string{
`slow|long time|Restarting the docker service may improve`,
// don't care if we can't push images to other profiles
`cache_images.go:.*error getting status`,
// network flakiness on VirtualBox
// ! Unable to verify SSH connectivity: dial tcp 192.168.99.249:22: i/o timeout. Will retry...
`SSH.*i/o timeout.retry`,
}
// stderrWhitelistRe combines rootCauses into a single regex