Merge branch 'master' into lint

pull/3839/head
Thomas Strömberg 2019-03-20 10:16:09 -07:00 committed by GitHub
commit 4756b15bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 221 additions and 124 deletions

View File

@ -1,5 +1,5 @@
If this is a bug report, please include:
- [ ] How to replicate the error, including the exact command-lines used.
- [ ] The full output of the command that failed
- [ ] The operating system name and version used
<!-- Thank you for sharing your experience! If you are reporting a bug, please include: -->
<!-- * The exact command-lines used so that we can replicate the issue -->
<!-- * The full output of the command that failed -->
<!-- * The output of the "minikube logs" command, if applicable -->
<!-- * Which operating system version was used -->

View File

@ -1,5 +1,39 @@
# Minikube Release Notes
# Version 0.35.0 - 2019-03-06
* Update default Kubernetes version to v1.13.4 (latest stable) [#3807](https://github.com/kubernetes/minikube/pull/3807)
* Update docker/machine to fix the AMD bug [#3809](https://github.com/kubernetes/minikube/pull/3809)
* Enable tap and vhost-net in minikube iso [#3758](https://github.com/kubernetes/minikube/pull/3758)
* Enable kernel modules necessary for IPVS [#3783](https://github.com/kubernetes/minikube/pull/3783)
* Add Netfilter `xt_socket` module to complete support for Transparent Proxying (TPROXY) [#3712](https://github.com/kubernetes/minikube/pull/3712)
* Change DefaultMountVersion to 9p2000.L [#3796](https://github.com/kubernetes/minikube/pull/3796)
* fix incorrect style name mount [#3789](https://github.com/kubernetes/minikube/pull/3789)
* When missing a hypervisor, omit the bug report prompt [#3787](https://github.com/kubernetes/minikube/pull/3787)
* Fix minikube logs for other container runtimes [#3780](https://github.com/kubernetes/minikube/pull/3780)
* Improve reliability of kube-proxy configmap updates (retry, block until pods are up) [#3774](https://github.com/kubernetes/minikube/pull/3774)
* update libvirtd [#3711](https://github.com/kubernetes/minikube/pull/3711)
* Add flag for disabling the VirtualBox VTX check [#3734](https://github.com/kubernetes/minikube/pull/3734)
* Add make target for building a rpm file [#3742](https://github.com/kubernetes/minikube/pull/3742)
* Improve building of deb package (versioning and permissions) [#3745](https://github.com/kubernetes/minikube/pull/3745)
* chown command should be against user $HOME, not roots home directory. [#3719](https://github.com/kubernetes/minikube/pull/3719)
Thank you to the following contributors who made this release possible:
- Anders F Björklund
- Artiom Diomin
- Don McCasland
- Elijah Oyekunle
- Filip Havlíček
- Ihor Dvoretskyi
- karmab
- Mas
- Miel Donkers
- Thomas Strömberg
- Tom Reznik
- Yaroslav Skopets
- Yoan Blanc
# Version 0.34.1 - 2019-02-16
* Make non-zero ssh error codes less dramatic [#3703](https://github.com/kubernetes/minikube/pull/3703)

4
Gopkg.lock generated
View File

@ -69,7 +69,7 @@
[[projects]]
branch = "master"
digest = "1:47b479ee07f66c92682bcf27e3a65b411b7ba52bfc28fd0b6b74a742620fc61a"
digest = "1:d4104968fb55cff5276444ffcf4693fa03deadc7cd98ed15005bf55e26a2ded1"
name = "github.com/docker/machine"
packages = [
"commands/mcndirs",
@ -106,7 +106,7 @@
"version",
]
pruneopts = "NUT"
revision = "a773edc6f013c9fab13360fea0192fd335023a16"
revision = "533ea58a3e7efb4b2b6cc24bb0b7b565e64d6b0e"
source = "github.com/machine-drivers/machine"
[[projects]]

View File

@ -14,8 +14,8 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 0
VERSION_MINOR ?= 34
VERSION_BUILD ?= 1
VERSION_MINOR ?= 35
VERSION_BUILD ?= 0
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).0
@ -99,7 +99,7 @@ out/minikube.d: pkg/minikube/assets/assets.go
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $^ $(MINIKUBEFILES) > $@
-include out/minikube.d
out/minikube-%-$(GOARCH): pkg/minikube/assets/assets.go
out/minikube-%: pkg/minikube/assets/assets.go
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
@ -114,7 +114,7 @@ ifneq ($(GOPATH)/src/$(REPOPATH),$(CURDIR))
$(warning https://github.com/kubernetes/minikube/blob/master/docs/contributors/build_guide.md)
$(warning ******************************************************************************)
endif
GOOS=$* GOARCH=$(GOARCH) go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
endif
.PHONY: e2e-%-amd64

View File

@ -21,6 +21,7 @@ Our [goal](https://github.com/kubernetes/minikube/blob/master/docs/contributors/
## News
* 2019-03-06 - v0.35.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v0.35.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-0350---2019-03-06)]
* 2019-02-16 - v0.34.1 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v0.34.1)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-0341---2019-02-16)]
* 2019-02-15 - v0.34.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v0.34.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-0340---2019-02-15)]
* 2019-01-18 - v0.33.1 released to address [CVE-2019-5736](https://www.openwall.com/lists/oss-security/2019/02/11/2) [[download](https://github.com/kubernetes/minikube/releases/tag/v0.33.1)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-0331---2019-01-18)]

View File

@ -1,10 +1,10 @@
# Defined below are the security contacts for this repo.
#
# They are the contact point for the Product Security Team to reach out
# They are the contact point for the Product Security Committee to reach out
# to for triaging and handling of incoming issues.
#
# The below names agree to abide by the
# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy)
# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy)
# and will be removed and replaced if they violate that agreement.
#
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE

View File

@ -236,7 +236,7 @@ func beginCacheImages(g *errgroup.Group, k8sVersion string) {
if !viper.GetBool(cacheImages) {
return
}
console.OutStyle("caching", "Caching images in the background ...")
console.OutStyle("caching", "Downloading Kubernetes %s images in the background ...", kVersion)
g.Go(func() error {
return machine.CacheImagesForBootstrapper(k8sVersion, viper.GetString(cmdcfg.Bootstrapper))
})
@ -486,7 +486,7 @@ func waitCacheImages(g *errgroup.Group) {
if !viper.GetBool(cacheImages) {
return
}
console.OutStyle("waiting", "Waiting for image caching to complete ...")
console.OutStyle("waiting", "Waiting for image downloads to complete ...")
if err := g.Wait(); err != nil {
glog.Errorln("Error caching images: ", err)
}
@ -552,7 +552,7 @@ func configureMounts() {
return
}
console.OutStyle("mount", "Creating mount %s ...", viper.GetString(mountString))
console.OutStyle("mounting", "Creating mount %s ...", viper.GetString(mountString))
path := os.Args[0]
mountDebugVal := 0
if glog.V(8) {

View File

@ -19,6 +19,7 @@ metadata:
kubernetes.io/name: heapster
kubernetes.io/minikube-addons: heapster
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons-endpoint: heapster
name: heapster
namespace: kube-system
spec:

View File

@ -191,8 +191,21 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
CONFIG_NETFILTER_XT_MATCH_TIME=m
CONFIG_NETFILTER_XT_MATCH_U32=m
CONFIG_IP_SET=y
CONFIG_IP_SET_BITMAP_IP=m
CONFIG_IP_SET_BITMAP_IPMAC=m
CONFIG_IP_SET_BITMAP_PORT=m
CONFIG_IP_SET_HASH_IP=m
CONFIG_IP_SET_HASH_IPMARK=m
CONFIG_IP_SET_HASH_IPPORT=m
CONFIG_IP_SET_HASH_IPPORTIP=m
CONFIG_IP_SET_HASH_IPPORTNET=m
CONFIG_IP_SET_HASH_IPMAC=m
CONFIG_IP_SET_HASH_MAC=m
CONFIG_IP_SET_HASH_NETPORTNET=m
CONFIG_IP_SET_HASH_NET=m
CONFIG_IP_SET_HASH_NETNET=m
CONFIG_IP_SET_HASH_NETPORT=m
CONFIG_IP_SET_HASH_NETIFACE=m
CONFIG_IP_SET_LIST_SET=m
CONFIG_IP_VS=m
CONFIG_IP_VS_IPV6=y
@ -326,6 +339,7 @@ CONFIG_IPVLAN=m
CONFIG_VXLAN=y
CONFIG_NETCONSOLE=y
CONFIG_TUN=y
CONFIG_TAP=y
CONFIG_VETH=y
CONFIG_VIRTIO_NET=y
CONFIG_AMD8111_ETH=m
@ -487,4 +501,6 @@ CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_VHOST_NET=m
CONFIG_VHOST=m
CONFIG_VHOST_VSOCK=m

View File

@ -1,4 +1,12 @@
[
{
"name": "v0.35.0",
"checksums": {
"darwin": "9fb0ce4decb0f40b1b2ee11cad0aa89e13e2d5c46ff0d35875a0a65788dee6b4",
"linux": "e161995604c42c37a797fd11fac5d545f8b75f0796afc3b10679253bf229ff3d",
"windows": "748c9087e876491332897d8dc937eeea92f9fda9003443ef668dc75f5638ed5b"
}
},
{
"name": "v0.34.1",
"checksums": {

View File

@ -1,7 +1,7 @@
### Build Requirements
* A recent Go distribution (>=1.11)
* A recent Go distribution (>=1.12)
* If you're not on Linux, you'll need a Docker installation
* Minikube requires at least 4GB of RAM to compile, which can be problematic when using docker-machine
* minikube requires at least 4GB of RAM to compile, which can be problematic when using docker-machine
#### Prerequisites for different GNU/Linux distributions

View File

@ -1,8 +1,14 @@
# Steps to Release Minikube
## Preparation
* Announce release intent on #minikube
* Pause merge requests so that they are not accidentally left out of the ISO or release notes
## Build a new ISO
You only need to build the minikube ISO when the there are changes in the `deploy/iso` folder.
Major releases always get a new ISO. Minor bugfixes may or may not require it: check for changes in the `deploy/iso` folder.
Note: you can build the ISO using the `hack/jenkins/build_iso.sh` script locally.
* navigate to the minikube ISO jenkins job
@ -18,8 +24,8 @@ The build will take roughly 50 minutes.
Edit the minikube `Makefile`, updating the version number values at the top:
* `VERSION_MINOR` (and `VERSION_MAJOR`, `VERSION_BUILD` as necessary)
* `ISO_VERSION` (only update this if there is a new ISO release - though there almost always is)
* `VERSION_MAJOR`, `VERSION_MINOR`, `VERSION_BUILD` as necessary
* `ISO_VERSION` - defaults to MAJOR.MINOR.0 - update if point release requires a new ISO to be built.
## Run Local Integration Test
@ -55,15 +61,8 @@ Merge the output into CHANGELOG.md. See [PR#3175](https://github.com/kubernetes/
NOTE: Confirm that all release-related PR's have been submitted before doing this step.
Do this in a direct clone of the upstream kubernetes/minikube repository (not your fork!):
```
version=<new version number>
git fetch
git checkout master
git pull
git tag -a v$version -m "$version Release"
git push origin v$version
```shell
hack/tag_release.sh <new version number>
```
## Build the Release
@ -92,20 +91,18 @@ These are downstream packages that are being maintained by others and how to upg
| Arch Linux AUR | https://aur.archlinux.org/packages/minikube/ | "Flag as package out-of-date"
| Brew Cask | https://github.com/Homebrew/homebrew-cask/blob/master/Casks/minikube.rb | The release job creates a new PR in [Homebrew/homebrew-cask](https://github.com/Homebrew/homebrew-cask) with an updated version and SHA256, double check that it's created.
#### Updating the arch linux package
The Arch Linux AUR is maintained at https://aur.archlinux.org/packages/minikube/. The installer PKGBUILD is hosted in its own repository. The public read-only repository is hosted here `https://aur.archlinux.org/minikube.git` and the private read-write repository is hosted here `ssh://aur@aur.archlinux.org/minikube.git`
The repository is tracked in this repo under a submodule `installers/linux/arch_linux`. Currently, its configured to point at the public readonly repository so if you want to push you should run this command to overwrite
`git config submodule.archlinux.url ssh://aur@aur.archlinux.org/minikube.git `
To actually update the package, you should bump the version and update the sha512 checksum. You should also run `makepkg --printsrcinfo > .SRCINFO` to update the srcinfo file. You can edit this manually if you don't have `makepkg` on your machine.
## Verification
After you've finished the release, run this command from the release commit to verify the release was done correctly:
`make check-release`.
Verify release checksums by running`make check-release`
## Update kubernetes.io docs
## Update docs
If there are major changes, please send a PR to update the official setup guide: [Running Kubernetes Locally via Minikube](https://kubernetes.io/docs/setup/minikube/)
If there are major changes, please send a PR to update https://kubernetes.io/docs/setup/minikube/
## Announce!
Places we generally announce releases:
- #minikube on Slack
- minikube-dev, minikube-users mailing list
- Twitter

View File

@ -36,7 +36,7 @@ sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm
sudo yum install libvirt-daemon-kvm qemu-kvm
```
Enable,start, and verify the libvirtd service has started.
Enable,start, and verify the `libvirtd` service has started.
```shell
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
@ -44,13 +44,17 @@ sudo systemctl status libvirtd.service
```
Then you will need to add yourself to libvirt group (older distributions may use libvirtd instead)
Then you will need to add yourself to `libvirt` group (older distributions may use `libvirtd` instead)
`sudo usermod -a -G libvirt $(whoami)`
```shell
sudo usermod -a -G libvirt $(whoami)
```
Then to join the group with your current user session:
`newgrp libvirt`
```shell
newgrp libvirt
```
Now install the driver:
@ -64,9 +68,9 @@ NOTE: Ubuntu users on a release older than 18.04, or anyone experiencing [#3206:
```shell
sudo apt install libvirt-dev
test -d $HOME/go/src/k8s.io/minikube || \
git clone https://github.com/kubernetes/minikube.git $HOME/go/src/k8s.io/minikube
cd $HOME/go/src/k8s.io/minikube
test -d $GOPATH/src/k8s.io/minikube || \
git clone https://github.com/kubernetes/minikube.git $GOPATH/src/k8s.io/minikube
cd $GOPATH/src/k8s.io/minikube
git pull
make out/docker-machine-driver-kvm2
sudo install out/docker-machine-driver-kvm2 /usr/local/bin

View File

@ -11,6 +11,8 @@ The NO_PROXY variable here is important: Without setting it, minikube may not be
* **192.168.99.1/24**: Used by the minikube VM. Configurable for some hypervisors via `--host-only-cidr`
* **10.96.0.0/12**: Used by service cluster IP's. Configurable via `--service-cluster-ip-range`
One important note: If NO_PROXY is required by non-Kubernetes applications, such as Firefox or Chrome, you may want to specifically add the minikube IP to the comma-separated list, as they may not understand IP ranges ([#3827](https://github.com/kubernetes/minikube/issues/3827)).
## Example Usage
### macOS and Linux
@ -39,7 +41,7 @@ minikube start --docker-env=HTTP_PROXY=$HTTP_PROXY --docker-env HTTPS_PROXY=$HTT
To set these environment variables permanently, consider adding these to your [system settings](https://support.microsoft.com/en-au/help/310519/how-to-manage-environment-variables-in-windows-xp) or using [setx](https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe)
## Debugging
## Troubleshooting
### unable to cache ISO... connection refused

View File

@ -96,7 +96,7 @@ Some environment variables may be useful for using the `none` driver:
## Known Issues
* You cannot run more than one `--vm-driver=none` instance on a single host
* `-p` (profiles) are unsupported: It is not possible to run more than one `--vm-driver=none` instance
* Many `minikube` commands are not supported, such as: `dashboard`, `mount`, `ssh`
* minikube with the `none` driver has a confusing permissions model, as some commands need to be run as root ("start"), and others by a regular user ("dashboard")
* CoreDNS detects resolver loop, goes into CrashloopBackoff - [#3511](https://github.com/kubernetes/minikube/issues/3511)

View File

@ -27,6 +27,7 @@
set -e
export TAGNAME=v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
export DEB_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
export RPM_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
export GITHUB_ORGANIZATION="kubernetes"
export GITHUB_REPO="minikube"
@ -117,10 +118,11 @@ FILES_TO_UPLOAD=(
'minikube-linux-amd64.sha256'
'minikube-darwin-amd64'
'minikube-darwin-amd64.sha256'
'minikube-windows-amd64'
'minikube-windows-amd64.sha256'
'minikube-windows-amd64.exe'
'minikube-windows-amd64.exe.sha256'
'minikube-installer.exe'
"minikube_${DEB_VERSION}.deb"
"minikube-${RPM_VERSION}.rpm"
'docker-machine-driver-kvm2'
'docker-machine-driver-hyperkit'
)

39
hack/tag_release.sh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/bash
# Copyright 2018 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.
set -eux -o pipefail
if [ "$#" -ne 1 ]; then
echo "Usage: tag_release.sh <major>.<minor>.<build>" >&2
exit 1
fi
readonly version=$1
readonly tag="v${version}"
if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "supplied version does not match expectations: ${version}"
exit 2
fi
readonly clean_repo=$(mktemp -d)
git clone --depth 1 git@github.com:kubernetes/minikube.git "${clean_repo}"
cd "${clean_repo}"
git fetch
git checkout master
git pull
git tag -a "${tag}" -m "$version Release"
git push origin "${tag}"

View File

@ -25,7 +25,7 @@
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)
InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}"
InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}"
!define UNINSTALLDIR "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}"
BrandingText " "

View File

@ -379,9 +379,8 @@ func NewKubeletConfig(k8s config.KubernetesConfig, r cruntime.Manager) (string,
// UpdateCluster updates the cluster
func (k *Bootstrapper) UpdateCluster(cfg config.KubernetesConfig) error {
if cfg.ShouldLoadCachedImages {
err := machine.LoadImages(k.c, constants.GetKubeadmCachedImages(cfg.KubernetesVersion), constants.ImageCacheDir)
if err != nil {
return errors.Wrap(err, "loading cached images")
if err := machine.LoadImages(k.c, constants.GetKubeadmCachedImages(cfg.KubernetesVersion), constants.ImageCacheDir); err != nil {
console.Failure("Unable to load cached images: %v", err)
}
}
r, err := cruntime.New(cruntime.Config{Type: cfg.ContainerRuntime, Socket: cfg.CRISocket})

View File

@ -154,7 +154,7 @@ var DefaultISOURL = fmt.Sprintf("https://storage.googleapis.com/%s/minikube-%s.i
var DefaultISOSHAURL = DefaultISOURL + SHASuffix
// DefaultKubernetesVersion is the default kubernetes version
var DefaultKubernetesVersion = "v1.13.3"
var DefaultKubernetesVersion = "v1.13.4"
// ConfigFilePath is the path of the config directory
var ConfigFilePath = MakeMiniPath("config")
@ -202,7 +202,7 @@ const (
// DefaultMsize is the default number of bytes to use for 9p packet payload
DefaultMsize = 262144
// DefaultMountVersion is the default 9p version to use for mount
DefaultMountVersion = "9p2000.u"
DefaultMountVersion = "9p2000.L"
)
// GetKubernetesReleaseURL gets the location of a kubernetes client

View File

@ -80,7 +80,7 @@ func (r *Containerd) Disable() error {
// LoadImage loads an image into this runtime
func (r *Containerd) LoadImage(path string) error {
glog.Infof("Loading image: %s", path)
return r.Runner.Run(fmt.Sprintf("sudo ctr cri load %s", path))
return r.Runner.Run(fmt.Sprintf("sudo ctr images import %s", path))
}
// KubeletOptions returns kubelet options for a containerd

View File

@ -30,7 +30,7 @@ import (
const errMsg = `
The Xhyve driver is not included in minikube yet. Please follow the directions at
https://github.com/kubernetes/minikube/blob/master/DRIVERS.md#xhyve-driver
https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#xhyve-driver
`
func init() {

View File

@ -20,8 +20,10 @@ package exit
import (
"fmt"
"os"
"strings"
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/console"
)
@ -85,6 +87,15 @@ func displayError(msg string, err error) {
glog.Warningf(fmt.Sprintf("%s: %v", msg, err))
console.Fatal(msg+": %v", err)
console.Err("\n")
console.ErrStyle("sad", "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:")
console.ErrStyle("url", "https://github.com/kubernetes/minikube/issues/new")
// unfortunately Cause only supports one level of actual error wrapping
cause := errors.Cause(err)
text := cause.Error()
if strings.Contains(text, "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path") ||
strings.Contains(text, "Driver \"kvm2\" not found. Do you have the plugin binary \"docker-machine-driver-kvm2\" accessible in your PATH?") {
console.ErrStyle("usage", "Make sure to install all necessary requirements, according to the documentation:")
console.ErrStyle("url", "https://kubernetes.io/docs/tasks/tools/install-minikube/")
} else {
console.ErrStyle("sad", "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:")
console.ErrStyle("url", "https://github.com/kubernetes/minikube/issues/new")
}
}

View File

@ -33,7 +33,7 @@ import (
)
// rootCauseRe is a regular expression that matches known failure root causes
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --`)
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted`)
// importantPods are a list of pods to retrieve logs for, in addition to the bootstrapper logs.
var importantPods = []string{

View File

@ -28,10 +28,11 @@ func TestIsProblem(t *testing.T) {
}{
{"almost", false, "F2350 I would love to be an unknown flag, but I am not -- :( --"},
{"apiserver-required-flag #1962", true, "error: [service-account-issuer is a required flag when BoundServiceAccountTokenVolume is enabled, --service-account-signing-key-file and --service-account-issuer are required flags"},
{"kubelet-eviction #", true, "I0213 07:16:44.041623 2410 eviction_manager.go:187] eviction manager: pods kube-apiserver-minikube_kube-system(87f41e2e0629c3deb5c2239e08d8045d) evicted, waiting for pod to be cleaned up"},
{"kubelet-eviction #3611", true, `eviction_manager.go:187] eviction manager: pods kube-proxy-kfs8p_kube-system(27fd6b4b-33cf-11e9-ae1d-00155d4b0144) evicted, waiting for pod to be cleaned up`},
{"kubelet-unknown-flag #3655", true, "F0212 14:55:46.443031 2693 server.go:148] unknown flag: --AllowedUnsafeSysctls"},
{"apiserver-auth-mode #2852", true, `{"log":"Error: unknown flag: --Authorization.Mode\n","stream":"stderr","time":"2018-06-17T22:16:35.134161966Z"}`},
{"apiserver-admission #3524", true, "error: unknown flag: --GenericServerRunOptions.AdmissionControl"},
{"no-providers-available #3818", true, ` kubelet.go:1662] Failed creating a mirror pod for "kube-apiserver-minikube_kube-system(c7d572aebd3d33b17fa78ae6395b6d0a)": pods "kube-apiserver-minikube" is forbidden: no providers available to validate pod request`},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {

View File

@ -103,9 +103,9 @@ func (l *loadBalancerEmulator) updateService(restClient rest.Interface, svc core
request := l.patchConverter.convert(restClient, patch)
result, err := l.requestSender.send(request)
if err != nil {
glog.Infof("Patched %s with IP %s", svc.Name, clusterIP)
} else {
glog.Errorf("error patching %s with IP %s: %s", svc.Name, clusterIP, err)
} else {
glog.Infof("Patched %s with IP %s", svc.Name, clusterIP)
}
return result, err
}

View File

@ -27,8 +27,8 @@ import (
)
func TestFunctional(t *testing.T) {
minikubeRunner := NewMinikubeRunner(t)
minikubeRunner.EnsureRunning()
r := NewMinikubeRunner(t)
r.EnsureRunning()
// This one is not parallel, and ensures the cluster comes up
// before we run any other tests.
t.Run("Status", testClusterStatus)
@ -41,7 +41,7 @@ func TestFunctional(t *testing.T) {
t.Run("Provisioning", testProvisioning)
t.Run("Tunnel", testTunnel)
if !usingNoneDriver(minikubeRunner) {
if !usingNoneDriver(r) {
t.Run("EnvVars", testClusterEnv)
t.Run("SSH", testClusterSSH)
t.Run("IngressController", testIngressController)
@ -50,25 +50,22 @@ func TestFunctional(t *testing.T) {
}
func TestFunctionalContainerd(t *testing.T) {
minikubeRunner := NewMinikubeRunner(t)
r := NewMinikubeRunner(t)
if usingNoneDriver(minikubeRunner) {
if usingNoneDriver(r) {
t.Skip("Can't run containerd backend with none driver")
}
if minikubeRunner.GetStatus() != state.None.String() {
minikubeRunner.RunCommand("delete", true)
if r.GetStatus() != state.None.String() {
r.RunCommand("delete", true)
}
minikubeRunner.SetRuntime("containerd")
minikubeRunner.EnsureRunning()
r.Start("--container-runtime=containerd", "--docker-opt containerd=/var/run/containerd/containerd.sock")
t.Run("Gvisor", testGvisor)
t.Run("GvisorRestart", testGvisorRestart)
minikubeRunner.RunCommand("delete", true)
r.RunCommand("delete", true)
}
// usingNoneDriver returns true if using the none driver
func usingNoneDriver(runner util.MinikubeRunner) bool {
return strings.Contains(runner.StartArgs, "--vm-driver=none")
func usingNoneDriver(r util.MinikubeRunner) bool {
return strings.Contains(r.StartArgs, "--vm-driver=none")
}

View File

@ -30,48 +30,47 @@ import (
func TestStartStop(t *testing.T) {
tests := []struct {
runtime string
name string
args []string
}{
{runtime: "docker"},
{runtime: "containerd"},
{runtime: "crio"},
{"docker+cache", []string{"--container-runtime=docker", "--cache-images"}},
{"containerd+cache", []string{"--container-runtime=containerd", "--docker-opt containerd=/var/run/containerd/containerd.sock", "--cache-images"}},
{"crio+cache", []string{"--container-runtime=crio", "--cache-images"}},
}
for _, test := range tests {
t.Run(test.runtime, func(t *testing.T) {
runner := NewMinikubeRunner(t)
if test.runtime != "docker" && usingNoneDriver(runner) {
t.Skipf("skipping, can't use %s with none driver", test.runtime)
t.Run(test.name, func(t *testing.T) {
r := NewMinikubeRunner(t)
if !strings.Contains(test.name, "docker") && usingNoneDriver(r) {
t.Skipf("skipping %s - incompatible with none driver", test.name)
}
runner.RunCommand("config set WantReportErrorPrompt false", true)
runner.RunCommand("delete", false)
runner.CheckStatus(state.None.String())
r.RunCommand("config set WantReportErrorPrompt false", true)
r.RunCommand("delete", false)
r.CheckStatus(state.None.String())
r.Start(test.args...)
r.CheckStatus(state.Running.String())
runner.SetRuntime(test.runtime)
runner.Start()
runner.CheckStatus(state.Running.String())
ip := runner.RunCommand("ip", true)
ip := r.RunCommand("ip", true)
ip = strings.TrimRight(ip, "\n")
if net.ParseIP(ip) == nil {
t.Fatalf("IP command returned an invalid address: %s", ip)
}
checkStop := func() error {
runner.RunCommand("stop", true)
return runner.CheckStatusNoFail(state.Stopped.String())
r.RunCommand("stop", true)
return r.CheckStatusNoFail(state.Stopped.String())
}
if err := util.Retry(t, checkStop, 5*time.Second, 6); err != nil {
t.Fatalf("timed out while checking stopped status: %v", err)
}
runner.Start()
runner.CheckStatus(state.Running.String())
r.Start(test.args...)
r.CheckStatus(state.Running.String())
runner.RunCommand("delete", true)
runner.CheckStatus(state.None.String())
r.RunCommand("delete", true)
r.CheckStatus(state.None.String())
})
}
}

View File

@ -191,12 +191,6 @@ func (m *MinikubeRunner) RunDaemon2(command string) (*exec.Cmd, *bufio.Reader, *
}
return cmd, bufio.NewReader(stdoutPipe), bufio.NewReader(stderrPipe)
}
// SetRuntime saves the runtime backend
func (m *MinikubeRunner) SetRuntime(runtime string) {
m.Runtime = runtime
}
// SSH returns the output of running a command using SSH
func (m *MinikubeRunner) SSH(command string) (string, error) {
path, _ := filepath.Abs(m.BinaryPath)
@ -212,17 +206,9 @@ func (m *MinikubeRunner) SSH(command string) (string, error) {
}
// Start starts the container runtime
func (m *MinikubeRunner) Start() {
opts := ""
// TODO(tstromberg): Deprecate this in favor of making it possible for tests to define explicit flags.
switch r := m.Runtime; r {
case "containerd":
opts = "--container-runtime=containerd --docker-opt containerd=/var/run/containerd/containerd.sock"
case "crio":
opts = "--container-runtime=cri-o"
}
m.RunCommand(fmt.Sprintf("start %s %s %s --alsologtostderr --v=5", m.StartArgs, m.Args, opts), true)
func (m *MinikubeRunner) Start(opts ...string) {
cmd := fmt.Sprintf("start %s %s %s --alsologtostderr --v=2", m.StartArgs, m.Args, strings.Join(opts, " "))
m.RunCommand(cmd, true)
}
// EnsureRunning makes sure the container runtime is running

View File

@ -273,7 +273,7 @@ func (d *Driver) Create() error {
func (d *Driver) chooseVirtualSwitch() (string, error) {
if d.VSwitch == "" {
// Default to the first external switche and in the process avoid DockerNAT
stdout, err := cmdOut("(Hyper-V\\Get-VMSwitch -SwitchType External).Name")
stdout, err := cmdOut("[Console]::OutputEncoding = [Text.Encoding]::UTF8; (Hyper-V\\Get-VMSwitch -SwitchType External).Name")
if err != nil {
return "", err
}
@ -287,7 +287,7 @@ func (d *Driver) chooseVirtualSwitch() (string, error) {
return switches[0], nil
}
stdout, err := cmdOut("(Hyper-V\\Get-VMSwitch).Name")
stdout, err := cmdOut("[Console]::OutputEncoding = [Text.Encoding]::UTF8; (Hyper-V\\Get-VMSwitch).Name")
if err != nil {
return "", err
}

View File

@ -6,7 +6,7 @@ import "github.com/intel-go/cpuid"
// IsVTXDisabled checks if VT-x is disabled in the CPU.
func (d *Driver) IsVTXDisabled() bool {
if cpuid.HasFeature(cpuid.VMX) || cpuid.HasFeature(cpuid.SVM) {
if cpuid.HasFeature(cpuid.VMX) || cpuid.HasExtraFeature(cpuid.SVM) {
return false
}