Merge branch 'master' of https://github.com/kubernetes/minikube into gvisor-image

pull/4717/head
Priya Wadhwa 2019-08-08 13:10:04 -07:00
commit bd17652481
26 changed files with 292 additions and 318 deletions

View File

@ -1,8 +1,9 @@
# Release Notes
## Version 1.3.0 - 2019-08-XX (TBD)
## Version 1.3.0 - 2019-08-05
* Added a new command: profile list [#4811](https://github.com/kubernetes/minikube/pull/4811)
* Update latest kubernetes version to v1.15.2 [#4986](https://github.com/kubernetes/minikube/pull/4986)
* Update latest kubernetes version to v1.15.1 [#4915](https://github.com/kubernetes/minikube/pull/4915)
* logs: Add container status & cruntime logs [#4960](https://github.com/kubernetes/minikube/pull/4960)
* Automatically set flags for MINIKUBE_ prefixed env vars [#4607](https://github.com/kubernetes/minikube/pull/4607)

View File

@ -23,9 +23,7 @@ minikube's [primary goals](https://github.com/kubernetes/minikube/blob/master/do
:mega: **Please fill out our [fast 5-question survey](https://forms.gle/Gg3hG5ZySw8c1C24A)** so that we can learn how & why you use minikube, and what improvements we should make. Thank you! :dancers:
* 2019-06-24 - v1.2.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.2.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-120---2019-06-24)]
* 2019-06-07 - v1.1.1 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.1.1)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-111---2019-06-07)]
* 2019-05-21 - v1.1.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.1.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-110---2019-05-21)]
* 2019-08-05 - v1.3.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.3.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-130---2019-08-05)]
## Features

View File

