Merge remote-tracking branch 'upstream/master' into NewCmdRunner

pull/5530/head
Medya Gh 2019-10-21 11:17:28 -07:00
commit 6bd5d9b157
121 changed files with 3670 additions and 863 deletions

View File

@ -3,7 +3,7 @@
os: linux
language: go
go:
- 1.12.9
- 1.12.12
env:
global:
- GOPROXY=https://proxy.golang.org
@ -19,7 +19,7 @@ matrix:
- language: go
name: Code Lint
go: 1.12.9
go: 1.12.12
env:
- TESTSUITE=lint
before_install:
@ -28,7 +28,7 @@ matrix:
- language: go
name: Unit Test
go: 1.12.9
go: 1.12.12
env:
- TESTSUITE=unittest
before_install:

View File

@ -15,7 +15,7 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 4
VERSION_BUILD ?= 0
VERSION_BUILD ?= 1
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).${VERSION_BUILD}
VERSION ?= v$(RAW_VERSION)
@ -26,10 +26,10 @@ DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
RPM_VERSION ?= $(DEB_VERSION)
# used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below
GO_VERSION ?= 1.12.9
GO_VERSION ?= 1.12.12
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2018.05.3
BUILDROOT_BRANCH ?= 2019.02.6
REGISTRY?=gcr.io/k8s-minikube
# Get git commit id
@ -49,15 +49,15 @@ MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
KERNEL_VERSION ?= 4.15
KERNEL_VERSION ?= 4.19.76
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.18.0
GOLINT_VERSION ?= v1.20.0
# Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS ?= 4
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
GOLINT_GOGC ?= 8
GOLINT_GOGC ?= 100
# options for lint (golangci-lint)
GOLINT_OPTIONS = --deadline 4m \
GOLINT_OPTIONS = --timeout 4m \
--build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \
--enable goimports,gocritic,golint,gocyclo,misspell,nakedret,stylecheck,unconvert,unparam \
--exclude 'variable on range scope.*in function literal|ifElseChain'
@ -127,17 +127,30 @@ endif
ifeq ($(GOOS),windows)
IS_EXE = .exe
DIRSEP_ = \\
DIRSEP = $(strip $(DIRSEP_))
PATHSEP = ;
else
DIRSEP = /
PATHSEP = :
endif
out/minikube-linux-x86_64: out/minikube-linux-amd64
cp $< $@
out/minikube-linux-aarch64: out/minikube-linux-arm64
cp $< $@
out/minikube$(IS_EXE): out/minikube-$(GOOS)-$(GOARCH)$(IS_EXE)
cp $< $@
out/minikube-windows-amd64.exe: out/minikube-windows-amd64
cp $< $@
.PHONY: minikube-linux-amd64 minikube-darwin-amd64 minikube-windows-amd64.exe
.PHONY: minikube-linux-amd64 minikube-linux-arm64 minikube-darwin-amd64 minikube-windows-amd64.exe
minikube-linux-amd64: out/minikube-linux-amd64
minikube-linux-arm64: out/minikube-linux-arm64
minikube-darwin-amd64: out/minikube-darwin-amd64
minikube-windows-amd64.exe: out/minikube-windows-amd64.exe
@ -239,33 +252,25 @@ extract:
pkg/minikube/assets/assets.go: $(shell find "deploy/addons" -type f)
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else ifeq ($(GOOS),windows)
which go-bindata || GO111MODULE=off GOBIN="$(GOPATH)\bin" go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH);$(GOPATH)\bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/...
-gofmt -s -w $@
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 assets deploy/addons/...
-gofmt -s -w $@
endif
which go-bindata || GO111MODULE=off GOBIN="$(GOPATH)$(DIRSEP)bin" go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH)$(PATHSEP)$(GOPATH)$(DIRSEP)bin" go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/...
-gofmt -s -w $@
@#golint: Dns should be DNS (compat sed)
@sed -i -e 's/Dns/DNS/g' $@ && rm -f ./-e
pkg/minikube/translate/translations.go: $(shell find "translations/" -type f)
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else ifeq ($(GOOS),windows)
which go-bindata || GO111MODULE=off GOBIN="$(GOPATH)\bin" go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH);$(GOPATH)\bin" go-bindata -nomemcopy -o $@ -pkg translate translations/...
-gofmt -s -w $@
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 translate translations/...
-gofmt -s -w $@
endif
which go-bindata || GO111MODULE=off GOBIN="$(GOPATH)$(DIRSEP)bin" go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH)$(PATHSEP)$(GOPATH)$(DIRSEP)bin" go-bindata -nomemcopy -o $@ -pkg translate translations/...
-gofmt -s -w $@
@#golint: Json should be JSON (compat sed)
@sed -i -e 's/Json/JSON/' $@ && rm -f ./-e
.PHONY: cross
cross: minikube-linux-amd64 minikube-darwin-amd64 minikube-windows-amd64.exe
cross: minikube-linux-amd64 minikube-linux-arm64 minikube-darwin-amd64 minikube-windows-amd64.exe
.PHONY: windows
windows: minikube-windows-amd64.exe
@ -281,7 +286,8 @@ e2e-cross: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe
.PHONY: checksum
checksum:
for f in out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe out/minikube.iso \
for f in out/minikube.iso out/minikube-linux-amd64 minikube-linux-arm64 \
out/minikube-darwin-amd64 out/minikube-windows-amd64.exe \
out/docker-machine-driver-kvm2 out/docker-machine-driver-hyperkit; do \
if [ -f "$${f}" ]; then \
openssl sha256 "$${f}" | awk '{print $$2}' > "$${f}.sha256" ; \
@ -312,7 +318,7 @@ vet:
@go vet $(SOURCE_PACKAGES)
.PHONY: golint
golint:
golint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
@golint -set_exit_status $(SOURCE_PACKAGES)
.PHONY: gocyclo
@ -348,21 +354,29 @@ mdlint:
out/docs/minikube.md: $(shell find "cmd") $(shell find "pkg/minikube/constants") pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
go run -ldflags="$(MINIKUBE_LDFLAGS)" -tags gendocs hack/help_text/gen_help_text.go
out/minikube_$(DEB_VERSION).deb: out/minikube-linux-amd64
out/minikube_$(DEB_VERSION).deb: out/minikube_$(DEB_VERSION)-0_amd64.deb
cp $< $@
out/minikube_$(DEB_VERSION)-0_%.deb: out/minikube-linux-%
cp -r installers/linux/deb/minikube_deb_template out/minikube_$(DEB_VERSION)
chmod 0755 out/minikube_$(DEB_VERSION)/DEBIAN
sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control
sed -E -i 's/--ARCH--/'$*'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control
mkdir -p out/minikube_$(DEB_VERSION)/usr/bin
cp out/minikube-linux-amd64 out/minikube_$(DEB_VERSION)/usr/bin/minikube
fakeroot dpkg-deb --build out/minikube_$(DEB_VERSION)
cp $< out/minikube_$(DEB_VERSION)/usr/bin/minikube
fakeroot dpkg-deb --build out/minikube_$(DEB_VERSION) $@
rm -rf out/minikube_$(DEB_VERSION)
out/minikube-$(RPM_VERSION).rpm: out/minikube-linux-amd64
out/minikube-$(RPM_VERSION).rpm: out/minikube-$(RPM_VERSION)-0.x86_64.rpm
cp $< $@
out/minikube-$(RPM_VERSION)-0.%.rpm: out/minikube-linux-%
cp -r installers/linux/rpm/minikube_rpm_template out/minikube-$(RPM_VERSION)
sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' out/minikube-$(RPM_VERSION)/minikube.spec
sed -E -i 's|--OUT--|'$(PWD)/out'|g' out/minikube-$(RPM_VERSION)/minikube.spec
rpmbuild -bb -D "_rpmdir $(PWD)/out" -D "_rpmfilename minikube-$(RPM_VERSION).rpm" \
rpmbuild -bb -D "_rpmdir $(PWD)/out" --target $* \
out/minikube-$(RPM_VERSION)/minikube.spec
@mv out/$*/minikube-$(RPM_VERSION)-0.$*.rpm out/ && rmdir out/$*
rm -rf out/minikube-$(RPM_VERSION)
.PHONY: apt
@ -380,14 +394,16 @@ out/repodata/repomd.xml: out/minikube-$(RPM_VERSION).rpm
-u "$(MINIKUBE_RELEASES_URL)/$(VERSION)/" out
.SECONDEXPANSION:
TAR_TARGETS_linux := out/minikube-linux-amd64 out/docker-machine-driver-kvm2
TAR_TARGETS_darwin := out/minikube-darwin-amd64 out/docker-machine-driver-hyperkit
TAR_TARGETS_windows := out/minikube-windows-amd64.exe
out/minikube-%-amd64.tar.gz: $$(TAR_TARGETS_$$*)
TAR_TARGETS_linux-amd64 := out/minikube-linux-amd64 out/docker-machine-driver-kvm2
TAR_TARGETS_linux-arm64 := out/minikube-linux-arm64
TAR_TARGETS_darwin-amd64 := out/minikube-darwin-amd64 out/docker-machine-driver-hyperkit
TAR_TARGETS_windows-amd64 := out/minikube-windows-amd64.exe
out/minikube-%.tar.gz: $$(TAR_TARGETS_$$*)
tar -cvzf $@ $^
.PHONY: cross-tars
cross-tars: out/minikube-windows-amd64.tar.gz out/minikube-linux-amd64.tar.gz out/minikube-darwin-amd64.tar.gz
cross-tars: out/minikube-linux-amd64.tar.gz out/minikube-linux-arm64.tar.gz \
out/minikube-windows-amd64.tar.gz out/minikube-darwin-amd64.tar.gz
-cd out && $(SHA512SUM) *.tar.gz > SHA512SUM
out/minikube-installer.exe: out/minikube-windows-amd64.exe
@ -551,3 +567,7 @@ site: site/themes/docsy/assets/vendor/bootstrap/package.js out/hugo/hugo
--navigateToChanged \
--ignoreCache \
--buildFuture)
.PHONY: out/mkcmp
out/mkcmp:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ cmd/performance/main.go

View File

