Merge branch 'master' into downgrade_warning

pull/5155/head
phillipahereza 2019-08-22 07:21:41 +03:00
commit fd8e93cbe8
28 changed files with 564 additions and 43 deletions

View File

@ -18,3 +18,6 @@ script:
- make test
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
webhooks: https://www.travisbuddy.com/
on_success: never # travisbuddy don't comment on successfull

View File

@ -131,7 +131,12 @@ out/minikube$(IS_EXE): out/minikube-$(GOOS)-$(GOARCH)$(IS_EXE)
cp $< $@
out/minikube-windows-amd64.exe: out/minikube-windows-amd64
cp out/minikube-windows-amd64 out/minikube-windows-amd64.exe
cp $< $@
.PHONY: minikube-linux-amd64 minikube-darwin-amd64 minikube-windows-amd64.exe
minikube-linux-amd64: out/minikube-linux-amd64
minikube-darwin-amd64: out/minikube-darwin-amd64
minikube-windows-amd64.exe: out/minikube-windows-amd64.exe
out/minikube-%: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go $(shell find $(CMD_SOURCE_DIRS) -type f -name "*.go")
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
@ -140,12 +145,16 @@ else
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-%-$(GOARCH)
e2e-%-$(GOARCH): out/minikube-%-$(GOARCH)
GOOS=$* GOARCH=$(GOARCH) go test -c k8s.io/minikube/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" -o out/$@
.PHONY: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe
e2e-linux-amd64: out/e2e-linux-amd64
e2e-darwin-amd64: out/e2e-darwin-amd64
e2e-windows-amd64.exe: out/e2e-windows-amd64.exe
e2e-windows-amd64.exe: e2e-windows-amd64
cp $(BUILD_DIR)/e2e-windows-amd64 $(BUILD_DIR)/e2e-windows-amd64.exe
out/e2e-%: out/minikube-%
GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go test -c k8s.io/minikube/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" -o $@
out/e2e-windows-amd64.exe: out/e2e-windows-amd64
cp $< $@
minikube_iso: # old target kept for making tests happy
echo $(ISO_VERSION) > deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
@ -195,7 +204,13 @@ test-pkg/%: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
all: cross drivers e2e-cross out/gvisor-addon
.PHONY: drivers
drivers: out/docker-machine-driver-hyperkit out/docker-machine-driver-kvm2
drivers: docker-machine-driver-hyperkit docker-machine-driver-kvm2
.PHONY: docker-machine-driver-hyperkit
docker-machine-driver-hyperkit: out/docker-machine-driver-hyperkit
.PHONY: docker-machine-driver-kvm2
docker-machine-driver-kvm2: out/docker-machine-driver-kvm2
.PHONY: integration
integration: out/minikube
@ -223,7 +238,7 @@ ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/...
-gofmt -s -w $@
endif
@ -232,30 +247,30 @@ ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o $@ -pkg translate translations/...
-gofmt -s -w $@
endif
@#golint: Json should be JSON (compat sed)
@sed -i -e 's/Json/JSON/' $@ && rm -f ./-e
.PHONY: cross
cross: out/minikube-linux-$(GOARCH) out/minikube-darwin-amd64 out/minikube-windows-amd64.exe
cross: minikube-linux-amd64 minikube-darwin-amd64 minikube-windows-amd64.exe
.PHONY: windows
windows: out/minikube-windows-amd64.exe
windows: minikube-windows-amd64.exe
.PHONY: darwin
darwin: out/minikube-darwin-amd64
darwin: minikube-darwin-amd64
.PHONY: linux
linux: out/minikube-linux-$(GOARCH)
linux: minikube-linux-amd64
.PHONY: e2e-cross
e2e-cross: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe
.PHONY: checksum
checksum:
for f in out/minikube-linux-$(GOARCH) out/minikube-darwin-amd64 out/minikube-windows-amd64.exe out/minikube.iso \
for f in out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe out/minikube.iso \
out/docker-machine-driver-kvm2 out/docker-machine-driver-hyperkit; do \
if [ -f "$${f}" ]; then \
openssl sha256 "$${f}" | awk '{print $$2}' > "$${f}.sha256" ; \
@ -383,7 +398,7 @@ ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
else
GOOS=darwin CGO_ENABLED=1 go build \
-ldflags="$(HYPERKIT_LDFLAGS)" \
-o $(BUILD_DIR)/docker-machine-driver-hyperkit k8s.io/minikube/cmd/drivers/hyperkit
-o $@ k8s.io/minikube/cmd/drivers/hyperkit
endif
hyperkit_in_docker:
@ -392,6 +407,7 @@ hyperkit_in_docker:
.PHONY: install-hyperkit-driver
install-hyperkit-driver: out/docker-machine-driver-hyperkit
mkdir -p $(HOME)/bin
sudo cp out/docker-machine-driver-hyperkit $(HOME)/bin/docker-machine-driver-hyperkit
sudo chown root:wheel $(HOME)/bin/docker-machine-driver-hyperkit
sudo chmod u+s $(HOME)/bin/docker-machine-driver-hyperkit
@ -412,7 +428,7 @@ $(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile
@echo "$(@) successfully built"
out/storage-provisioner:
GOOS=linux go build -o $(BUILD_DIR)/storage-provisioner -ldflags=$(PROVISIONER_LDFLAGS) cmd/storage-provisioner/main.go
GOOS=linux go build -o $@ -ldflags=$(PROVISIONER_LDFLAGS) cmd/storage-provisioner/main.go
.PHONY: storage-provisioner-image
storage-provisioner-image: out/storage-provisioner
@ -463,7 +479,7 @@ else
-installsuffix "static" \
-ldflags="$(KVM2_LDFLAGS)" \
-tags "libvirt.1.3.1 without_lxc" \
-o $(BUILD_DIR)/docker-machine-driver-kvm2 \
-o $@ \
k8s.io/minikube/cmd/drivers/kvm
endif
chmod +X $@
@ -498,6 +514,7 @@ kvm_in_docker:
.PHONY: install-kvm-driver
install-kvm-driver: out/docker-machine-driver-kvm2
mkdir -p $(GOBIN)
cp out/docker-machine-driver-kvm2 $(GOBIN)/docker-machine-driver-kvm2
.PHONY: release-kvm-driver

View File

@ -67,7 +67,7 @@ var deleteCacheCmd = &cobra.Command{
}
func imagesInConfigFile() ([]string, error) {
configFile, err := config.ReadConfig()
configFile, err := config.ReadConfig(constants.ConfigFile)
if err != nil {
return nil, err
}

View File

@ -290,7 +290,7 @@ func configurableFields() string {
// ListConfigMap list entries from config file
func ListConfigMap(name string) ([]string, error) {
configFile, err := config.ReadConfig()
configFile, err := config.ReadConfig(constants.ConfigFile)
if err != nil {
return nil, err
}
@ -310,7 +310,7 @@ func AddToConfigMap(name string, images []string) error {
return err
}
// Set the values
cfg, err := config.ReadConfig()
cfg, err := config.ReadConfig(constants.ConfigFile)
if err != nil {
return err
}
@ -337,7 +337,7 @@ func DeleteFromConfigMap(name string, images []string) error {
return err
}
// Set the values
cfg, err := config.ReadConfig()
cfg, err := config.ReadConfig(constants.ConfigFile)
if err != nil {
return err
}

View File

@ -56,7 +56,7 @@ func Set(name string, value string) error {
}
// Set the value
config, err := pkgConfig.ReadConfig()
config, err := pkgConfig.ReadConfig(constants.ConfigFile)
if err != nil {
return err
}

View File

@ -44,7 +44,7 @@ func init() {
// Unset unsets a property
func Unset(name string) error {
m, err := pkgConfig.ReadConfig()
m, err := pkgConfig.ReadConfig(constants.ConfigFile)
if err != nil {
return err
}

View File

@ -55,7 +55,7 @@ For the list of accessible variables for the template, see the struct values her
// View displays the current config
func View() error {
cfg, err := config.ReadConfig()
cfg, err := config.ReadConfig(constants.ConfigFile)
if err != nil {
return err
}

View File

@ -0,0 +1,56 @@
/*
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.
*/
package cmd
import (
"os"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/out"
)
var path string
// generateDocs represents the generate-docs command
var generateDocs = &cobra.Command{
Use: "generate-docs",
Short: "Populates the specified folder with documentation in markdown about minikube",
Long: "Populates the specified folder with documentation in markdown about minikube",
Example: "minikube generate-docs --path <FOLDER_PATH>",
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
// if directory does not exist
docsPath, err := os.Stat(path)
if err != nil || !docsPath.IsDir() {
exit.UsageT("Unable to generate the documentation. Please ensure that the path specified is a directory, exists & you have permission to write to it.")
}
// generate docs
if err := doc.GenMarkdownTree(RootCmd, path); err != nil {
exit.WithError("Unable to generate docs", err)
}
out.T(out.Documentation, "Docs have been saved at - {{.path}}", out.V{"path": path})
},
}
func init() {
generateDocs.Flags().StringVar(&path, "path", "", "The path on the file system where the docs in markdown need to be saved")
RootCmd.AddCommand(generateDocs)
}

View File

@ -46,7 +46,7 @@ var (
ReasonableStartTime = time.Minute * 5
)
// Client gets the kuberentes client from default kubeconfig
// Client gets the kubernetes client from default kubeconfig
func Client(kubectlContext ...string) (kubernetes.Interface, error) {
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
configOverrides := &clientcmd.ConfigOverrides{}

View File

@ -190,7 +190,7 @@ func getExtraOptsPodCidr() []config.ExtraOption {
func recentReleases() ([]string, error) {
// test the 6 most recent releases
versions := []string{"v1.15", "v1.14", "v1.13", "v1.12", "v1.11", "v1.10"}
versions := []string{"v1.16", "v1.15", "v1.14", "v1.13", "v1.12", "v1.11", "v1.10"}
foundNewest := false
foundDefault := false

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 12345
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /run/containerd/containerd.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /run/containerd/containerd.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /run/containerd/containerd.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,53 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/crio/crio.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
fail-no-swap: "true"
feature-gates: "a=b"
controllerManager:
extraArgs:
feature-gates: "a=b"
kube-api-burst: "32"
scheduler:
extraArgs:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/crio/crio.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,44 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
imageRepository: test/repo
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,50 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
fail-no-swap: "true"
controllerManager:
extraArgs:
kube-api-burst: "32"
scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs/
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /data/minikube
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -160,7 +160,7 @@ func configureHost(h *host.Host, e *engine.Options) error {
if err != nil {
return errors.Wrap(err, "detecting provisioner")
}
glog.Infof("Provisioning: %+v", *h.HostOptions)
glog.Infof("Provisioning with %s: %+v", provisioner.String(), *h.HostOptions)
if err := provisioner.Provision(*h.HostOptions.SwarmOptions, *h.HostOptions.AuthOptions, *h.HostOptions.EngineOptions); err != nil {
return errors.Wrap(err, "provision")
}

View File

@ -59,7 +59,7 @@ type MinikubeConfig map[string]interface{}
// Get gets a named value from config
func Get(name string) (string, error) {
m, err := ReadConfig()
m, err := ReadConfig(constants.ConfigFile)
if err != nil {
return "", err
}
@ -88,11 +88,7 @@ func WriteConfig(configFile string, m MinikubeConfig) error {
}
// ReadConfig reads in the JSON minikube config
func ReadConfig() (MinikubeConfig, error) {
return readConfig(constants.ConfigFile)
}
func readConfig(configFile string) (MinikubeConfig, error) {
func ReadConfig(configFile string) (MinikubeConfig, error) {
f, err := os.Open(configFile)
if err != nil {
if os.IsNotExist(err) {

View File

@ -104,9 +104,9 @@ func Test_get(t *testing.T) {
}
}
func Test_readConfig(t *testing.T) {
func TestReadConfig(t *testing.T) {
// non existing file
mkConfig, err := readConfig("non_existing_file")
mkConfig, err := ReadConfig("non_existing_file")
if err != nil {
t.Fatalf("Error not exepected but got %v", err)
}
@ -116,7 +116,7 @@ func Test_readConfig(t *testing.T) {
}
// invalid config file
mkConfig, err = readConfig("./testdata/.minikube/config/invalid_config.json")
mkConfig, err = ReadConfig("./testdata/.minikube/config/invalid_config.json")
if err == nil {
t.Fatalf("Error expected but got none")
}
@ -126,7 +126,7 @@ func Test_readConfig(t *testing.T) {
}
// valid config file
mkConfig, err = readConfig("./testdata/.minikube/config/valid_config.json")
mkConfig, err = ReadConfig("./testdata/.minikube/config/valid_config.json")
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}
@ -164,7 +164,7 @@ func TestWriteConfig(t *testing.T) {
}
defer os.Remove(configFile.Name())
mkConfig, err := readConfig(configFile.Name())
mkConfig, err := ReadConfig(configFile.Name())
if err != nil {
t.Fatalf("Error not expected but got %v", err)
}

View File

@ -181,7 +181,7 @@ var DefaultISOSHAURL = DefaultISOURL + SHASuffix
var DefaultKubernetesVersion = "v1.15.2"
// NewestKubernetesVersion is the newest Kubernetes version to test against
var NewestKubernetesVersion = "v1.15.2"
var NewestKubernetesVersion = "v1.16.0-beta.1"
// OldestKubernetesVersion is the oldest Kubernetes version to test against
var OldestKubernetesVersion = "v1.10.13"

View File

@ -156,7 +156,7 @@ func applyStyle(style StyleEnum, useColor bool, format string) string {
func applyTemplateFormatting(style StyleEnum, useColor bool, format string, a ...V) string {
if a == nil {
a = []V{V{}}
a = []V{{}}
}
format = applyStyle(style, useColor, format)

View File

@ -69,6 +69,11 @@ func (p *BuildrootProvisioner) String() string {
return "buildroot"
}
// CompatibleWithHost checks if provisioner is compatible with host
func (p *BuildrootProvisioner) CompatibleWithHost() bool {
return p.OsReleaseInfo.ID == "buildroot"
}
// escapeSystemdDirectives escapes special characters in the input variables used to create the
// systemd unit file, which would otherwise be interpreted as systemd directives. An example
// are template specifiers (e.g. '%i') which are predefined variables that get evaluated dynamically

View File

@ -45,5 +45,5 @@ Then minikube is for you.
## Where should I go next?
* [Getting Started](/start/): Get started with minikube
* [Examples](/examples/): Check out some minikube examples!
* [Getting Started](/docs/start/): Get started with minikube
* [Examples](/docs/examples/): Check out some minikube examples!

View File

@ -44,6 +44,7 @@ rm /usr/local/bin/minikube
brew cask reinstall minikube
```
{{% /tab %}}
{{% /tabs %}}
## Hypervisor Setup

View File

@ -0,0 +1,81 @@
// +build integration
/*
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.
*/
package integration
import (
"strings"
"testing"
)
func TestConfig(t *testing.T) {
t.Parallel()
p := profileName(t)
mk := NewMinikubeRunner(t, p, "--wait=false")
tests := []struct {
cmd string
stdout string
stderr string
}{
{
cmd: "config unset cpus",
stdout: "",
stderr: "",
},
{
cmd: "config get cpus",
stdout: "",
stderr: "Error: specified key could not be found in config",
},
{
cmd: "config set cpus 2",
stdout: "! These changes will take effect upon a minikube delete and then a minikube start",
stderr: "",
},
{
cmd: "config get cpus",
stdout: "2",
stderr: "",
},
{
cmd: "config unset cpus",
stdout: "",
stderr: ""},
{
cmd: "config get cpus",
stdout: "",
stderr: "Error: specified key could not be found in config",
},
}
for _, tc := range tests {
stdout, stderr, _ := mk.RunCommandRetriable(tc.cmd)
if !compare(tc.stdout, stdout) {
t.Fatalf("Expected stdout to be: %s. Stdout was: %s Stderr: %s", tc.stdout, stdout, stderr)
}
if !compare(tc.stderr, stderr) {
t.Fatalf("Expected stderr to be: %s. Stdout was: %s Stderr: %s", tc.stderr, stdout, stderr)
}
}
}
func compare(s1, s2 string) bool {
return strings.TrimSpace(s1) == strings.TrimSpace(s2)
}

View File

@ -124,7 +124,7 @@ func (m *MinikubeRunner) RunCommand(cmdStr string, failError bool, waitForRun ..
return stdout, stderr
}
// RunCommandRetriable Error executes a command, returns error
// RunCommandRetriable executes a command, returns error
// the purpose of this command is to make it retriable and
// better logging for retrying
func (m *MinikubeRunner) RunCommandRetriable(cmdStr string, waitForRun ...bool) (stdout string, stderr string, err error) {