@ -129,7 +129,7 @@ var dashboardCmd = &cobra.Command{
if dashboardURLMode {
out.Ln(url)
} else {
out.ErrT(out.Celebrate, "Opening %s in your default browser...", out.V{"url": url})
out.ErrT(out.Celebrate, "Opening {{.url}} in your default browser...", out.V{"url": url})
if err = browser.OpenURL(url); err != nil {
exit.WithCodeT(exit.Software, "failed to open browser: {{.error}}", out.V{"error": err})
}

View File

@ -1,4 +1,12 @@
[
{
"name": "v1.3.0",
"checksums": {
"darwin": "5bda29e2d990bb8ac9da1767143e228772adc45507d22a49b5af70b03e7db682",
"linux": "5aa7c5f0b6dd09348f7e2435b9618f6a916fbb573580619b393b514258771eab",
"windows": "d808b6e42e6f53c9338d135a352bebd4469634f33646d06e7cad3569330225cb"
}
},
{
"name": "v1.2.0",
"checksums": {

View File

@ -11,15 +11,16 @@ minikube defaults to the latest stable version of Kubernetes. You may select a d
`minikube start --kubernetes-version=v1.10.13`
minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube extends this policy two additional minor releases so that users can emulate legacy environments.
minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube extends this policy three additional minor releases so that users can emulate legacy environments.
As of April 2019, this means that minikube supports and actively tests against the latest builds of:
As of August 2019, this means that minikube supports and actively tests against the latest builds of:
* v1.14 (default)
* v1.13
* v1.12
* v1.11 (best effort)
* v1.10 (best effort)
* v1.15.x (default)
* v1.14.x
* v1.13.x
* v1.12.x
* v1.11.x (best effort)
* v1.10.x (best effort)
For more up to date information, see `OldestKubernetesVersion` and `NewestKubernetesVersion` in [constants.go](https://github.com/kubernetes/minikube/blob/master/pkg/minikube/constants/constants.go)

7
go.mod
View File

@ -9,6 +9,7 @@ require (
github.com/blang/semver v3.5.0+incompatible
github.com/c4milo/gotoolkit v0.0.0-20170318115440-bcc06269efa9 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/cheggaaa/pb v1.0.27
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 // indirect
github.com/docker/go-units v0.3.3
@ -33,8 +34,8 @@ require (
github.com/johanneswuerbach/nfsexports v0.0.0-20181204082207-1aa528dcb345
github.com/libvirt/libvirt-go v3.4.0+incompatible
github.com/machine-drivers/docker-machine-driver-vmware v0.1.1
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.5
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/mattn/go-isatty v0.0.8
github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936
github.com/moby/hyperkit v0.0.0-20171020124204-a12cd7250bcd
github.com/olekukonko/tablewriter v0.0.0-20160923125401-bdcc175572fd
@ -58,7 +59,7 @@ require (
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb
golang.org/x/text v0.3.2
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect

14
go.sum
View File

@ -62,6 +62,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEe
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw=
github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc=
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/client9/misspell v0.0.0-20170928000206-9ce5d979ffda/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
@ -204,6 +205,7 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@ -305,11 +307,11 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-shellwords v0.0.0-20180605041737-f8471b0a71de/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
@ -553,8 +555,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=

View File

@ -27,7 +27,7 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="kvm2"
JOB_NAME="Linux-KVM"
JOB_NAME="KVM_Linux"
PARALLEL_COUNT=4
# Download files and set permissions

View File

@ -15,7 +15,7 @@
# limitations under the License.
# This script runs the integration tests on a Linux machine for the Virtualbox Driver
# This script runs the integration tests on a Linux machine for the none Driver
# The script expects the following env variables:
# MINIKUBE_LOCATION: GIT_COMMIT from upstream build.
@ -28,7 +28,7 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="none"
JOB_NAME="Linux-None"
JOB_NAME="none_Linux"
EXTRA_ARGS="--bootstrapper=kubeadm"
PARALLEL_COUNT=1

View File

@ -15,7 +15,7 @@
# limitations under the License.
# This script runs the integration tests on a Linux machine for the Virtualbox Driver
# This script runs the integration tests on a Linux machine for the VirtualBox Driver
# The script expects the following env variables:
# MINIKUBE_LOCATION: GIT_COMMIT from upstream build.
@ -27,7 +27,7 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="virtualbox"
JOB_NAME="Linux-VirtualBox"
JOB_NAME="VirtualBox_Linux"
PARALLEL_COUNT=4
# Download files and set permissions

View File

@ -24,19 +24,29 @@
# ghprbActualCommit: The commit hash, injected from the ghpbr plugin.
# access_token: The Github API access token. Injected by the Jenkins credential provider.
set -e
set +x
set -eux -o pipefail
if [ "${ghprbPullId}" == "master" ]; then
echo "not setting github status for continuous builds"
exit 0
fi
for job in "OSX-Virtualbox" "OSX-Hyperkit" "Linux-Virtualbox" "Linux-KVM" "Linux-None"; do
target_url="https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${job}.txt"
jobs=(
'HyperKit_macOS'
'Hyper-V_Windows'
'VirtualBox_Linux'
'VirtualBox_macOS'
'VirtualBox_Windows'
# 'KVM-GPU_Linux' - Disabled
'KVM_Linux'
'none_Linux'
)
for j in ${jobs[@]}; do
target_url="https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${j}.txt"
curl "https://api.github.com/repos/kubernetes/minikube/statuses/${ghprbActualCommit}?access_token=$access_token" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"pending\", \"description\": \"Jenkins\", \"target_url\": \"${target_url}\", \"context\": \"${job}\"}"
-d "{\"state\": \"pending\", \"description\": \"Jenkins\", \"target_url\": \"${target_url}\", \"context\": \"${j}\"}"
done

View File

@ -1,221 +0,0 @@
#!/bin/bash
# Copyright 2017 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.
# This script runs the integration tests on a Linux machine for the KVM Driver
# The script expects the following env variables:
# MINIKUBE_LOCATION: GIT_COMMIT from upstream build.
# COMMIT: Actual commit ID from upstream build
# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests
# access_token: The Github API access token. Injected by the Jenkins credential provider.
set -e
OS_ARCH="linux-amd64"
VM_DRIVER="kvm"
JOB_NAME="Minishift-Linux-KVM"
BINARY=$(pwd)/out/minishift
EXTRA_FLAGS="--show-libmachine-logs"
# Download files and set permissions
mkdir -p out/
curl -L http://artifacts.ci.centos.org/minishift/minishift/master/latest/linux-amd64/minishift -o out/minishift
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/ || true
gsutil -m cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-testing.iso out/ || true
# Set the executable bit on the minishift and driver binary
chmod +x out/minishift
chmod +x out/docker-machine-driver-* || true
# Get version information
./out/minishift version
# Remove pre-exist kube config files
rm -fr $HOME/.kube || true
ISO=https://storage.googleapis.com/minikube/iso/minikube-v0.24.0.iso
if [ -f $(pwd)/out/minikube-testing.iso ]; then
ISO=file://$(pwd)/out/minikube-testing.iso
fi
export MINIKUBE_WANTREPORTERRORPROMPT=False
./out/minishift delete --force || true
# Add the out/ directory to the PATH, for using new drivers.
export PATH="$(pwd)/out/":$PATH
# Linux cleanup
virsh -c qemu:///system list --all \
| sed -n '3,$ p' \
| cut -d' ' -f 7 \
| xargs -I {} sh -c "virsh -c qemu:///system destroy {}; virsh -c qemu:///system undefine {}" \
|| true
sudo virsh net-define /usr/share/libvirt/networks/default.xml || true
sudo virsh net-start default || true
sudo virsh net-list
# see what driver we are using
which docker-machine-driver-${VM_DRIVER} || true
result=$?
echo $result
function print_success_message() {
echo ""
echo " ------------ [ $1 - Passed ]"
echo ""
}
function exit_with_message() {
if [[ "$1" != 0 ]]; then
echo "$2"
result=1
fi
}
function assert_equal() {
if [ "$1" != "$2" ]; then
echo "Expected '$1' equal to '$2'"
result=1
fi
}
# http://www.linuxjournal.com/content/validating-ip-address-bash-script
function assert_valid_ip() {
local ip=$1
local valid=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
valid=$?
fi
if [[ "$valid" != 0 ]]; then
echo "IP '$1' is invalid"
result=1
fi
}
function verify_start_instance() {
$BINARY start --iso-url $ISO $EXTRA_FLAGS
exit_with_message "$?" "Error starting Minishift VM"
output=`$BINARY status | sed -n 1p`
assert_equal "$output" "Minishift: Running"
print_success_message "Starting VM"
}
function verify_stop_instance() {
$BINARY stop
exit_with_message "$?" "Error starting Minishift VM"
output=`$BINARY status | sed -n 1p`
assert_equal "$output" "Minishift: Stopped"
print_success_message "Stopping VM"
}
function verify_swap_space() {
output=`$BINARY ssh -- free | tail -n 1 | awk '{print $2}'`
if [ "$output" == "0" ]; then
echo "Expected '$output' not equal to 0"
result=1
fi
print_success_message "Swap space check"
}
function verify_ssh_connection() {
output=`$BINARY ssh -- echo hello`
assert_equal $output "hello"
print_success_message "SSH Connection"
}
function verify_vm_ip() {
output=`$BINARY ip`
assert_valid_ip $output
print_success_message "Getting VM IP"
}
function verify_cifs_installation() {
expected="mount.cifs version: 6.6"
output=`$BINARY ssh -- sudo /sbin/mount.cifs -V`
assert_equal "$output" "$expected"
print_success_message "CIFS installation"
}
function verify_nfs_installation() {
expected="mount.nfs: (linux nfs-utils 1.3.3)"
output=`$BINARY ssh -- sudo /sbin/mount.nfs -V /need/for/version`
assert_equal "$output" "$expected"
print_success_message "NFS installation"
}
function verify_bind_mount() {
output=`$BINARY ssh -- 'findmnt | grep "\[/var/lib/" | wc -l'`
assert_equal $output "11"
print_success_message "Bind mount check"
}
function verify_delete() {
$BINARY delete --force
exit_with_message "$?" "Error deleting Minishift VM"
output=`$BINARY status`
if [ "$1" != "$2" ]; then
echo "Expected '$1' equal to '$2'"
result=1
fi
print_success_message "Deleting VM"
}
function verify_sshfs_installation() {
expected="SSHFS version 2.5"
output=`$BINARY ssh -- sudo sshfs -V`
assert_equal "$output" "$expected"
print_success_message "SSHFS installation"
}
# Tests
set +e
verify_start_instance
verify_vm_ip
verify_cifs_installation
verify_nfs_installation
verify_sshfs_installation
verify_bind_mount
verify_swap_space
verify_delete
set -e
if [[ $result -eq 0 ]]; then
status="success"
else
status="failure"
fi
set +x
target_url="https://storage.googleapis.com/minikube-builds/logs/${MINIKUBE_LOCATION}/${JOB_NAME}.txt"
curl "https://api.github.com/repos/kubernetes/minikube/statuses/${COMMIT}?access_token=$access_token" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"$status\", \"description\": \"Jenkins\", \"target_url\": \"$target_url\", \"context\": \"${JOB_NAME}\"}"
set -x
exit $result

View File

@ -28,7 +28,7 @@ set -e
OS_ARCH="darwin-amd64"
VM_DRIVER="hyperkit"
JOB_NAME="OSX-Hyperkit"
JOB_NAME="HyperKit_macOS"
EXTRA_ARGS="--bootstrapper=kubeadm"
EXTRA_START_ARGS=""
PARALLEL_COUNT=3

View File

@ -15,7 +15,7 @@
# limitations under the License.
# This script runs the integration tests on an OSX machine for the Virtualbox Driver
# This script runs the integration tests on an macOS machine for the VirtualBox Driver
# The script expects the following env variables:
# MINIKUBE_LOCATION: GIT_COMMIT from upstream build.
@ -27,7 +27,7 @@
set -e
OS_ARCH="darwin-amd64"
VM_DRIVER="virtualbox"
JOB_NAME="OSX-Virtualbox"
JOB_NAME="VirtualBox_macOS"
EXTRA_ARGS="--bootstrapper=kubeadm"
PARALLEL_COUNT=3

View File

@ -25,8 +25,8 @@ $env:result=$lastexitcode
If($env:result -eq 0){$env:status="success"}
Else {$env:status="failure"}
$env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/Windows-hyperv.txt"
$json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"Windows-hyperv`"}"
$env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/Hyper-V_Windows.txt"
$json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"Hyper-V_Windows`"}"
Invoke-WebRequest -Uri "https://api.github.com/repos/kubernetes/minikube/statuses/$env:COMMIT`?access_token=$env:access_token" -Body $json -ContentType "application/json" -Method Post -usebasicparsing
Exit $env:result

View File

@ -25,8 +25,8 @@ $env:result=$lastexitcode
If($env:result -eq 0){$env:status="success"}
Else {$env:status="failure"}
$env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/Windows-virtualbox.txt"
$json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"Windows-virtualbox`"}"
$env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/VirtualBox_Windows.txt"
$json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"VirtualBox_Windows`"}"
Invoke-WebRequest -Uri "https://api.github.com/repos/kubernetes/minikube/statuses/$env:COMMIT`?access_token=$env:access_token" -Body $json -ContentType "application/json" -Method Post -usebasicparsing
Exit $env:result

View File

@ -1,34 +0,0 @@
# Copyright 2016 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.
mkdir -p out
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
gsutil.cmd -m cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .
./out/minikube-windows-amd64.exe delete
out/e2e-windows-amd64.exe --% -minikube-start-args="--vm-driver=virtualbox --container-runtime=cri-o" -minikube-args="--v=10 --logtostderr --bootstrapper=kubeadm" -test.v -test.timeout=30m -binary=out/minikube-windows-amd64.exe
$env:result=$lastexitcode
# If the last exit code was 0->success, x>0->error
If($env:result -eq 0){$env:status="success"}
Else {$env:status="failure"}
$env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/Windows-Kubeadm-CRI-O.txt"
$json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"Windows-Kubeadm-CRI-O`"}"
Invoke-WebRequest -Uri "https://api.github.com/repos/kubernetes/minikube/statuses/$env:COMMIT`?access_token=$env:access_token" -Body $json -ContentType "application/json" -Method Post -usebasicparsing
Exit $env:result

View File

@ -176,10 +176,10 @@ 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.15.1"
var DefaultKubernetesVersion = "v1.15.2"
// NewestKubernetesVersion is the newest Kubernetes version to test against
var NewestKubernetesVersion = "v1.15.1"
var NewestKubernetesVersion = "v1.15.2"
// OldestKubernetesVersion is the oldest Kubernetes version to test against
var OldestKubernetesVersion = "v1.10.13"

View File

@ -17,13 +17,12 @@ limitations under the License.
package util
import (
"crypto"
"net/url"
"os"
"path/filepath"
"github.com/golang/glog"
download "github.com/jimmidyson/go-download"
"github.com/hashicorp/go-getter"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/out"
@ -55,33 +54,35 @@ func (f DefaultDownloader) GetISOFileURI(isoURL string) string {
}
// CacheMinikubeISOFromURL downloads the ISO, if it doesn't exist in cache
func (f DefaultDownloader) CacheMinikubeISOFromURL(isoURL string) error {
if !f.ShouldCacheMinikubeISO(isoURL) {
glog.Infof("Not caching ISO, using %s", isoURL)
func (f DefaultDownloader) CacheMinikubeISOFromURL(url string) error {
if !f.ShouldCacheMinikubeISO(url) {
glog.Infof("Not caching ISO, using %s", url)
return nil
}
options := download.FileOptions{
Mkdirs: download.MkdirAll,
Options: download.Options{
ProgressBars: &download.ProgressBarOptions{
MaxWidth: 80,
},
},
urlWithChecksum := url
if url == constants.DefaultISOURL {
urlWithChecksum = url + "?checksum=file:" + constants.DefaultISOSHAURL
}
// Validate the ISO if it was the default URL, before writing it to disk.
if isoURL == constants.DefaultISOURL {
options.Checksum = constants.DefaultISOSHAURL
options.ChecksumHash = crypto.SHA256
dst := f.GetISOCacheFilepath(url)
// Predictable temp destination so that resume can function
tmpDst := dst + ".download"
opts := []getter.ClientOption{getter.WithProgress(defaultProgressBar)}
client := &getter.Client{
Src: urlWithChecksum,
Dst: tmpDst,
Mode: getter.ClientModeFile,
Options: opts,
}
out.T(out.ISODownload, "Downloading Minikube ISO ...")
if err := download.ToFile(isoURL, f.GetISOCacheFilepath(isoURL), options); err != nil {
return errors.Wrap(err, isoURL)
glog.Infof("full url: %s", urlWithChecksum)
out.T(out.ISODownload, "Downloading VM boot image ...")
if err := client.Get(); err != nil {
return errors.Wrap(err, url)
}
return nil
return os.Rename(tmpDst, dst)
}
// ShouldCacheMinikubeISO returns if we need to download the ISO

View File

@ -394,6 +394,107 @@ func TestDeleteKubeConfigContext(t *testing.T) {
}
}
func TestSetCurrentContext(t *testing.T) {
contextName := "minikube"
kubeConfigFile, err := ioutil.TempFile("/tmp", "kubeconfig")
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
defer os.Remove(kubeConfigFile.Name())
cfg, err := ReadConfigOrNew(kubeConfigFile.Name())
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
if cfg.CurrentContext != "" {
t.Errorf("Expected empty context but got %v", cfg.CurrentContext)
}
err = SetCurrentContext(kubeConfigFile.Name(), contextName)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
defer func() {
err := UnsetCurrentContext(kubeConfigFile.Name(), contextName)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
}()
cfg, err = ReadConfigOrNew(kubeConfigFile.Name())
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
if cfg.CurrentContext != contextName {
t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext)
}
}
func TestUnsetCurrentContext(t *testing.T) {
kubeConfigFile := "./testdata/kubeconfig/config1"
contextName := "minikube"
cfg, err := ReadConfigOrNew(kubeConfigFile)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
if cfg.CurrentContext != contextName {
t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext)
}
err = UnsetCurrentContext(kubeConfigFile, contextName)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
defer func() {
err := SetCurrentContext(kubeConfigFile, contextName)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
}()
cfg, err = ReadConfigOrNew(kubeConfigFile)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
if cfg.CurrentContext != "" {
t.Errorf("Expected empty context but got %v", cfg.CurrentContext)
}
}
func TestUnsetCurrentContextOnlyChangesIfProfileIsTheCurrentContext(t *testing.T) {
contextName := "minikube"
kubeConfigFile := "./testdata/kubeconfig/config2"
cfg, err := ReadConfigOrNew(kubeConfigFile)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
if cfg.CurrentContext != contextName {
t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext)
}
err = UnsetCurrentContext(kubeConfigFile, "differentContextName")
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
cfg, err = ReadConfigOrNew(kubeConfigFile)
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
if cfg.CurrentContext != contextName {
t.Errorf("Expected context name %s but got %s", contextName, cfg.CurrentContext)
}
}
// tempFile creates a temporary with the provided bytes as its contents.
// The caller is responsible for deleting file after use.
func tempFile(t *testing.T, data []byte) string {

90
pkg/util/progressbar.go Normal file
View File

@ -0,0 +1,90 @@
/*
Copyright 2019 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.
*/
// This file implements a go-getter wrapper for cheggaaa progress bar
// based on:
// https://github.com/hashicorp/go-getter/blob/master/cmd/go-getter/progress_tracking.go
package util
import (
"fmt"
"io"
"path/filepath"
"sync"
"github.com/cheggaaa/pb"
"github.com/golang/glog"
"github.com/hashicorp/go-getter"
)
var defaultProgressBar getter.ProgressTracker = &progressBar{}
type progressBar struct {
lock sync.Mutex
pool *pb.Pool
pbs int
}
// TrackProgress instantiates a new progress bar that will
// display the progress of stream until closed.
// total can be 0.
func (cpb *progressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
cpb.lock.Lock()
defer cpb.lock.Unlock()
if cpb.pool == nil {
cpb.pool = pb.NewPool()
if err := cpb.pool.Start(); err != nil {
glog.Errorf("pool start: %v", err)
}
}
p := pb.New64(totalSize)
p.Set64(currentSize)
p.SetUnits(pb.U_BYTES)
p.Prefix(fmt.Sprintf(" %s:", filepath.Base(src)))
// Just a hair less than 80 (standard terminal width) for aesthetics & pasting into docs
p.SetWidth(78)
cpb.pool.Add(p)
reader := p.NewProxyReader(stream)
cpb.pbs++
return &readCloser{
Reader: reader,
close: func() error {
cpb.lock.Lock()
defer cpb.lock.Unlock()
p.Finish()
cpb.pbs--
if cpb.pbs <= 0 {
if err := cpb.pool.Stop(); err != nil {
glog.Errorf("pool stop: %v", err)
}
cpb.pool = nil
}
return nil
},
}
}
type readCloser struct {
io.Reader
close func() error
}
func (c *readCloser) Close() error { return c.close() }

7
pkg/util/testdata/kubeconfig/config1 vendored Normal file
View File

@ -0,0 +1,7 @@
apiVersion: v1
clusters: []
contexts: []
current-context: minikube
kind: Config
preferences: {}
users: []

7
pkg/util/testdata/kubeconfig/config2 vendored Normal file
View File

@ -0,0 +1,7 @@
apiVersion: v1
clusters: []
contexts: []
current-context: "minikube"
kind: Config
preferences: {}
users: []

View File

@ -62,7 +62,7 @@ weight = 1
[params]
copyright = "The Kubernetes Authors -- "
# The latest release of minikube
latest_release = "1.2.0"
latest_release = "1.3.0"
privacy_policy = ""

View File

@ -1,2 +1,3 @@
<!-- start: minikube override body-end partial -->
<script language="javascript">initTabs();</script>
<!-- end: minikube override body-end partial -->

View File

@ -1,3 +1,4 @@
<!-- tabs implementation, borrowed from skaffold -->
<!-- start: minikube override head-end partial -->
<link href="/css/tabs.css" rel="stylesheet">
<script src="/js/tabs.js"></script>
<!-- end: minikube override head-end partial -->