@ -17,18 +17,23 @@ limitations under the License.
package config
import (
"encoding/json"
"fmt"
"os"
"sort"
"strings"
"text/template"
"github.com/spf13/cobra"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/out"
)
const defaultAddonListFormat = "- {{.AddonName}}: {{.AddonStatus}}\n"
var addonListFormat string
var addonListOutput string
// AddonListTemplate represents the addon list template
type AddonListTemplate struct {
@ -44,28 +49,49 @@ var addonsListCmd = &cobra.Command{
if len(args) != 0 {
exit.UsageT("usage: minikube addons list")
}
err := addonList()
if err != nil {
exit.WithError("addon list failed", err)
if addonListOutput != "list" && addonListFormat != defaultAddonListFormat {
exit.UsageT("Cannot use both --output and --format options")
}
switch strings.ToLower(addonListOutput) {
case "list":
printAddonsList()
case "json":
printAddonsJSON()
default:
exit.WithCodeT(exit.BadUsage, fmt.Sprintf("invalid output format: %s. Valid values: 'list', 'json'", addonListOutput))
}
},
}
func init() {
AddonsCmd.Flags().StringVar(&addonListFormat, "format", defaultAddonListFormat,
addonsListCmd.Flags().StringVarP(
&addonListFormat,
"format",
"f",
defaultAddonListFormat,
`Go template format string for the addon list output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list of accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd/config#AddonListTemplate`)
addonsListCmd.Flags().StringVarP(
&addonListOutput,
"output",
"o",
"list",
`minikube addons list --output OUTPUT. json, list`)
AddonsCmd.AddCommand(addonsListCmd)
}
func stringFromStatus(addonStatus bool) string {
var stringFromStatus = func(addonStatus bool) string {
if addonStatus {
return "enabled"
}
return "disabled"
}
func addonList() error {
var printAddonsList = func() {
addonNames := make([]string, 0, len(assets.Addons))
for addonName := range assets.Addons {
addonNames = append(addonNames, addonName)
@ -76,7 +102,7 @@ func addonList() error {
addonBundle := assets.Addons[addonName]
addonStatus, err := addonBundle.IsEnabled()
if err != nil {
return err
exit.WithError("Error getting addons status", err)
}
tmpl, err := template.New("list").Parse(addonListFormat)
if err != nil {
@ -88,5 +114,30 @@ func addonList() error {
exit.WithError("Error executing list template", err)
}
}
return nil
}
var printAddonsJSON = func() {
addonNames := make([]string, 0, len(assets.Addons))
for addonName := range assets.Addons {
addonNames = append(addonNames, addonName)
}
sort.Strings(addonNames)
addonsMap := map[string]map[string]interface{}{}
for _, addonName := range addonNames {
addonBundle := assets.Addons[addonName]
addonStatus, err := addonBundle.IsEnabled()
if err != nil {
exit.WithError("Error getting addons status", err)
}
addonsMap[addonName] = map[string]interface{}{
"Status": stringFromStatus(addonStatus),
}
}
jsonString, _ := json.Marshal(addonsMap)
out.String(string(jsonString))
}

View File

@ -16,10 +16,24 @@ limitations under the License.
package config
import "testing"
import (
"testing"
"gotest.tools/assert"
pkgConfig "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/localpath"
)
func TestDisableUnknownAddon(t *testing.T) {
if err := Set("InvalidAddon", "false"); err == nil {
t.Fatalf("Disable did not return error for unknown addon")
}
}
func TestDisableAddon(t *testing.T) {
if err := Set("dashboard", "false"); err != nil {
t.Fatalf("Disable returned unexpected error: " + err.Error())
}
config, _ := pkgConfig.ReadConfig(localpath.ConfigFile)
assert.Equal(t, config["dashboard"], false)
}

View File

@ -16,10 +16,24 @@ limitations under the License.
package config
import "testing"
import (
"testing"
"gotest.tools/assert"
pkgConfig "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/localpath"
)
func TestEnableUnknownAddon(t *testing.T) {
if err := Set("InvalidAddon", "false"); err == nil {
t.Fatalf("Enable did not return error for unknown addon")
}
}
func TestEnableAddon(t *testing.T) {
if err := Set("ingress", "true"); err != nil {
t.Fatalf("Enable returned unexpected error: " + err.Error())
}
config, _ := pkgConfig.ReadConfig(localpath.ConfigFile)
assert.Equal(t, config["ingress"], true)
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package config
import (
"os"
"text/template"
"github.com/spf13/cobra"
@ -62,7 +63,9 @@ var addonsOpenCmd = &cobra.Command{
}
defer api.Close()
cluster.EnsureMinikubeRunningOrExit(api, 1)
if !cluster.IsMinikubeRunning(api) {
os.Exit(1)
}
addon, ok := assets.Addons[addonName] // validate addon input
if !ok {
exit.WithCodeT(exit.Data, `addon '{{.name}}' is not a valid addon packaged with minikube.

View File

@ -45,8 +45,23 @@ var ProfileCmd = &cobra.Command{
}
profile := args[0]
/**
we need to add code over here to check whether the profile
name is in the list of reserved keywords
*/
if pkgConfig.ProfileNameInReservedKeywords(profile) {
out.ErrT(out.FailureType, `Profile name "{{.profilename}}" is minikube keyword. To delete profile use command minikube delete -p <profile name> `, out.V{"profilename": profile})
os.Exit(0)
}
if profile == "default" {
profile = "minikube"
} else {
// not validating when it is default profile
errProfile, ok := ValidateProfile(profile)
if !ok && errProfile != nil {
out.FailureT(errProfile.Msg)
}
}
if !pkgConfig.ProfileExists(profile) {

View File

@ -17,9 +17,11 @@ limitations under the License.
package config
import (
"encoding/json"
"fmt"
"os"
"strconv"
"strings"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
@ -29,48 +31,101 @@ import (
"github.com/spf13/cobra"
)
var (
output string
)
var profileListCmd = &cobra.Command{
Use: "list",
Short: "Lists all minikube profiles.",
Long: "Lists all valid minikube profiles and detects all possible invalid profiles.",
Run: func(cmd *cobra.Command, args []string) {
var validData [][]string
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Profile", "VM Driver", "NodeIP", "Node Port", "Kubernetes Version"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")
validProfiles, invalidProfiles, err := config.ListProfiles()
if len(validProfiles) == 0 || err != nil {
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
}
for _, p := range validProfiles {
validData = append(validData, []string{p.Name, p.Config.MachineConfig.VMDriver, p.Config.KubernetesConfig.NodeIP, strconv.Itoa(p.Config.KubernetesConfig.NodePort), p.Config.KubernetesConfig.KubernetesVersion})
switch strings.ToLower(output) {
case "json":
printProfilesJSON()
case "table":
printProfilesTable()
default:
exit.WithCodeT(exit.BadUsage, fmt.Sprintf("invalid output format: %s. Valid values: 'table', 'json'", output))
}
table.AppendBulk(validData)
table.Render()
if invalidProfiles != nil {
out.T(out.WarningType, "Found {{.number}} invalid profile(s) ! ", out.V{"number": len(invalidProfiles)})
for _, p := range invalidProfiles {
out.T(out.Empty, "\t "+p.Name)
}
out.T(out.Tip, "You can delete them using the following command(s): ")
for _, p := range invalidProfiles {
out.String(fmt.Sprintf("\t $ minikube delete -p %s \n", p.Name))
}
}
if err != nil {
exit.WithCodeT(exit.Config, fmt.Sprintf("error loading profiles: %v", err))
}
},
}
var printProfilesTable = func() {
var validData [][]string
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Profile", "VM Driver", "NodeIP", "Node Port", "Kubernetes Version"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")
validProfiles, invalidProfiles, err := config.ListProfiles()
if len(validProfiles) == 0 || err != nil {
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
}
for _, p := range validProfiles {
validData = append(validData, []string{p.Name, p.Config.MachineConfig.VMDriver, p.Config.KubernetesConfig.NodeIP, strconv.Itoa(p.Config.KubernetesConfig.NodePort), p.Config.KubernetesConfig.KubernetesVersion})
}
table.AppendBulk(validData)
table.Render()
if invalidProfiles != nil {
out.T(out.WarningType, "Found {{.number}} invalid profile(s) ! ", out.V{"number": len(invalidProfiles)})
for _, p := range invalidProfiles {
out.T(out.Empty, "\t "+p.Name)
}
out.T(out.Tip, "You can delete them using the following command(s): ")
for _, p := range invalidProfiles {
out.String(fmt.Sprintf("\t $ minikube delete -p %s \n", p.Name))
}
}
if err != nil {
exit.WithCodeT(exit.Config, fmt.Sprintf("error loading profiles: %v", err))
}
}
var printProfilesJSON = func() {
validProfiles, invalidProfiles, err := config.ListProfiles()
var valid []*config.Profile
var invalid []*config.Profile
if validProfiles != nil {
valid = validProfiles
} else {
valid = []*config.Profile{}
}
if invalidProfiles != nil {
invalid = invalidProfiles
} else {
invalid = []*config.Profile{}
}
var body = map[string]interface{}{}
if err == nil {
body["valid"] = valid
body["invalid"] = invalid
jsonString, _ := json.Marshal(body)
out.String(string(jsonString))
} else {
body["error"] = err
jsonString, _ := json.Marshal(body)
out.String(string(jsonString))
os.Exit(exit.Failure)
}
}
func init() {
profileListCmd.Flags().StringVarP(&output, "output", "o", "table", "The output format. One of 'json', 'table'")
ProfileCmd.AddCommand(profileListCmd)
}

View File

@ -151,5 +151,5 @@ func posString(slice []string, element string) int {
// containsString returns true if slice contains element
func containsString(slice []string, element string) bool {
return !(posString(slice, element) == -1)
return posString(slice, element) != -1
}

View File

@ -111,6 +111,18 @@ func EnableOrDisableAddon(name string, val string) error {
if err != nil {
return errors.Wrapf(err, "parsing bool: %s", name)
}
addon := assets.Addons[name]
// check addon status before enabling/disabling it
alreadySet, err := isAddonAlreadySet(addon, enable)
if err != nil {
out.ErrT(out.Conflict, "{{.error}}", out.V{"error": err})
return err
}
//if addon is already enabled or disabled, do nothing
if alreadySet {
return nil
}
// TODO(r2d4): config package should not reference API, pull this out
api, err := machine.NewAPIClient()
@ -118,13 +130,18 @@ func EnableOrDisableAddon(name string, val string) error {
return errors.Wrap(err, "machine client")
}
defer api.Close()
cluster.EnsureMinikubeRunningOrExit(api, 0)
addon := assets.Addons[name]
//if minikube is not running, we return and simply update the value in the addon
//config and rewrite the file
if !cluster.IsMinikubeRunning(api) {
return nil
}
host, err := cluster.CheckIfHostExistsAndLoad(api, config.GetMachineName())
if err != nil {
return errors.Wrap(err, "getting host")
}
cmd, err := machine.CommandRunner(host)
if err != nil {
return errors.Wrap(err, "command runner")
@ -139,30 +156,24 @@ func EnableOrDisableAddon(name string, val string) error {
return enableOrDisableAddonInternal(addon, cmd, data, enable)
}
func isAddonAlreadySet(addon *assets.Addon, enable bool) error {
func isAddonAlreadySet(addon *assets.Addon, enable bool) (bool, error) {
addonStatus, err := addon.IsEnabled()
if err != nil {
return errors.Wrap(err, "get the addon status")
return false, errors.Wrap(err, "get the addon status")
}
if addonStatus && enable {
return fmt.Errorf("addon %s was already enabled", addon.Name())
return true, nil
} else if !addonStatus && !enable {
return fmt.Errorf("addon %s was already disabled", addon.Name())
return true, nil
}
return nil
return false, nil
}
func enableOrDisableAddonInternal(addon *assets.Addon, cmd command.Runner, data interface{}, enable bool) error {
var err error
// check addon status before enabling/disabling it
if err := isAddonAlreadySet(addon, enable); err != nil {
out.ErrT(out.Conflict, "{{.error}}", out.V{"error": err})
os.Exit(0)
}
if enable {
for _, addon := range addon.Assets {
@ -232,3 +243,42 @@ func EnableOrDisableStorageClasses(name, val string) error {
return EnableOrDisableAddon(name, val)
}
// ErrValidateProfile Error to validate profile
type ErrValidateProfile struct {
Name string
Msg string
}
func (e ErrValidateProfile) Error() string {
return e.Msg
}
// ValidateProfile checks if the profile user is trying to switch exists, else throws error
func ValidateProfile(profile string) (*ErrValidateProfile, bool) {
validProfiles, invalidProfiles, err := config.ListProfiles()
if err != nil {
out.FailureT(err.Error())
}
// handling invalid profiles
for _, invalidProf := range invalidProfiles {
if profile == invalidProf.Name {
return &ErrValidateProfile{Name: profile, Msg: fmt.Sprintf("%q is an invalid profile", profile)}, false
}
}
profileFound := false
// valid profiles if found, setting profileFound to trueexpectedMsg
for _, prof := range validProfiles {
if prof.Name == profile {
profileFound = true
break
}
}
if !profileFound {
return &ErrValidateProfile{Name: profile, Msg: fmt.Sprintf("profile %q not found", profile)}, false
}
return nil, true
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package config
import (
"fmt"
"testing"
"k8s.io/minikube/pkg/minikube/assets"
@ -85,15 +86,12 @@ func TestSetBool(t *testing.T) {
func TestIsAddonAlreadySet(t *testing.T) {
testCases := []struct {
addonName string
expectErr string
}{
{
addonName: "ingress",
expectErr: "addon ingress was already ",
},
{
addonName: "heapster",
expectErr: "addon heapster was already ",
},
}
@ -101,13 +99,39 @@ func TestIsAddonAlreadySet(t *testing.T) {
addon := assets.Addons[test.addonName]
addonStatus, _ := addon.IsEnabled()
expectMsg := test.expectErr + "enabled"
if !addonStatus {
expectMsg = test.expectErr + "disabled"
alreadySet, err := isAddonAlreadySet(addon, addonStatus)
if !alreadySet {
if addonStatus {
t.Errorf("Did not get expected status, \n\n expected %+v already enabled", test.addonName)
} else {
t.Errorf("Did not get expected status, \n\n expected %+v already disabled", test.addonName)
}
}
err := isAddonAlreadySet(addon, addonStatus)
if err.Error() != expectMsg {
t.Errorf("Did not get expected error, \n\n expected: %+v \n\n actual: %+v", expectMsg, err)
if err != nil {
t.Errorf("Got unexpected error: %+v", err)
}
}
}
func TestValidateProfile(t *testing.T) {
testCases := []struct {
profileName string
}{
{
profileName: "82374328742_2974224498",
},
{
profileName: "minikube",
},
}
for _, test := range testCases {
profileNam := test.profileName
expectedMsg := fmt.Sprintf("profile %q not found", test.profileName)
err, ok := ValidateProfile(profileNam)
if !ok && err.Error() != expectedMsg {
t.Errorf("Didnt receive expected message")
}
}
}

View File

@ -93,7 +93,9 @@ var dashboardCmd = &cobra.Command{
exit.WithCodeT(exit.NoInput, "kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/")
}
cluster.EnsureMinikubeRunningOrExit(api, 1)
if !cluster.IsMinikubeRunning(api) {
os.Exit(1)
}
// Check dashboard status before enabling it
dashboardAddon := assets.Addons["dashboard"]

View File

@ -25,7 +25,7 @@ import (
"github.com/docker/machine/libmachine/mcnerror"
"github.com/golang/glog"
ps "github.com/mitchellh/go-ps"
"github.com/mitchellh/go-ps"
"github.com/pkg/errors"
"github.com/docker/machine/libmachine"
@ -42,6 +42,9 @@ import (
"k8s.io/minikube/pkg/minikube/out"
)
var deleteAll bool
var purge bool
// deleteCmd represents the delete command
var deleteCmd = &cobra.Command{
Use: "delete",
@ -51,26 +54,153 @@ associated files.`,
Run: runDelete,
}
type typeOfError int
const (
// Fatal is a type of DeletionError
Fatal typeOfError = 0
// MissingProfile is a type of DeletionError
MissingProfile typeOfError = 1
// MissingCluster is a type of DeletionError
MissingCluster typeOfError = 2
)
// DeletionError can be returned from DeleteProfiles
type DeletionError struct {
Err error
Errtype typeOfError
}
func (error DeletionError) Error() string {
return error.Err.Error()
}
func init() {
deleteCmd.Flags().BoolVar(&deleteAll, "all", false, "Set flag to delete all profiles")
deleteCmd.Flags().BoolVar(&purge, "purge", false, "Set this flag to delete the '.minikube' folder from your user directory.")
if err := viper.BindPFlags(deleteCmd.Flags()); err != nil {
exit.WithError("unable to bind flags", err)
}
RootCmd.AddCommand(deleteCmd)
}
// runDelete handles the executes the flow of "minikube delete"
func runDelete(cmd *cobra.Command, args []string) {
if len(args) > 0 {
exit.UsageT("Usage: minikube delete")
}
profile := viper.GetString(pkg_config.MachineProfile)
profileFlag, err := cmd.Flags().GetString("profile")
if err != nil {
exit.WithError("Could not get profile flag", err)
}
validProfiles, invalidProfiles, err := pkg_config.ListProfiles()
profilesToDelete := append(validProfiles, invalidProfiles...)
// If the purge flag is set, go ahead and delete the .minikube directory.
if purge && len(profilesToDelete) > 1 && !deleteAll {
out.ErrT(out.Notice, "Multiple minikube profiles were found - ")
for _, p := range profilesToDelete {
out.T(out.Notice, " - {{.profile}}", out.V{"profile": p.Name})
}
exit.UsageT("Usage: minikube delete --all --purge")
}
if deleteAll {
if profileFlag != constants.DefaultMachineName {
exit.UsageT("usage: minikube delete --all")
}
if err != nil {
exit.WithError("Error getting profiles to delete", err)
}
errs := DeleteProfiles(profilesToDelete)
if len(errs) > 0 {
HandleDeletionErrors(errs)
} else {
out.T(out.DeletingHost, "Successfully deleted all profiles")
}
} else {
if len(args) > 0 {
exit.UsageT("usage: minikube delete")
}
profileName := viper.GetString(pkg_config.MachineProfile)
profile, err := pkg_config.LoadProfile(profileName)
if err != nil {
out.ErrT(out.Meh, `"{{.name}}" profile does not exist`, out.V{"name": profileName})
}
errs := DeleteProfiles([]*pkg_config.Profile{profile})
if len(errs) > 0 {
HandleDeletionErrors(errs)
} else {
out.T(out.DeletingHost, "Successfully deleted profile \"{{.name}}\"", out.V{"name": profileName})
}
}
// If the purge flag is set, go ahead and delete the .minikube directory.
if purge {
glog.Infof("Purging the '.minikube' directory located at %s", localpath.MiniPath())
if err := os.RemoveAll(localpath.MiniPath()); err != nil {
exit.WithError("unable to delete minikube config folder", err)
}
out.T(out.Crushed, "Successfully purged minikube directory located at - [{{.minikubeDirectory}}]", out.V{"minikubeDirectory": localpath.MiniPath()})
}
}
// DeleteProfiles deletes one or more profiles
func DeleteProfiles(profiles []*pkg_config.Profile) []error {
var errs []error
for _, profile := range profiles {
err := deleteProfile(profile)
if err != nil {
mm, loadErr := cluster.LoadMachine(profile.Name)
if !profile.IsValid() || (loadErr != nil || !mm.IsValid()) {
invalidProfileDeletionErrs := deleteInvalidProfile(profile)
if len(invalidProfileDeletionErrs) > 0 {
errs = append(errs, invalidProfileDeletionErrs...)
}
} else {
errs = append(errs, err)
}
}
}
return errs
}
func deleteProfile(profile *pkg_config.Profile) error {
viper.Set(pkg_config.MachineProfile, profile.Name)
api, err := machine.NewAPIClient()
if err != nil {
exit.WithError("Error getting client", err)
delErr := profileDeletionErr(profile.Name, fmt.Sprintf("error getting client %v", err))
return DeletionError{Err: delErr, Errtype: Fatal}
}
defer api.Close()
cc, err := pkg_config.Load()
if err != nil && !os.IsNotExist(err) {
out.ErrT(out.Sad, "Error loading profile {{.name}}: {{.error}}", out.V{"name": profile, "error": err})
delErr := profileDeletionErr(profile.Name, fmt.Sprintf("error loading profile config: %v", err))
return DeletionError{Err: delErr, Errtype: MissingProfile}
}
// In the case of "none", we want to uninstall Kubernetes as there is no VM to delete
if err == nil && cc.MachineConfig.VMDriver == constants.DriverNone {
uninstallKubernetes(api, cc.KubernetesConfig, viper.GetString(cmdcfg.Bootstrapper))
if err := uninstallKubernetes(api, cc.KubernetesConfig, viper.GetString(cmdcfg.Bootstrapper)); err != nil {
deletionError, ok := err.(DeletionError)
if ok {
delErr := profileDeletionErr(profile.Name, fmt.Sprintf("%v", err))
deletionError.Err = delErr
return deletionError
}
return err
}
}
if err := killMountProcess(); err != nil {
@ -80,42 +210,114 @@ func runDelete(cmd *cobra.Command, args []string) {
if err = cluster.DeleteHost(api); err != nil {
switch errors.Cause(err).(type) {
case mcnerror.ErrHostDoesNotExist:
out.T(out.Meh, `"{{.name}}" cluster does not exist. Proceeding ahead with cleanup.`, out.V{"name": profile})
out.T(out.Meh, `"{{.name}}" cluster does not exist. Proceeding ahead with cleanup.`, out.V{"name": profile.Name})
default:
out.T(out.FailureType, "Failed to delete cluster: {{.error}}", out.V{"error": err})
out.T(out.Notice, `You may need to manually remove the "{{.name}}" VM from your hypervisor`, out.V{"name": profile})
out.T(out.Notice, `You may need to manually remove the "{{.name}}" VM from your hypervisor`, out.V{"name": profile.Name})
}
}
// In case DeleteHost didn't complete the job.
deleteProfileDirectory(profile)
deleteProfileDirectory(profile.Name)
if err := pkg_config.DeleteProfile(profile); err != nil {
if err := pkg_config.DeleteProfile(profile.Name); err != nil {
if os.IsNotExist(err) {
out.T(out.Meh, `"{{.name}}" profile does not exist`, out.V{"name": profile})
os.Exit(0)
delErr := profileDeletionErr(profile.Name, fmt.Sprintf("\"%s\" profile does not exist", profile.Name))
return DeletionError{Err: delErr, Errtype: MissingProfile}
}
exit.WithError("Failed to remove profile", err)
delErr := profileDeletionErr(profile.Name, fmt.Sprintf("failed to remove profile %v", err))
return DeletionError{Err: delErr, Errtype: Fatal}
}
out.T(out.Crushed, `The "{{.name}}" cluster has been deleted.`, out.V{"name": profile})
out.T(out.Crushed, `The "{{.name}}" cluster has been deleted.`, out.V{"name": profile.Name})
machineName := pkg_config.GetMachineName()
if err := kubeconfig.DeleteContext(constants.KubeconfigPath, machineName); err != nil {
exit.WithError("update config", err)
return DeletionError{Err: fmt.Errorf("update config: %v", err), Errtype: Fatal}
}
if err := cmdcfg.Unset(pkg_config.MachineProfile); err != nil {
exit.WithError("unset minikube profile", err)
return DeletionError{Err: fmt.Errorf("unset minikube profile: %v", err), Errtype: Fatal}
}
return nil
}
func uninstallKubernetes(api libmachine.API, kc pkg_config.KubernetesConfig, bsName string) {
func deleteInvalidProfile(profile *pkg_config.Profile) []error {
out.T(out.DeletingHost, "Trying to delete invalid profile {{.profile}}", out.V{"profile": profile.Name})
var errs []error
pathToProfile := pkg_config.ProfileFolderPath(profile.Name, localpath.MiniPath())
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
err := os.RemoveAll(pathToProfile)
if err != nil {
errs = append(errs, DeletionError{err, Fatal})
}
}
pathToMachine := cluster.MachinePath(profile.Name, localpath.MiniPath())
if _, err := os.Stat(pathToMachine); !os.IsNotExist(err) {
err := os.RemoveAll(pathToMachine)
if err != nil {
errs = append(errs, DeletionError{err, Fatal})
}
}
return errs
}
func profileDeletionErr(profileName string, additionalInfo string) error {
return fmt.Errorf("error deleting profile \"%s\": %s", profileName, additionalInfo)
}
func uninstallKubernetes(api libmachine.API, kc pkg_config.KubernetesConfig, bsName string) error {
out.T(out.Resetting, "Uninstalling Kubernetes {{.kubernetes_version}} using {{.bootstrapper_name}} ...", out.V{"kubernetes_version": kc.KubernetesVersion, "bootstrapper_name": bsName})
clusterBootstrapper, err := getClusterBootstrapper(api, bsName)
if err != nil {
out.ErrT(out.Empty, "Unable to get bootstrapper: {{.error}}", out.V{"error": err})
return DeletionError{Err: fmt.Errorf("unable to get bootstrapper: %v", err), Errtype: Fatal}
} else if err = clusterBootstrapper.DeleteCluster(kc); err != nil {
out.ErrT(out.Empty, "Failed to delete cluster: {{.error}}", out.V{"error": err})
return DeletionError{Err: fmt.Errorf("failed to delete cluster: %v", err), Errtype: Fatal}
}
return nil
}
// HandleDeletionErrors handles deletion errors from DeleteProfiles
func HandleDeletionErrors(errors []error) {
if len(errors) == 1 {
handleSingleDeletionError(errors[0])
} else {
handleMultipleDeletionErrors(errors)
}
}
func handleSingleDeletionError(err error) {
deletionError, ok := err.(DeletionError)
if ok {
switch deletionError.Errtype {
case Fatal:
out.FatalT(deletionError.Error())
case MissingProfile:
out.ErrT(out.Sad, deletionError.Error())
case MissingCluster:
out.ErrT(out.Meh, deletionError.Error())
default:
out.FatalT(deletionError.Error())
}
} else {
exit.WithError("Could not process error from failed deletion", err)
}
}
func handleMultipleDeletionErrors(errors []error) {
out.ErrT(out.Sad, "Multiple errors deleting profiles")
for _, err := range errors {
deletionError, ok := err.(DeletionError)
if ok {
glog.Errorln(deletionError.Error())
} else {
exit.WithError("Could not process errors from failed deletion", err)
}
}
}

View File

@ -0,0 +1,216 @@
/*
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.
*/
package cmd
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/otiai10/copy"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/localpath"
)
// except returns a list of strings, minus the excluded ones
func exclude(vals []string, exclude []string) []string {
result := []string{}
for _, v := range vals {
excluded := false
for _, e := range exclude {
if e == v {
excluded = true
continue
}
}
if !excluded {
result = append(result, v)
}
}
return result
}
func fileNames(path string) ([]string, error) {
result := []string{}
fis, err := ioutil.ReadDir(path)
if err != nil {
return result, err
}
for _, fi := range fis {
result = append(result, fi.Name())
}
return result, nil
}
func TestDeleteProfile(t *testing.T) {
td, err := ioutil.TempDir("", "single")
if err != nil {
t.Fatalf("tempdir: %v", err)
}
err = copy.Copy("../../../pkg/minikube/config/testdata/delete-single", td)
if err != nil {
t.Fatalf("copy: %v", err)
}
tests := []struct {
name string
profile string
expected []string
}{
{"normal", "p1", []string{"p1"}},
{"empty-profile", "p2_empty_profile_config", []string{"p2_empty_profile_config"}},
{"invalid-profile", "p3_invalid_profile_config", []string{"p3_invalid_profile_config"}},
{"partial-profile", "p4_partial_profile_config", []string{"p4_partial_profile_config"}},
{"missing-mach", "p5_missing_machine_config", []string{"p5_missing_machine_config"}},
{"empty-mach", "p6_empty_machine_config", []string{"p6_empty_machine_config"}},
{"invalid-mach", "p7_invalid_machine_config", []string{"p7_invalid_machine_config"}},
{"partial-mach", "p8_partial_machine_config", []string{"p8_partial_machine_config"}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err = os.Setenv(localpath.MinikubeHome, td)
if err != nil {
t.Errorf("setenv: %v", err)
}
beforeProfiles, err := fileNames(filepath.Join(localpath.MiniPath(), "profiles"))
if err != nil {
t.Errorf("readdir: %v", err)
}
beforeMachines, err := fileNames(filepath.Join(localpath.MiniPath(), "machines"))
if err != nil {
t.Errorf("readdir: %v", err)
}
profile, err := config.LoadProfile(tt.profile)
if err != nil {
t.Logf("load failure: %v", err)
}
errs := DeleteProfiles([]*config.Profile{profile})
if len(errs) > 0 {
HandleDeletionErrors(errs)
t.Errorf("Errors while deleting profiles: %v", errs)
}
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
t.Errorf("Profile folder of profile \"%s\" was not deleted", profile.Name)
}
pathToMachine := cluster.MachinePath(profile.Name, localpath.MiniPath())
if _, err := os.Stat(pathToMachine); !os.IsNotExist(err) {
t.Errorf("Profile folder of profile \"%s\" was not deleted", profile.Name)
}
afterProfiles, err := fileNames(filepath.Join(localpath.MiniPath(), "profiles"))
if err != nil {
t.Errorf("readdir profiles: %v", err)
}
afterMachines, err := fileNames(filepath.Join(localpath.MiniPath(), "machines"))
if err != nil {
t.Errorf("readdir machines: %v", err)
}
expectedProfiles := exclude(beforeProfiles, tt.expected)
if diff := cmp.Diff(expectedProfiles, afterProfiles); diff != "" {
t.Errorf("profiles mismatch (-want +got):\n%s", diff)
}
expectedMachines := exclude(beforeMachines, tt.expected)
if diff := cmp.Diff(expectedMachines, afterMachines); diff != "" {
t.Errorf("machines mismatch (-want +got):\n%s", diff)
}
viper.Set(config.MachineProfile, "")
})
}
}
func TestDeleteAllProfiles(t *testing.T) {
td, err := ioutil.TempDir("", "all")
if err != nil {
t.Fatalf("tempdir: %v", err)
}
err = copy.Copy("../../../pkg/minikube/config/testdata/delete-all", td)
if err != nil {
t.Fatalf("copy: %v", err)
}
err = os.Setenv(localpath.MinikubeHome, td)
if err != nil {
t.Errorf("error setting up test environment. could not set %s", localpath.MinikubeHome)
}
pFiles, err := fileNames(filepath.Join(localpath.MiniPath(), "profiles"))
if err != nil {
t.Errorf("filenames: %v", err)
}
mFiles, err := fileNames(filepath.Join(localpath.MiniPath(), "machines"))
if err != nil {
t.Errorf("filenames: %v", err)
}
const numberOfTotalProfileDirs = 8
if numberOfTotalProfileDirs != len(pFiles) {
t.Errorf("got %d test profiles, expected %d: %s", len(pFiles), numberOfTotalProfileDirs, pFiles)
}
const numberOfTotalMachineDirs = 7
if numberOfTotalMachineDirs != len(mFiles) {
t.Errorf("got %d test machines, expected %d: %s", len(mFiles), numberOfTotalMachineDirs, mFiles)
}
validProfiles, inValidProfiles, err := config.ListProfiles()
if err != nil {
t.Error(err)
}
if numberOfTotalProfileDirs != len(validProfiles)+len(inValidProfiles) {
t.Errorf("ListProfiles length = %d, expected %d\nvalid: %v\ninvalid: %v\n", len(validProfiles)+len(inValidProfiles), numberOfTotalProfileDirs, validProfiles, inValidProfiles)
}
profiles := append(validProfiles, inValidProfiles...)
errs := DeleteProfiles(profiles)
if errs != nil {
t.Errorf("errors while deleting all profiles: %v", errs)
}
afterProfiles, err := fileNames(filepath.Join(localpath.MiniPath(), "profiles"))
if err != nil {
t.Errorf("profiles: %v", err)
}
afterMachines, err := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
if err != nil {
t.Errorf("machines: %v", err)
}
if len(afterProfiles) != 0 {
t.Errorf("Did not delete all profiles, remaining: %v", afterProfiles)
}
if len(afterMachines) != 0 {
t.Errorf("Did not delete all machines, remaining: %v", afterMachines)
}
viper.Set(config.MachineProfile, "")
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package cmd
import (
"os"
"text/template"
"github.com/spf13/cobra"
@ -64,7 +65,9 @@ var serviceCmd = &cobra.Command{
}
defer api.Close()
cluster.EnsureMinikubeRunningOrExit(api, 1)
if !cluster.IsMinikubeRunning(api) {
os.Exit(1)
}
err = service.WaitAndMaybeOpenService(api, namespace, svc,
serviceURLTemplate, serviceURLMode, https, wait, interval)
if err != nil {

View File

@ -17,7 +17,9 @@ limitations under the License.
package cmd
import (
"encoding/json"
"fmt"
"math"
"net"
"net/url"
"os"
@ -117,6 +119,7 @@ const (
minimumMemorySize = "1024mb"
minimumCPUS = 2
minimumDiskSize = "2000mb"
autoUpdate = "auto-update-drivers"
)
var (
@ -130,6 +133,18 @@ var (
extraOptions cfg.ExtraOptionSlice
)
type kubectlversion struct {
CVersion VersionInfo `json:"clientVersion"`
SVersion VersionInfo `json:"serverVersion"`
}
// VersionInfo holds version information
type VersionInfo struct {
Major string `json:"major"`
Minor string `json:"minor"`
GitVersion string `json:"gitVersion"`
}
func init() {
initMinikubeFlags()
initKubernetesFlags()
@ -170,6 +185,7 @@ func initMinikubeFlags() {
startCmd.Flags().Bool(waitUntilHealthy, true, "Wait until Kubernetes core services are healthy before exiting.")
startCmd.Flags().Duration(waitTimeout, 6*time.Minute, "max time to wait per Kubernetes core services to be healthy.")
startCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
startCmd.Flags().Bool(autoUpdate, true, "If set, automatically updates drivers to the latest version. Defaults to true.")
}
// initKubernetesFlags inits the commandline flags for kubernetes related options
@ -293,7 +309,13 @@ func runStart(cmd *cobra.Command, args []string) {
validateFlags(driver)
validateUser(driver)
_ = getMinikubeVersion(driver)
v, err := version.GetSemverVersion()
if err != nil {
out.WarningT("Error parsing minikube version: {{.error}}", out.V{"error": err})
} else if err := drivers.InstallOrUpdate(driver, localpath.MakeMiniPath("bin"), v, viper.GetBool(interactive), viper.GetBool(autoUpdate)); err != nil {
out.WarningT("Unable to update {{.driver}} driver: {{.error}}", out.V{"driver": driver, "error": err})
}
k8sVersion, isUpgrade := getKubernetesVersion(oldConfig)
config, err := generateCfgFromFlags(cmd, k8sVersion, driver)
if err != nil {
@ -446,8 +468,12 @@ func startMachine(config *cfg.Config) (runner command.Runner, preExists bool, ma
exit.WithError("Failed to get machine client", err)
}
host, preExists = startHost(m, config.MachineConfig)
runner, err = machine.CommandRunner(host)
if err != nil {
exit.WithError("Failed to get command runner", err)
}
ip := validateNetwork(host)
ip := validateNetwork(host, runner)
// Bypass proxy for minikube's vm host ip
err = proxy.ExcludeIP(ip)
if err != nil {
@ -458,10 +484,6 @@ func startMachine(config *cfg.Config) (runner command.Runner, preExists bool, ma
if err := saveConfig(config); err != nil {
exit.WithError("Failed to save config", err)
}
runner, err = machine.CommandRunner(host)
if err != nil {
exit.WithError("Failed to get command runner", err)
}
return runner, preExists, m, host
}
@ -477,15 +499,49 @@ func showVersionInfo(k8sVersion string, cr cruntime.Manager) {
}
}
/**
Function to check for kubectl. The checking is to compare
the version reported by both the client and server. Checking
is based on what is outlined in Kubernetes document
https://kubernetes.io/docs/setup/release/version-skew-policy/#kubectl
*/
func showKubectlConnectInfo(kcs *kubeconfig.Settings) {
var output []byte
clientVersion := kubectlversion{}
if kcs.KeepContext {
out.T(out.Kubectl, "To connect to this cluster, use: kubectl --context={{.name}}", out.V{"name": kcs.ClusterName})
} else {
out.T(out.Ready, `Done! kubectl is now configured to use "{{.name}}"`, out.V{"name": cfg.GetMachineName()})
}
_, err := exec.LookPath("kubectl")
path, err := exec.LookPath("kubectl")
// ...not found just print and return
if err != nil {
out.T(out.Tip, "For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/")
return
}
output, err = exec.Command(path, "version", "--output=json").Output()
if err != nil {
return
}
glog.Infof("Received output from kubectl %s", output)
// unmarshal the json
output = []byte("Nanik")
clientjsonErr := json.Unmarshal(output, &clientVersion)
if clientjsonErr != nil {
glog.Infof("There was an error processing kubectl json output.")
return
}
// obtain the minor version for both client & server
serverMinor, _ := strconv.Atoi(clientVersion.SVersion.Minor)
clientMinor, _ := strconv.Atoi(clientVersion.CVersion.Minor)
if math.Abs(float64(clientMinor-serverMinor)) > 1 {
out.T(out.Tip, "{{.path}} is version {{.clientMinor}}, and is incompatible with your specified Kubernetes version. You will need to update {{.path}} or use 'minikube kubectl' to connect with this cluster",
out.V{"path": path, "clientMinor": clientMinor})
}
}
@ -764,7 +820,7 @@ func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string, driver string)
repository = autoSelectedRepository
}
if repository != "" {
if cmd.Flags().Changed(imageRepository) {
out.T(out.SuccessType, "Using image repository {{.name}}", out.V{"name": repository})
}
@ -905,7 +961,7 @@ func startHost(api libmachine.API, mc cfg.MachineConfig) (*host.Host, bool) {
}
// validateNetwork tries to catch network problems as soon as possible
func validateNetwork(h *host.Host) string {
func validateNetwork(h *host.Host, r command.Runner) string {
ip, err := h.Driver.GetIP()
if err != nil {
exit.WithError("Unable to get VM IP address", err)
@ -929,19 +985,52 @@ func validateNetwork(h *host.Host) string {
}
}
// Here is where we should be checking connectivity to/from the VM
return ip
}
// none driver does not need ssh access
if h.Driver.DriverName() != constants.DriverNone {
sshAddr := fmt.Sprintf("%s:22", ip)
conn, err := net.Dial("tcp", sshAddr)
if err != nil {
exit.WithCodeT(exit.IO, `minikube is unable to connect to the VM: {{.error}}
// getMinikubeVersion ensures that the driver binary is up to date
func getMinikubeVersion(driver string) string {
v, err := version.GetSemverVersion()
if err != nil {
out.WarningT("Error parsing minikube version: {{.error}}", out.V{"error": err})
} else if err := drivers.InstallOrUpdate(driver, localpath.MakeMiniPath("bin"), v, viper.GetBool(interactive)); err != nil {
out.WarningT("Unable to update {{.driver}} driver: {{.error}}", out.V{"driver": driver, "error": err})
This is likely due to one of two reasons:
- VPN or firewall interference
- {{.hypervisor}} network configuration issue
Suggested workarounds:
- Disable your local VPN or firewall software
- Configure your local VPN or firewall to allow access to {{.ip}}
- Restart or reinstall {{.hypervisor}}
- Use an alternative --vm-driver`, out.V{"error": err, "hypervisor": h.Driver.DriverName(), "ip": ip})
}
defer conn.Close()
}
return v.String()
if err := r.Run("nslookup kubernetes.io"); err != nil {
out.WarningT("VM is unable to resolve DNS hosts: {[.error}}", out.V{"error": err})
}
// Try both UDP and ICMP to assert basic external connectivity
if err := r.Run("nslookup k8s.io 8.8.8.8 || nslookup k8s.io 1.1.1.1 || ping -c1 8.8.8.8"); err != nil {
out.WarningT("VM is unable to directly connect to the internet: {{.error}}", out.V{"error": err})
}
// Try an HTTPS connection to the
proxy := os.Getenv("HTTPS_PROXY")
opts := "-sS"
if proxy != "" && !strings.HasPrefix(proxy, "localhost") && !strings.HasPrefix(proxy, "127.0") {
opts = fmt.Sprintf("-x %s %s", proxy, opts)
}
repo := viper.GetString(imageRepository)
if repo == "" {
repo = images.DefaultImageRepo
}
if err := r.Run(fmt.Sprintf("curl %s https://%s/", opts, repo)); err != nil {
out.WarningT("VM is unable to connect to the selected image repository: {{.error}}", out.V{"error": err})
}
return ip
}
// getKubernetesVersion ensures that the requested version is reasonable

View File

@ -44,7 +44,7 @@ var updateContextCmd = &cobra.Command{
if err != nil {
exit.WithError("Error host driver ip status", err)
}
updated, err := kubeconfig.UpdateIP(ip, constants.KubeconfigPath, machineName)
updated, err := kubeconfig.UpdateIP(ip, machineName, constants.KubeconfigPath)
if err != nil {
exit.WithError("update config", err)
}

View File

@ -0,0 +1,49 @@
/*
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.
*/
package cmd
import (
"errors"
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "mkcmp [path to first binary] [path to second binary]",
Short: "mkcmp is used to compare performance of two minikube binaries",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return validateArgs(args)
},
Run: func(cmd *cobra.Command, args []string) {},
}
func validateArgs(args []string) error {
if len(args) != 2 {
return errors.New("mkcmp requires two minikube binaries to compare: mkcmp [path to first binary] [path to second binary]")
}
return nil
}
// Execute runs the mkcmp command
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}

23
cmd/performance/main.go Normal file
View File

@ -0,0 +1,23 @@
/*
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.
*/
package main
import "k8s.io/minikube/cmd/performance/cmd"
func main() {
cmd.Execute()
}

View File

@ -1,51 +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.
---
apiVersion: v1
data:
map-hash-bucket-size: "128"
hsts: "false"
kind: ConfigMap
metadata:
name: minikube-ingress-dns-nginx-load-balancer-conf
namespace: kube-system
labels:
app: minikube-ingress-dns
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
---
apiVersion: v1
kind: ConfigMap
metadata:
name: minikube-ingress-dns-tcp-services
namespace: kube-system
labels:
app: minikube-ingress-dns
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
data:
53: "kube-system/kube-ingress-dns-minikube:5353"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: minikube-ingress-dns-udp-services
namespace: kube-system
labels:
app: minikube-ingress-dns
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
data:
53: "kube-system/kube-ingress-dns-minikube:5353"

View File

@ -1,229 +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.
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: minikube-ingress-dns-nginx-ingress
namespace: kube-system
labels:
kubernetes.io/bootstrapping: rbac-defaults
app: minikube-ingress-dns-nginx-ingress-controller
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: Reconcile
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: system:minikube-ingress-dns-nginx-ingress
labels:
kubernetes.io/bootstrapping: rbac-defaults
app: minikube-ingress-dns-nginx-ingress-controller
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- nodes
- pods
- secrets
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- apiGroups:
- "extensions"
- "networking.k8s.io"
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- "extensions"
- "networking.k8s.io"
resources:
- ingresses/status
verbs:
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: system::minikube-ingress-dns-nginx-ingress-role
namespace: kube-system
labels:
kubernetes.io/bootstrapping: rbac-defaults
app: minikube-ingress-dns-nginx-ingress-controller
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- configmaps
- pods
- secrets
- namespaces
verbs:
- get
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
# Defaults to "<election-id>-<ingress-class>"
# Here: "<ingress-controller-leader>-<nginx>"
# This has to be adapted if you change either parameter
# when launching the nginx-ingress-controller.
- ingress-controller-leader-nginx
verbs:
- get
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: system::minikube-ingress-dns-nginx-ingress-role-binding
namespace: kube-system
labels:
kubernetes.io/bootstrapping: rbac-defaults
app: minikube-ingress-dns-nginx-ingress-controller
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: system::minikube-ingress-dns-nginx-ingress-role
subjects:
- kind: ServiceAccount
name: minikube-ingress-dns-nginx-ingress
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: system:minikube-ingress-dns-nginx-ingress
labels:
kubernetes.io/bootstrapping: rbac-defaults
app: minikube-ingress-dns-nginx-ingress-controller
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:minikube-ingress-dns-nginx-ingress
subjects:
- kind: ServiceAccount
name: minikube-ingress-dns-nginx-ingress
namespace: kube-system
---
apiVersion: v1
kind: Pod
metadata:
name: minikube-ingress-dns-nginx-ingress-controller
namespace: kube-system
labels:
app: minikube-ingress-dns-nginx-ingress-controller
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
spec:
serviceAccountName: minikube-ingress-dns-nginx-ingress
terminationGracePeriodSeconds: 60
hostNetwork: true
containers:
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller{{.ExoticArch}}:0.26.1
name: nginx-ingress-controller
imagePullPolicy: IfNotPresent
readinessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 1
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: 53
hostPort: 53
- containerPort: 8008
- containerPort: 4333
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/minikube-ingress-dns-nginx-load-balancer-conf
- --tcp-services-configmap=$(POD_NAMESPACE)/minikube-ingress-dns-tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/minikube-ingress-dns-udp-services
- --annotations-prefix=nginx.ingress.kubernetes.io
- --http-port=8008
- --https-port=4333
# use minikube IP address in ingress status field
- --report-node-internal-ip-address
securityContext:
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
# www-data -> 33
runAsUser: 33

View File

@ -35,16 +35,6 @@ metadata:
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- patch
resourceNames:
- tcp-services
- udp-services
- apiGroups:
- ""
- "extensions"
@ -65,11 +55,11 @@ metadata:
app: minikube-ingress-dns
kubernetes.io/bootstrapping: rbac-defaults
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
addonmanager.kubernetes.io/mode: Reconcile
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
name: minikube-ingress-dns
subjects:
- kind: ServiceAccount
name: minikube-ingress-dns
@ -83,20 +73,21 @@ metadata:
labels:
app: minikube-ingress-dns
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
addonmanager.kubernetes.io/mode: Reconcile
spec:
serviceAccountName: minikube-ingress-dns
hostNetwork: true
containers:
- name: minikube-ingress-dns
image: "cryptexlabs/minikube-ingress-dns:0.1.1"
image: "cryptexlabs/minikube-ingress-dns:0.2.0"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5353
hostPort: 5353
protocol: TCP
- containerPort: 5353
hostPort: 5353
- containerPort: 53
protocol: UDP
env:
- name: DNS_PORT
value: "5353"
value: "53"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP

View File

@ -1,37 +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.
---
apiVersion: v1
kind: Service
metadata:
name: kube-ingress-dns-minikube
namespace: kube-system
labels:
app: minikube-ingress-dns
app.kubernetes.io/part-of: kube-system
addonmanager.kubernetes.io/mode: EnsureExists
spec:
selector:
app: minikube-ingress-dns
clusterIP: None
ports:
- name: tcp-port
port: 5353
targetPort: 5353
protocol: TCP
- name: udp-port
port: 5353
targetPort: 5353
protocol: UDP

View File

@ -1,27 +1,24 @@
apiVersion: v1
kind: ReplicationController
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry-creds
namespace: kube-system
labels:
version: v1.9
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons: registry-creds
spec:
replicas: 1
selector:
name: registry-creds
version: v1.9
addonmanager.kubernetes.io/mode: Reconcile
matchLabels:
name: registry-creds
template:
metadata:
labels:
name: registry-creds
version: v1.9
addonmanager.kubernetes.io/mode: Reconcile
spec:
containers:
- image: registry.hub.docker.com/upmcenterprises/registry-creds:1.9
- image: upmcenterprises/registry-creds:1.9
name: registry-creds
imagePullPolicy: Always
env:

View File

@ -2,4 +2,4 @@ default 1
label 1
kernel /boot/bzImage
initrd /boot/initrd
append root=/dev/sr0 loglevel=3 console=ttyS0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes
append root=/dev/sr0 loglevel=3 console=ttyS0 noembed nomodeset norestore waitusb=10 random.trust_cpu=on hw_rng_model=virtio systemd.legacy_systemd_cgroup_controller=yes

View File

@ -8,11 +8,11 @@ machine=$(uname -m)
case ${machine} in
aarch64 )
TOOLBOX_DOCKER_IMAGE=arm64v8/fedora
TOOLBOX_DOCKER_TAG=29
TOOLBOX_DOCKER_TAG=latest
;;
x86_64 )
TOOLBOX_DOCKER_IMAGE=fedora
TOOLBOX_DOCKER_TAG=29
TOOLBOX_DOCKER_TAG=latest
;;
* )
echo "Warning: Unknown machine type ${machine}" >&2
@ -69,10 +69,9 @@ if [ "x${1-}" == x-c ]; then
set /bin/sh "$@"
fi
sudo systemd-nspawn \
sudo SYSTEMD_NSPAWN_SHARE_SYSTEM=1 systemd-nspawn \
--directory="${machinepath}" \
--capability=all \
--share-system \
${TOOLBOX_BIND} \
${TOOLBOX_ENV} \
--user="${TOOLBOX_USER}" "$@"

View File

@ -3,7 +3,7 @@ BR2_CCACHE=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_BUILDROOT_VENDOR="minikube"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_15=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_BINUTILS_VERSION_2_30_X=y
BR2_GCC_VERSION_7_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
@ -18,8 +18,6 @@ BR2_SYSTEM_BIN_SH_BASH=y
BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/users"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/rootfs-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/linux_defconfig"
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y

View File

@ -11,6 +11,7 @@ CONTAINERD_BIN_DEPENDENCIES = host-go libgpgme
CONTAINERD_BIN_GOPATH = $(@D)/_output
CONTAINERD_BIN_ENV = \
CGO_ENABLED=1 \
GO111MODULE=off \
GOPATH="$(CONTAINERD_BIN_GOPATH)" \
GOBIN="$(CONTAINERD_BIN_GOPATH)/bin" \
PATH=$(CONTAINERD_BIN_GOPATH)/bin:$(BR_PATH)

View File

@ -27,6 +27,10 @@ define DOCKER_BIN_INSTALL_TARGET_CMDS
$(@D)/dockerd \
$(TARGET_DIR)/bin/dockerd
$(INSTALL) -D -m 0755 \
$(@D)/docker-init \
$(TARGET_DIR)/bin/docker-init
$(INSTALL) -D -m 0755 \
$(@D)/docker-proxy \
$(TARGET_DIR)/bin/docker-proxy

View File

@ -5,7 +5,10 @@
################################################################################
GLUSTER_VERSION = 4.1.5
GLUSTER_SITE = https://download.gluster.org/pub/gluster/glusterfs/4.1/$(GLUSTER_VERSION)
# Official gluster site has SSL problems
# https://bugzilla.redhat.com/show_bug.cgi?id=1572944
# GLUSTER_SITE = https://download.gluster.org/pub/gluster/glusterfs/4.1/$(GLUSTER_VERSION)
GLUSTER_SITE = http://download.openpkg.org/components/cache/glusterfs
GLUSTER_SOURCE = glusterfs-$(GLUSTER_VERSION).tar.gz
GLUSTER_CONF_OPTS = --disable-tiering --disable-ec-dynamic --disable-xmltest --disable-crypt-xlator --disable-georeplication --disable-ibverbs --disable-glupy --disable-gnfs --disable-cmocka --without-server
GLUSTER_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install

View File

@ -4,8 +4,8 @@
#
################################################################################
HYPERV_DAEMONS_VERSION = 4.15.1
HYPERV_DAEMONS_SITE = https://www.kernel.org/pub/linux/kernel/v${HYPERV_DAEMONS_VERSION%%.*}.x
HYPERV_DAEMONS_VERSION = 4.19.76
HYPERV_DAEMONS_SITE = https://www.kernel.org/pub/linux/kernel/v4.x
HYPERV_DAEMONS_SOURCE = linux-$(HYPERV_DAEMONS_VERSION).tar.xz
define HYPERV_DAEMONS_BUILD_CMDS

View File

@ -1,3 +1,6 @@
# From http://download.virtualbox.org/virtualbox/5.1.30/SHA256SUMS
sha256 96cab2296fb014ce0a16b7b9603b52208b9403c10c1524b44201d3c274e8a821 VirtualBox-5.1.38.tar.bz2
sha256 0e7ee2c78ebf7cd0d3a933d51148bef04a64f64fb27ccf70d59cddf9ca1e517a VBoxGuestAdditions_5.1.38.iso
# From http://download.virtualbox.org/virtualbox/5.2.32/SHA256SUMS
sha256 ff6390e50cb03718cd3f5779627910999c12279b465e340c80d7175778a33958 VirtualBox-5.2.32.tar.bz2
sha256 4311c7408a3410e6a33264a9062347d9eec04f58339a49f0a60488c0cabc8996 VBoxGuestAdditions_5.2.32.iso

View File

@ -4,7 +4,7 @@
#
################################################################################
VBOX_GUEST_VERSION = 5.1.38
VBOX_GUEST_VERSION = 5.2.32
VBOX_GUEST_SITE = http://download.virtualbox.org/virtualbox/$(VBOX_GUEST_VERSION)
VBOX_GUEST_LICENSE = GPLv2
VBOX_GUEST_LICENSE_FILES = COPYING
@ -12,7 +12,7 @@ VBOX_GUEST_SOURCE = VirtualBox-$(VBOX_GUEST_VERSION).tar.bz2
VBOX_GUEST_EXTRA_DOWNLOADS = http://download.virtualbox.org/virtualbox/${VBOX_GUEST_VERSION}/VBoxGuestAdditions_${VBOX_GUEST_VERSION}.iso
define VBOX_GUEST_EXPORT_MODULES
( cd $(@D)/src/VBox/Additions/linux; ./export_modules modules.tar.gz )
( cd $(@D)/src/VBox/Additions/linux; ./export_modules.sh modules.tar.gz )
mkdir -p $(@D)/vbox-modules
tar -C $(@D)/vbox-modules -xzf $(@D)/src/VBox/Additions/linux/modules.tar.gz
endef
@ -20,7 +20,7 @@ endef
VBOX_GUEST_POST_EXTRACT_HOOKS += VBOX_GUEST_EXPORT_MODULES
VBOX_GUEST_MODULE_SUBDIRS = vbox-modules/
VBOX_GUEST_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)
VBOX_GUEST_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED) KERN_DIR=$(LINUX_DIR)
define VBOX_GUEST_USERS
- -1 vboxsf -1 - - - - -

4
go.mod
View File

@ -25,7 +25,6 @@ require (
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/google/go-cmp v0.3.0
github.com/google/go-github/v25 v25.0.2
github.com/gorilla/mux v1.7.1 // indirect
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/go-getter v1.3.0
@ -51,6 +50,7 @@ require (
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
github.com/otiai10/copy v1.0.2
github.com/pborman/uuid v1.2.0
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pkg/browser v0.0.0-20160118053552-9302be274faa
@ -70,13 +70,13 @@ require (
github.com/zchee/go-vmnet v0.0.0-20161021174912-97ebf9174097
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d
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-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
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gotest.tools v2.2.0+incompatible
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
k8s.io/client-go v0.0.0

8
go.sum
View File

@ -195,8 +195,6 @@ github.com/google/go-containerregistry v0.0.0-20180731221751-697ee0b3d46e h1:Hm0
github.com/google/go-containerregistry v0.0.0-20180731221751-697ee0b3d46e/go.mod h1:yZAFP63pRshzrEYLXLGPmUt0Ay+2zdjmMN1loCnRLUk=
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v25 v25.0.2 h1:MqXE7nOlIF91NJ/PXAcvS2dC+XXCDbY7RvJzjyEPAoU=
github.com/google/go-github/v25 v25.0.2/go.mod h1:6z5pC69qHtrPJ0sXPsj4BLnd82b+r6sLB7qcBoRZqpw=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
@ -385,6 +383,11 @@ github.com/opencontainers/runc v0.0.0-20181113202123-f000fe11ece1/go.mod h1:qT5X
github.com/opencontainers/runtime-spec v1.0.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v0.0.0-20170621221121-4a2974bf1ee9/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/otiai10/copy v1.0.2 h1:DDNipYy6RkIkjMwy+AWzgKiNTyj2RUI9yEMeETEpVyc=
github.com/otiai10/copy v1.0.2/go.mod h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
github.com/otiai10/mint v1.3.0 h1:Ady6MKVezQwHBkGzLFbrsywyp09Ah7rkmfjV3Bcr5uc=
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@ -560,7 +563,6 @@ golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5Tlb
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

1
hack/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
release-notes

View File

@ -37,10 +37,26 @@ echo "job: ${JOB_NAME}"
echo "test home: ${TEST_HOME}"
echo "sudo: ${SUDO_PREFIX}"
echo "kernel: $(uname -v)"
echo "uptime: $(uptime)"
# Setting KUBECONFIG prevents the version ceck from erroring out due to permission issues
echo "kubectl: $(env KUBECONFIG=${TEST_HOME} kubectl version --client --short=true)"
echo "docker: $(docker version --format '{{ .Client.Version }}')"
readonly LOAD=$(uptime | egrep -o "load average.*: [0-9]" | cut -d" " -f3)
if [[ "${LOAD}" -gt 2 ]]; then
echo ""
echo "********************** LOAD WARNING ********************************"
echo "Load average is very high (${LOAD}), which may cause failures. Top:"
if [[ "$(uname)" == "Darwin" ]]; then
# Two samples, macOS does not calculate CPU usage on the first one
top -l 2 -o cpu -n 5 | tail -n 15
else
top -b -n1 | head -n 15
fi
echo "********************** LOAD WARNING ********************************"
echo ""
fi
case "${VM_DRIVER}" in
kvm2)
echo "virsh: $(virsh --version)"
@ -82,6 +98,7 @@ gsutil -qm cp "gs://minikube-builds/${MINIKUBE_LOCATION}/gvisor-addon" testdata/
export MINIKUBE_BIN="out/minikube-${OS_ARCH}"
export E2E_BIN="out/e2e-${OS_ARCH}"
chmod +x "${MINIKUBE_BIN}" "${E2E_BIN}" out/docker-machine-driver-*
"${MINIKUBE_BIN}" version
procs=$(pgrep "minikube-${OS_ARCH}|e2e-${OS_ARCH}" || true)
if [[ "${procs}" != "" ]]; then
@ -98,27 +115,29 @@ mkdir -p "${TEST_ROOT}"
echo ""
echo ">> Cleaning up after previous test runs ..."
for entry in $(ls ${TEST_ROOT}); do
echo "* Cleaning stale test path: ${entry}"
for tunnel in $(find ${entry} -name tunnels.json -type f); do
test_path="${TEST_ROOT}/${entry}"
ls -lad "${test_path}" || continue
echo "* Cleaning stale test path: ${test_path}"
for tunnel in $(find ${test_path} -name tunnels.json -type f); do
env MINIKUBE_HOME="$(dirname ${tunnel})" ${MINIKUBE_BIN} tunnel --cleanup || true
done
for home in $(find ${entry} -name .minikube -type d); do
env MINIKUBE_HOME="$(dirname ${home})" ${MINIKUBE_BIN} delete || true
for home in $(find ${test_path} -name .minikube -type d); do
env MINIKUBE_HOME="$(dirname ${home})" ${MINIKUBE_BIN} delete --all || true
sudo rm -Rf "${home}"
done
for kconfig in $(find ${entry} -name kubeconfig -type f); do
for kconfig in $(find ${test_path} -name kubeconfig -type f); do
sudo rm -f "${kconfig}"
done
# Be very specific to avoid accidentally deleting other items, like wildcards or devices
if [[ -d "${entry}" ]]; then
rm -Rf "${entry}" || true
elif [[ -f "${entry}" ]]; then
rm -f "${entry}" || true
if [[ -d "${test_path}" ]]; then
rm -Rf "${test_path}" || true
elif [[ -f "${test_path}" ]]; then
rm -f "${test_path}" || true
fi
done
# sometimes tests left over zombie procs that won't exit
@ -140,19 +159,21 @@ if type -P virsh; then
fi
if type -P vboxmanage; then
for guid in $(vboxmanage list vms | egrep -Eo '\{[-a-Z0-9]+\}'); do
for guid in $(vboxmanage list vms | grep -Eo '\{[a-zA-Z0-9-]+\}'); do
echo "- Removing stale VirtualBox VM: $guid"
vboxmanage startvm $guid --type emergencystop || true
vboxmanage unregistervm $guid || true
vboxmanage startvm "${guid}" --type emergencystop || true
vboxmanage unregistervm "${guid}" || true
done
vboxmanage list hostonlyifs \
| grep "^Name:" \
| awk '{ print $2 }' \
| xargs -n1 vboxmanage hostonlyif remove || true
ifaces=$(vboxmanage list hostonlyifs | grep -E "^Name:" | awk '{ printf $2 }')
for if in $ifaces; do
vboxmanage hostonlyif remove "${if}" || true
done
echo ">> VirtualBox VM list after clean up (should be empty):"
vboxmanage list vms || true
echo ">> VirtualBox interface list after clean up (should be empty):"
vboxmanage list hostonlyifs || true
fi

View File

@ -41,6 +41,8 @@ docker kill $(docker ps -q) || true
docker rm $(docker ps -aq) || true
make -j 16 all && failed=$? || failed=$?
"out/minikube-$(go env GOOS)-$(go env GOARCH)" version
gsutil cp "gs://${bucket}/logs/index.html" \
"gs://${bucket}/logs/${ghprbPullId}/index.html"
@ -58,9 +60,16 @@ if [[ "${rebuild}" -eq 1 ]]; then
make release-iso
fi
cp -r test/integration/testdata out/
# Don't upload the buildroot artifacts if they exist
rm -r out/buildroot || true
gsutil -m cp -r out/ "gs://${bucket}/${ghprbPullId}/"
# At this point, the out directory contains the jenkins scripts (populated by jenkins),
# testdata, and our build output. Push the changes to GCS so that worker nodes can re-use them.
# -d: delete remote files that don't exist (removed test files, for instance)
# -J: gzip compression
# -R: recursive. strangely, this is not the default for sync.
gsutil -m rsync -dJR out "gs://${bucket}/${ghprbPullId}"

View File

@ -18,7 +18,23 @@ set -eux -o pipefail
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
go run "${DIR}/release_notes/listpullreqs.go"
install_release_notes_helper() {
release_notes_workdir="$(mktemp -d)"
trap 'rm -rf -- ${release_notes_workdir}' RETURN
# See https://stackoverflow.com/questions/56842385/using-go-get-to-download-binaries-without-adding-them-to-go-mod for this workaround
cd "${release_notes_workdir}"
go mod init release-notes
GOBIN="$DIR" go get github.com/corneliusweig/release-notes
cd -
}
if ! [[ -x "${DIR}/release-notes" ]]; then
echo >&2 'Installing release-notes'
install_release_notes_helper
fi
"${DIR}/release-notes" kubernetes minikube
echo "Huge thank you for this release towards our contributors: "
git log "$(git describe --abbrev=0)".. --format="%aN" --reverse | sort | uniq | awk '{printf "- %s\n", $0 }'

View File

@ -1,109 +0,0 @@
/*
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.
*/
// listpullreqs.go lists pull requests since the last release.
package main
import (
"context"
"fmt"
"github.com/golang/glog"
"github.com/google/go-github/v25/github"
"github.com/spf13/cobra"
"golang.org/x/oauth2"
)
var (
token string
fromTag string
toTag string
)
var rootCmd = &cobra.Command{
Use: "listpullreqs fromTag toTag",
Short: "Lists pull requests between two versions in our changelog markdown format",
ArgAliases: []string{"fromTag", "toTag"},
Run: func(cmd *cobra.Command, args []string) {
printPullRequests()
},
}
const org = "kubernetes"
const repo = "minikube"
func main() {
rootCmd.Flags().StringVar(&token, "token", "", "Specify personal Github Token if you are hitting a rate limit anonymously. https://github.com/settings/tokens")
rootCmd.Flags().StringVar(&fromTag, "fromTag", "", "comparison of commits is based on this tag (defaults to the latest tag in the repo)")
rootCmd.Flags().StringVar(&toTag, "toTag", "master", "this is the commit that is compared with fromTag")
if err := rootCmd.Execute(); err != nil {
glog.Fatalf("Failed to execute: %v", err)
}
}
func printPullRequests() {
client := getClient()
releases, _, err := client.Repositories.ListReleases(context.Background(), org, repo, &github.ListOptions{})
if err != nil {
glog.Fatalf("Failed to list releases: %v", err)
}
lastReleaseTime := *releases[0].PublishedAt
fmt.Println(fmt.Sprintf("Collecting pull request that were merged since the last release: %s (%s)", *releases[0].TagName, lastReleaseTime))
listSize := 1
for page := 1; listSize > 0; page++ {
pullRequests, _, err := client.PullRequests.List(context.Background(), org, repo, &github.PullRequestListOptions{
State: "closed",
Sort: "updated",
Direction: "desc",
ListOptions: github.ListOptions{
PerPage: 100,
Page: page,
},
})
if err != nil {
glog.Fatalf("Failed to list pull requests: %v", err)
}
seen := 0
for idx := range pullRequests {
pr := pullRequests[idx]
if pr.MergedAt != nil {
if pr.GetMergedAt().After(lastReleaseTime.Time) {
fmt.Printf("* %s [#%d](https://github.com/%s/%s/pull/%d)\n", pr.GetTitle(), *pr.Number, org, repo, *pr.Number)
seen++
}
}
}
if seen == 0 {
break
}
listSize = len(pullRequests)
}
}
func getClient() *github.Client {
if len(token) == 0 {
return github.NewClient(nil)
}
ctx := context.Background()
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: token},
)
tc := oauth2.NewClient(ctx, ts)
return github.NewClient(tc)
}

View File

@ -2,7 +2,7 @@ Package: minikube
Version: --VERSION--
Section: base
Priority: optional
Architecture: amd64
Architecture: --ARCH--
Recommends: virtualbox
Maintainer: Thomas Strömberg <t+minikube@stromberg.org>
Description: Minikube

View File

@ -18,12 +18,12 @@ day-to-day.
%prep
mkdir -p %{name}-%{version}
cd %{name}-%{version}
cp --OUT--/minikube-linux-amd64 .
cp --OUT--/minikube-linux-%{_arch} minikube
%install
cd %{name}-%{version}
mkdir -p %{buildroot}%{_bindir}
install -m 755 minikube-linux-amd64 %{buildroot}%{_bindir}/%{name}
install -m 755 minikube %{buildroot}%{_bindir}/%{name}
%files
%{_bindir}/%{name}

View File

@ -149,14 +149,15 @@ func fixMachinePermissions(path string) error {
}
// InstallOrUpdate downloads driver if it is not present, or updates it if there's a newer version
func InstallOrUpdate(driver string, directory string, v semver.Version, interactive bool) error {
func InstallOrUpdate(driver string, directory string, v semver.Version, interactive bool, autoUpdate bool) error {
if driver != constants.DriverKvm2 && driver != constants.DriverHyperkit {
return nil
}
executable := fmt.Sprintf("docker-machine-driver-%s", driver)
exists := driverExists(executable)
path, err := validateDriver(executable, v)
if err != nil {
if !exists || (err != nil && autoUpdate) {
glog.Warningf("%s: %v", executable, err)
path = filepath.Join(directory, executable)
derr := download(executable, path, v)
@ -240,6 +241,11 @@ func validateDriver(driver string, v semver.Version) (string, error) {
return path, nil
}
func driverExists(driver string) bool {
_, err := exec.LookPath(driver)
return err == nil
}
func driverWithChecksumURL(driver string, v semver.Version) string {
base := fmt.Sprintf("https://github.com/kubernetes/minikube/releases/download/v%s/%s", v, driver)
return fmt.Sprintf("%s?checksum=file:%s.sha256", base, base)

View File

@ -46,7 +46,7 @@ var (
]`)
)
func Test_parseStatusAndReturnIp(t *testing.T) {
func TestParseStatusAndReturnIp(t *testing.T) {
type args struct {
mac string
statuses []byte

View File

@ -350,27 +350,9 @@ var Addons = map[string]*Addon{
}, false, "helm-tiller"),
"ingress-dns": NewAddon([]*BinAsset{
MustBinAsset(
"deploy/addons/ingress-dns/ingress-dns-configmap.yaml",
"deploy/addons/ingress-dns/ingress-dns-pod.yaml",
vmpath.GuestAddonsDir,
"ingress-dns-configmap.yaml",
"0640",
false),
MustBinAsset(
"deploy/addons/ingress-dns/ingress-dns-dns-server-pod.yaml",
vmpath.GuestAddonsDir,
"ingress-dns-dns-server-pod.yaml",
"0640",
false),
MustBinAsset(
"deploy/addons/ingress-dns/ingress-dns-nginx-pod.yaml.tmpl",
vmpath.GuestAddonsDir,
"ingress-dns-nginx-pod.yaml",
"0640",
true),
MustBinAsset(
"deploy/addons/ingress-dns/ingress-dns-svc.yaml",
vmpath.GuestAddonsDir,
"ingress-dns-svc.yaml",
"ingress-dns-pod.yaml",
"0640",
false),
}, false, "ingress-dns"),
@ -438,7 +420,7 @@ func GenerateTemplateData(cfg config.KubernetesConfig) interface{} {
// for less common architectures blank suffix for amd64
ea := ""
if runtime.GOARCH != "amd64" {
ea = runtime.GOARCH
ea = "-" + runtime.GOARCH
}
opts := struct {
Arch string

View File

@ -25,10 +25,17 @@ import (
minikubeVersion "k8s.io/minikube/pkg/version"
)
const (
// DefaultImageRepo is the default repository for images
DefaultImageRepo = "k8s.gcr.io"
// DefaultMinikubeRepo is the default repository for minikube
DefaultMinikubeRepo = "gcr.io/k8s-minikube"
)
// getImageRepositories returns either the k8s image registry on GCR or a mirror if specified
func getImageRepository(imageRepository string) string {
if imageRepository == "" {
imageRepository = "k8s.gcr.io"
imageRepository = DefaultImageRepo
}
if !strings.HasSuffix(imageRepository, "/") {
imageRepository += "/"
@ -41,7 +48,7 @@ func getImageRepository(imageRepository string) string {
func getMinikubeRepository(imageRepository string) string {
minikubeRepository := imageRepository
if minikubeRepository == "" {
minikubeRepository = "gcr.io/k8s-minikube"
minikubeRepository = DefaultMinikubeRepo
}
if !strings.HasSuffix(minikubeRepository, "/") {
minikubeRepository += "/"

View File

@ -177,7 +177,7 @@ func (k *Bootstrapper) GetAPIServerStatus(ip net.IP, apiserverPort int) (string,
// LogCommands returns a map of log type to a command which will display that log.
func (k *Bootstrapper) LogCommands(o bootstrapper.LogOptions) map[string]string {
var kubelet strings.Builder
kubelet.WriteString("journalctl -u kubelet")
kubelet.WriteString("sudo journalctl -u kubelet")
if o.Lines > 0 {
kubelet.WriteString(fmt.Sprintf(" -n %d", o.Lines))
}

View File

@ -66,7 +66,7 @@ Wants=crio.service
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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]
`,
@ -84,7 +84,7 @@ Wants=containerd.service
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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]
`,
@ -109,7 +109,7 @@ Wants=containerd.service
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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]
`,
@ -128,7 +128,7 @@ Wants=docker.socket
[Service]
ExecStart=
ExecStart=/var/lib/minikube/binaries/v1.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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.1 --pod-manifest-path=/etc/kubernetes/manifests
ExecStart=/var/lib/minikube/binaries/v1.16.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-dns=10.96.0.10 --cluster-domain=cluster.local --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.1 --pod-manifest-path=/etc/kubernetes/manifests
[Install]
`,

View File

@ -278,8 +278,10 @@ func DeleteHost(api libmachine.API) error {
// Get the status of the host. Ensure that it exists before proceeding ahead.
status, err := GetHostStatus(api)
if err != nil {
exit.WithCodeT(exit.Failure, "Unable to get the status of the cluster.")
// Warn, but proceed
out.WarningT("Unable to get the status of the {{.name}} cluster.", out.V{"name": cfg.GetMachineName()})
}
if status == state.None.String() {
return mcnerror.ErrHostDoesNotExist{Name: host.Name}
}
@ -289,6 +291,7 @@ func DeleteHost(api libmachine.API) error {
if err := trySSHPowerOff(host); err != nil {
glog.Infof("Unable to power off minikube because the host was not found.")
}
out.T(out.DeletingHost, "Successfully powered off Hyper-V. minikube driver -- {{.driver}}", out.V{"driver": host.Driver.DriverName()})
}
out.T(out.DeletingHost, `Deleting "{{.profile_name}}" in {{.driver_name}} ...`, out.V{"profile_name": cfg.GetMachineName(), "driver_name": host.DriverName})
@ -602,14 +605,15 @@ func CreateSSHShell(api libmachine.API, args []string) error {
return client.Shell(args...)
}
// EnsureMinikubeRunningOrExit checks that minikube has a status available and that
// the status is `Running`, otherwise it will exit
func EnsureMinikubeRunningOrExit(api libmachine.API, exitStatus int) {
// IsMinikubeRunning checks that minikube has a status available and that
// the status is `Running`
func IsMinikubeRunning(api libmachine.API) bool {
s, err := GetHostStatus(api)
if err != nil {
exit.WithError("Error getting machine status", err)
return false
}
if s != state.Running.String() {
exit.WithCodeT(exit.Unavailable, "minikube is not running, so the service cannot be accessed")
return false
}
return true
}

View File

@ -0,0 +1,128 @@
/*
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 cluster
import (
"io/ioutil"
"path/filepath"
"github.com/docker/machine/libmachine/host"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/machine"
)
// Machine contains information about a machine
type Machine struct {
*host.Host
}
// IsValid checks if the machine has the essential info needed for a machine
func (h *Machine) IsValid() bool {
if h == nil {
return false
}
if h.Host == nil {
return false
}
if h.Host.Name == "" {
return false
}
if h.Host.Driver == nil {
return false
}
if h.Host.HostOptions == nil {
return false
}
if h.Host.RawDriver == nil {
return false
}
return true
}
// ListMachines return all valid and invalid machines
// If a machine is valid or invalid is determined by the cluster.IsValid function
func ListMachines(miniHome ...string) (validMachines []*Machine, inValidMachines []*Machine, err error) {
pDirs, err := machineDirs(miniHome...)
if err != nil {
return nil, nil, err
}
for _, n := range pDirs {
p, err := LoadMachine(n)
if err != nil {
inValidMachines = append(inValidMachines, p)
continue
}
if !p.IsValid() {
inValidMachines = append(inValidMachines, p)
continue
}
validMachines = append(validMachines, p)
}
return validMachines, inValidMachines, nil
}
// LoadMachine loads a machine or throws an error if the machine could not be loadedG
func LoadMachine(name string) (*Machine, error) {
api, err := machine.NewAPIClient()
if err != nil {
return nil, err
}
h, err := CheckIfHostExistsAndLoad(api, name)
if err != nil {
return nil, err
}
var mm Machine
if h != nil {
mm.Host = h
} else {
return nil, errors.New("host is nil")
}
return &mm, nil
}
func machineDirs(miniHome ...string) (dirs []string, err error) {
miniPath := localpath.MiniPath()
if len(miniHome) > 0 {
miniPath = miniHome[0]
}
mRootDir := filepath.Join(miniPath, "machines")
items, err := ioutil.ReadDir(mRootDir)
for _, f := range items {
if f.IsDir() {
dirs = append(dirs, f.Name())
}
}
return dirs, err
}
// MachinePath returns the Minikube machine path of a machine
func MachinePath(machine string, miniHome ...string) string {
miniPath := localpath.MiniPath()
if len(miniHome) > 0 {
miniPath = miniHome[0]
}
return filepath.Join(miniPath, "machines", machine)
}

View File

@ -0,0 +1,75 @@
/*
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 cluster
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/localpath"
)
func TestListMachines(t *testing.T) {
const (
numberOfValidMachines = 2
numberOfInValidMachines = 3
totalNumberOfMachines = numberOfValidMachines + numberOfInValidMachines
)
viper.Set(config.MachineProfile, "")
testMinikubeDir := "./testdata/list-machines/.minikube"
miniDir, err := filepath.Abs(testMinikubeDir)
if err != nil {
t.Errorf("error getting dir path for %s : %v", testMinikubeDir, err)
}
err = os.Setenv(localpath.MinikubeHome, miniDir)
if err != nil {
t.Errorf("error setting up test environment. could not set %s", localpath.MinikubeHome)
}
files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
numberOfMachineDirs := len(files)
validMachines, inValidMachines, err := ListMachines()
if err != nil {
t.Error(err)
}
if numberOfValidMachines != len(validMachines) {
t.Errorf("expected %d valid machines, got %d", numberOfValidMachines, len(validMachines))
}
if numberOfInValidMachines != len(inValidMachines) {
t.Errorf("expected %d invalid machines, got %d", numberOfInValidMachines, len(inValidMachines))
}
if totalNumberOfMachines != len(validMachines)+len(inValidMachines) {
t.Errorf("expected %d total machines, got %d", totalNumberOfMachines, len(validMachines)+len(inValidMachines))
}
if numberOfMachineDirs != len(validMachines)+len(inValidMachines) {
t.Error("expected number of machine directories to be equal to the number of total machines")
}
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.50",
"MachineName": "p1",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p1/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p1",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "5e6787b6-aecb-11e9-81cf-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p1/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p1/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "virtualbox",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p1"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.50",
"MachineName": "p2",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p2/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p2",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "5e6787b6-aecb-11e9-81cf-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p2/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p2/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "virtualbox",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p2"
}

View File

@ -0,0 +1 @@
invalid json file :)

View File

@ -0,0 +1,72 @@
{
"ConfigVersion": 3,
"Driver": {
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p5_partial_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p5_partial_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "4f16872c-aee8-11e9-8815-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p5_partial_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p5_partial_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
}

View File

@ -174,7 +174,7 @@ func TestWriteConfig(t *testing.T) {
}
}
func Test_encode(t *testing.T) {
func TestEncode(t *testing.T) {
var b bytes.Buffer
for _, tt := range configTestCases {
err := encode(&b, tt.config)

View File

@ -21,14 +21,20 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/golang/glog"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/util/lock"
)
// isValid checks if the profile has the essential info needed for a profile
func (p *Profile) isValid() bool {
var keywords = []string{"start", "stop", "status", "delete", "config", "open", "profile", "addons", "cache", "logs"}
// IsValid checks if the profile has the essential info needed for a profile
func (p *Profile) IsValid() bool {
if p.Config == nil {
return false
}
if p.Config.MachineConfig.VMDriver == "" {
return false
}
@ -38,6 +44,16 @@ func (p *Profile) isValid() bool {
return true
}
// check if the profile is an internal keywords
func ProfileNameInReservedKeywords(name string) bool {
for _, v := range keywords {
if strings.EqualFold(v, name) {
return true
}
}
return false
}
// ProfileExists returns true if there is a profile config (regardless of being valid)
func ProfileExists(name string, miniHome ...string) bool {
miniPath := localpath.MiniPath()
@ -106,7 +122,7 @@ func DeleteProfile(profile string, miniHome ...string) error {
if len(miniHome) > 0 {
miniPath = miniHome[0]
}
return os.RemoveAll(profileFolderPath(profile, miniPath))
return os.RemoveAll(ProfileFolderPath(profile, miniPath))
}
// ListProfiles returns all valid and invalid (if any) minikube profiles
@ -118,12 +134,12 @@ func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile,
return nil, nil, err
}
for _, n := range pDirs {
p, err := loadProfile(n, miniHome...)
p, err := LoadProfile(n, miniHome...)
if err != nil {
inValidPs = append(inValidPs, p)
continue
}
if !p.isValid() {
if !p.IsValid() {
inValidPs = append(inValidPs, p)
continue
}
@ -132,8 +148,8 @@ func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile,
return validPs, inValidPs, nil
}
// loadProfile loads type Profile based on its name
func loadProfile(name string, miniHome ...string) (*Profile, error) {
// LoadProfile loads type Profile based on its name
func LoadProfile(name string, miniHome ...string) (*Profile, error) {
cfg, err := DefaultLoader.LoadConfigFromFile(name, miniHome...)
p := &Profile{
Name: name,
@ -168,8 +184,8 @@ func profileFilePath(profile string, miniHome ...string) string {
return filepath.Join(miniPath, "profiles", profile, "config.json")
}
// profileFolderPath returns path of profile folder
func profileFolderPath(profile string, miniHome ...string) string {
// ProfileFolderPath returns path of profile folder
func ProfileFolderPath(profile string, miniHome ...string) string {
miniPath := localpath.MiniPath()
if len(miniHome) > 0 {
miniPath = miniHome[0]

View File

@ -23,7 +23,7 @@ import (
// TestListProfiles uses a different uses different MINIKUBE_HOME with rest of tests since it relies on file list index
func TestListProfiles(t *testing.T) {
miniDir, err := filepath.Abs("./testdata/.minikube")
miniDir, err := filepath.Abs("./testdata/profile/.minikube")
if err != nil {
t.Errorf("error getting dir path for ./testdata/.minikube : %v", err)
}
@ -72,6 +72,32 @@ func TestListProfiles(t *testing.T) {
}
}
func TestProfileNameInReservedKeywords(t *testing.T) {
var testCases = []struct {
name string
expected bool
}{
{"start", true},
{"stop", true},
{"status", true},
{"delete", true},
{"config", true},
{"open", true},
{"profile", true},
{"addons", true},
{"cache", true},
{"logs", true},
{"myprofile", false},
{"log", false},
}
for _, tt := range testCases {
got := ProfileNameInReservedKeywords(tt.name)
if got != tt.expected {
t.Errorf("expected ProfileNameInReservedKeywords(%s)=%t but got %t ", tt.name, tt.expected, got)
}
}
}
func TestProfileExists(t *testing.T) {
miniDir, err := filepath.Abs("./testdata/.minikube2")
if err != nil {

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.50",
"MachineName": "p1",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p1/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p1",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "5e6787b6-aecb-11e9-81cf-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p1/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p1/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p1"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.52",
"MachineName": "p2_empty_profile_config",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p2_empty_profile_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p2_empty_profile_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "ddd37c1c-aedf-11e9-afa7-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p2_empty_profile_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p2_empty_profile_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p2_empty_profile_config"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.53",
"MachineName": "p3_invalid_profile_config",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p3_invalid_profile_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p3_invalid_profile_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "759044c8-aee4-11e9-bd0a-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p3_invalid_profile_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p3_invalid_profile_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p3_invalid_profile_config"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.54",
"MachineName": "p4_partial_profile_config",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p4_partial_profile_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p4_partial_profile_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "faf8face-aee4-11e9-9ba1-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p4_partial_profile_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p4_partial_profile_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p4_partial_profile_config"
}

View File

@ -0,0 +1 @@
invalid json file :)

View File

@ -0,0 +1,72 @@
{
"ConfigVersion": 3,
"Driver": {
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p8_partial_machine_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p8_partial_machine_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "4f16872c-aee8-11e9-8815-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p8_partial_machine_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p8_partial_machine_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.50",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.55",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.57",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.59",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.60",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.50",
"MachineName": "p1",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p1/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p1",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "5e6787b6-aecb-11e9-81cf-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p1/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p1/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p1"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.52",
"MachineName": "p2_empty_profile_config",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p2_empty_profile_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p2_empty_profile_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "ddd37c1c-aedf-11e9-afa7-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p2_empty_profile_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p2_empty_profile_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p2_empty_profile_config"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.53",
"MachineName": "p3_invalid_profile_config",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p3_invalid_profile_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p3_invalid_profile_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "759044c8-aee4-11e9-bd0a-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p3_invalid_profile_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p3_invalid_profile_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p3_invalid_profile_config"
}

View File

@ -0,0 +1,80 @@
{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "192.168.64.54",
"MachineName": "p4_partial_profile_config",
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p4_partial_profile_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"Boot2DockerURL": "file:///Users/someuser/.minikube/cache/iso/minikube-v1.2.0.iso",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p4_partial_profile_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "faf8face-aee4-11e9-9ba1-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p4_partial_profile_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p4_partial_profile_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"DriverName": "hyperkit",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/someuser/.minikube/machines/server.pem",
"ServerKeyPath": "/Users/someuser/.minikube/machines/server-key.pem",
"ClientKeyPath": "/Users/someuser/.minikube/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
"Name": "p4_partial_profile_config"
}

View File

@ -0,0 +1 @@
invalid json file :)

View File

@ -0,0 +1,72 @@
{
"ConfigVersion": 3,
"Driver": {
"SSHUser": "docker",
"SSHPort": 22,
"SSHKeyPath": "/Users/someuser/.minikube/machines/p8_partial_machine_config/id_rsa",
"StorePath": "/Users/someuser/.minikube",
"SwarmMaster": false,
"SwarmHost": "",
"SwarmDiscovery": "",
"DiskSize": 20000,
"CPU": 2,
"Memory": 2000,
"Cmdline": "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=p8_partial_machine_config",
"NFSShares": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "4f16872c-aee8-11e9-8815-8c8590c3b8b4",
"BootKernel": "/Users/someuser/.minikube/machines/p8_partial_machine_config/b2d-image/boot/bzImage",
"BootInitrd": "/Users/someuser/.minikube/machines/p8_partial_machine_config/b2d-image/boot/initrd",
"Initrd": "initrd",
"Vmlinuz": "bzImage"
},
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": null,
"Dns": null,
"GraphDir": "",
"Env": null,
"Ipv6": false,
"InsecureRegistry": [
"10.96.0.0/12"
],
"Labels": null,
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": false,
"RegistryMirror": null,
"InstallURL": ""
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Agent": false,
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": null,
"ArbitraryJoinFlags": null,
"Env": null,
"IsExperimental": false
},
"AuthOptions": {
"CertDir": "/Users/someuser/.minikube",
"CaCertPath": "/Users/someuser/.minikube/certs/ca.pem",
"CaPrivateKeyPath": "/Users/someuser/.minikube/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/someuser/.minikube/certs/cert.pem",
"ServerCertSANs": null,
"StorePath": "/Users/someuser/.minikube"
}
},
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.50",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1 @@
invalid json file :)

View File

@ -0,0 +1,47 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"XhyveDiskDriver": "ahci-hd",
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.55",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.57",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.59",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1,49 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"VMDriver": "hyperkit",
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"KubernetesVersion": "v1.15.0",
"NodeIP": "192.168.64.60",
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -0,0 +1 @@
invalid json file :)

View File

@ -0,0 +1,47 @@
{
"MachineConfig": {
"KeepContext": false,
"MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso",
"Memory": 2000,
"CPUs": 2,
"DiskSize": 20000,
"ContainerRuntime": "docker",
"HyperkitVpnKitSock": "",
"HyperkitVSockPorts": [],
"XhyveDiskDriver": "ahci-hd",
"DockerEnv": null,
"InsecureRegistry": null,
"RegistryMirror": null,
"HostOnlyCIDR": "192.168.99.1/24",
"HypervVirtualSwitch": "",
"KVMNetwork": "default",
"KVMQemuURI": "qemu:///system",
"KVMGPU": false,
"KVMHidden": false,
"DockerOpt": null,
"DisableDriverMounts": false,
"NFSShare": [],
"NFSSharesRoot": "/nfsshares",
"UUID": "",
"NoVTXCheck": false,
"DNSProxy": false,
"HostDNSResolver": true
},
"KubernetesConfig": {
"NodePort": 8443,
"NodeName": "minikube",
"APIServerName": "minikubeCA",
"APIServerNames": null,
"APIServerIPs": null,
"DNSDomain": "cluster.local",
"ContainerRuntime": "docker",
"CRISocket": "",
"NetworkPlugin": "",
"FeatureGates": "",
"ServiceCIDR": "10.96.0.0/12",
"ImageRepository": "",
"ExtraOptions": null,
"ShouldLoadCachedImages": true,
"EnableDefaultCNI": false
}
}

View File

@ -92,10 +92,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.16.0"
var DefaultKubernetesVersion = "v1.16.1"
// NewestKubernetesVersion is the newest Kubernetes version to test against
var NewestKubernetesVersion = "v1.16.0"
var NewestKubernetesVersion = "v1.16.1"
// OldestKubernetesVersion is the oldest Kubernetes version to test against
var OldestKubernetesVersion = "v1.11.10"

View File

@ -18,6 +18,7 @@ limitations under the License.
package constants
// DefaultMountDir is the default mounting directory for Darwin
var DefaultMountDir = "/Users"
// SupportedVMDrivers is a list of supported drivers on Darwin.

View File

@ -61,6 +61,6 @@ func createHyperkitHost(config cfg.MachineConfig) interface{} {
UUID: uuID,
VpnKitSock: config.HyperkitVpnKitSock,
VSockPorts: config.HyperkitVSockPorts,
Cmdline: "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=" + cfg.GetMachineName(),
Cmdline: "loglevel=3 console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes random.trust_cpu=on hw_rng_model=virtio base host=" + cfg.GetMachineName(),
}
}

View File

@ -28,7 +28,7 @@ import (
)
func init() {
registry.Register(registry.DriverDef{
_ = registry.Register(registry.DriverDef{
Name: constants.DriverHyperv,
Builtin: true,
ConfigCreator: createHypervHost,
@ -45,7 +45,7 @@ func createHypervHost(config cfg.MachineConfig) interface{} {
d.VSwitch = config.HypervVirtualSwitch
d.MemSize = config.Memory
d.CPU = config.CPUs
d.DiskSize = int(config.DiskSize)
d.DiskSize = config.DiskSize
d.SSHUser = "docker"
d.DisableDynamicMemory = true // default to disable dynamic memory as minikube is unlikely to work properly with dynamic memory

View File

@ -385,7 +385,7 @@ func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) {
// Ok now this is just a mess
if help, ok := kvp.Value.(*ast.BinaryExpr); ok {
s := checkBinaryExpression(help, e)
s := checkBinaryExpression(help)
if s != "" {
e.translations[s] = ""
}
@ -394,7 +394,7 @@ func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) {
}
// checkBinaryExpression checks binary expressions, stuff of the form x + y, for strings and concats them
func checkBinaryExpression(b *ast.BinaryExpr, e *state) string {
func checkBinaryExpression(b *ast.BinaryExpr) string {
// Check the left side
var s string
if l, ok := b.X.(*ast.BasicLit); ok {
@ -410,7 +410,7 @@ func checkBinaryExpression(b *ast.BinaryExpr, e *state) string {
}
if b1, ok := b.X.(*ast.BinaryExpr); ok {
if x := checkBinaryExpression(b1, e); x != "" {
if x := checkBinaryExpression(b1); x != "" {
s += x
}
}
@ -429,7 +429,7 @@ func checkBinaryExpression(b *ast.BinaryExpr, e *state) string {
}
if b1, ok := b.Y.(*ast.BinaryExpr); ok {
if x := checkBinaryExpression(b1, e); x != "" {
if x := checkBinaryExpression(b1); x != "" {
s += x
}
}

Some files were not shown because too many files have changed in this diff Show More