Merge branch 'master' into remove-heapster
commit
ccc2042861
14
Makefile
14
Makefile
|
@ -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)
|
||||
|
||||
|
@ -29,7 +29,7 @@ RPM_VERSION ?= $(DEB_VERSION)
|
|||
GO_VERSION ?= 1.12.9
|
||||
|
||||
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,17 +49,17 @@ 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,interfacer,misspell,nakedret,stylecheck,unconvert,unparam \
|
||||
--enable goimports,gocritic,golint,gocyclo,misspell,nakedret,stylecheck,unconvert,unparam \
|
||||
--exclude 'variable on range scope.*in function literal|ifElseChain'
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,11 @@ var addonsListCmd = &cobra.Command{
|
|||
}
|
||||
|
||||
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`)
|
||||
AddonsCmd.AddCommand(addonsListCmd)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -47,6 +47,12 @@ var ProfileCmd = &cobra.Command{
|
|||
profile := args[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) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/assets"
|
||||
|
@ -85,11 +86,13 @@ func TestSetBool(t *testing.T) {
|
|||
func TestIsAddonAlreadySet(t *testing.T) {
|
||||
testCases := []struct {
|
||||
addonName string
|
||||
expectErr string
|
||||
}{
|
||||
{
|
||||
addonName: "ingress",
|
||||
expectErr: "addon ingress was already ",
|
||||
},
|
||||
|
||||
{
|
||||
addonName: "registry",
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -97,13 +100,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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -42,6 +42,8 @@ import (
|
|||
"k8s.io/minikube/pkg/minikube/out"
|
||||
)
|
||||
|
||||
var deleteAll bool
|
||||
|
||||
// deleteCmd represents the delete command
|
||||
var deleteCmd = &cobra.Command{
|
||||
Use: "delete",
|
||||
|
@ -51,26 +53,121 @@ associated files.`,
|
|||
Run: runDelete,
|
||||
}
|
||||
|
||||
type typeOfError int
|
||||
|
||||
const (
|
||||
Fatal typeOfError = 0
|
||||
MissingProfile typeOfError = 1
|
||||
MissingCluster typeOfError = 2
|
||||
)
|
||||
|
||||
type DeletionError struct {
|
||||
Err error
|
||||
Errtype typeOfError
|
||||
}
|
||||
|
||||
func (error DeletionError) Error() string {
|
||||
return error.Err.Error()
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
if deleteAll {
|
||||
if profileFlag != constants.DefaultMachineName {
|
||||
exit.UsageT("usage: minikube delete --all")
|
||||
}
|
||||
|
||||
validProfiles, invalidProfiles, err := pkg_config.ListProfiles()
|
||||
profilesToDelete := append(validProfiles, invalidProfiles...)
|
||||
|
||||
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})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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 {
|
||||
|
@ -83,39 +180,111 @@ func runDelete(cmd *cobra.Command, args []string) {
|
|||
out.T(out.Meh, `"{{.name}}" cluster does not exist. Proceeding ahead with cleanup.`, out.V{"name": profile})
|
||||
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
|
||||
}
|
||||
|
||||
// Handles deletion error 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,3 +346,8 @@ func killMountProcess() error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
deleteCmd.Flags().BoolVar(&deleteAll, "all", false, "Set flag to delete all profiles")
|
||||
RootCmd.AddCommand(deleteCmd)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,493 @@
|
|||
/*
|
||||
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/spf13/viper"
|
||||
"k8s.io/minikube/pkg/minikube/cluster"
|
||||
"k8s.io/minikube/pkg/minikube/config"
|
||||
"k8s.io/minikube/pkg/minikube/localpath"
|
||||
)
|
||||
|
||||
func TestDeleteProfileWithValidConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p1"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithEmptyProfileConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p2_empty_profile_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithInvalidProfileConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p3_invalid_profile_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithPartialProfileConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p4_partial_profile_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithMissingMachineConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p5_missing_machine_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != numberOfMachineDirs {
|
||||
t.Fatal("Deleted a machine config when it should not")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithEmptyMachineConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p6_empty_machine_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithInvalidMachineConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p7_invalid_machine_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteProfileWithPartialMachineConfig(t *testing.T) {
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-single/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
profileToDelete := "p8_partial_machine_config"
|
||||
profile, _ := config.LoadProfile(profileToDelete)
|
||||
|
||||
errs := DeleteProfiles([]*config.Profile{profile})
|
||||
|
||||
if len(errs) > 0 {
|
||||
HandleDeletionErrors(errs)
|
||||
t.Fatal("Errors while deleting profiles")
|
||||
}
|
||||
|
||||
pathToProfile := config.ProfileFolderPath(profile.Name, localpath.MiniPath())
|
||||
if _, err := os.Stat(pathToProfile); !os.IsNotExist(err) {
|
||||
t.Fatalf("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.Fatalf("Profile folder of profile \"%s\" was not deleted", profile.Name)
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles")); len(files) != (numberOfProfileDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
if files, _ := ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines")); len(files) != (numberOfMachineDirs - 1) {
|
||||
t.Fatal("Did not delete exactly one profile")
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
||||
|
||||
func TestDeleteAllProfiles(t *testing.T) {
|
||||
const numberOfTotalProfileDirs = 8
|
||||
const numberOfTotalMachineDirs = 7
|
||||
|
||||
testMinikubeDir := "../../../pkg/minikube/config/testdata/delete-all/.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(), "profiles"))
|
||||
numberOfProfileDirs := len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs := len(files)
|
||||
|
||||
if numberOfTotalProfileDirs != numberOfProfileDirs {
|
||||
t.Error("invalid testdata")
|
||||
}
|
||||
|
||||
if numberOfTotalMachineDirs != numberOfMachineDirs {
|
||||
t.Error("invalid testdata")
|
||||
}
|
||||
|
||||
validProfiles, inValidProfiles, err := config.ListProfiles()
|
||||
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if numberOfTotalProfileDirs != len(validProfiles)+len(inValidProfiles) {
|
||||
t.Error("invalid testdata")
|
||||
}
|
||||
|
||||
profiles := append(validProfiles, inValidProfiles...)
|
||||
errs := DeleteProfiles(profiles)
|
||||
|
||||
if errs != nil {
|
||||
t.Errorf("errors while deleting all profiles: %v", errs)
|
||||
}
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "profiles"))
|
||||
numberOfProfileDirs = len(files)
|
||||
|
||||
files, _ = ioutil.ReadDir(filepath.Join(localpath.MiniPath(), "machines"))
|
||||
numberOfMachineDirs = len(files)
|
||||
|
||||
if numberOfProfileDirs != 0 {
|
||||
t.Errorf("Did not delete all profiles: still %d profiles left", numberOfProfileDirs)
|
||||
}
|
||||
|
||||
if numberOfMachineDirs != 0 {
|
||||
t.Errorf("Did not delete all profiles: still %d machines left", numberOfMachineDirs)
|
||||
}
|
||||
|
||||
viper.Set(config.MachineProfile, "")
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -120,15 +120,14 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
registryMirror []string
|
||||
dockerEnv []string
|
||||
dockerOpt []string
|
||||
insecureRegistry []string
|
||||
apiServerNames []string
|
||||
addonList []string
|
||||
apiServerIPs []net.IP
|
||||
extraOptions cfg.ExtraOptionSlice
|
||||
enableUpdateNotification = true
|
||||
registryMirror []string
|
||||
dockerEnv []string
|
||||
dockerOpt []string
|
||||
insecureRegistry []string
|
||||
apiServerNames []string
|
||||
addonList []string
|
||||
apiServerIPs []net.IP
|
||||
extraOptions cfg.ExtraOptionSlice
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -28,10 +28,6 @@ var updateCheckCmd = &cobra.Command{
|
|||
Use: "update-check",
|
||||
Short: "Print current and latest version number",
|
||||
Long: `Print current and latest version number`,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Explicitly disable update checking for the version command
|
||||
enableUpdateNotification = false
|
||||
},
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
url := notify.GithubMinikubeReleasesURL
|
||||
r, err := notify.GetAllVersionsFromURL(url)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -26,10 +26,6 @@ var versionCmd = &cobra.Command{
|
|||
Use: "version",
|
||||
Short: "Print the version of minikube",
|
||||
Long: `Print the version of minikube.`,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Explicitly disable update checking for the version command
|
||||
enableUpdateNotification = false
|
||||
},
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
out.Ln("minikube version: %v", version.GetVersion())
|
||||
gitCommitID := version.GetGitCommitID()
|
||||
|
|
|
@ -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"
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
crio/crio.sock
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 - - - - -
|
||||
|
|
1
go.mod
1
go.mod
|
@ -76,6 +76,7 @@ require (
|
|||
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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
release-notes
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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 }'
|
||||
|
|
|
@ -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)
|
||||
}
|
|
@ -318,27 +318,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"),
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
`,
|
||||
|
|
|
@ -604,12 +604,13 @@ func CreateSSHShell(api libmachine.API, args []string) error {
|
|||
|
||||
// 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) {
|
||||
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
|
||||
}
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// ListsMachines 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
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
|
@ -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")
|
||||
}
|
||||
}
|
80
pkg/minikube/cluster/testdata/list-machines/.minikube/machines/p1/config.json
vendored
Normal file
80
pkg/minikube/cluster/testdata/list-machines/.minikube/machines/p1/config.json
vendored
Normal 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"
|
||||
}
|
80
pkg/minikube/cluster/testdata/list-machines/.minikube/machines/p2/config.json
vendored
Normal file
80
pkg/minikube/cluster/testdata/list-machines/.minikube/machines/p2/config.json
vendored
Normal 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"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
invalid json file :)
|
72
pkg/minikube/cluster/testdata/list-machines/.minikube/machines/p5_partial_config/config.json
vendored
Normal file
72
pkg/minikube/cluster/testdata/list-machines/.minikube/machines/p5_partial_config/config.json
vendored
Normal 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"
|
||||
}
|
||||
},
|
||||
}
|
|
@ -27,8 +27,12 @@ import (
|
|||
"k8s.io/minikube/pkg/util/lock"
|
||||
)
|
||||
|
||||
// isValid checks if the profile has the essential info needed for a profile
|
||||
func (p *Profile) isValid() bool {
|
||||
// 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
|
||||
}
|
||||
|
@ -106,7 +110,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 +122,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
|
||||
}
|
||||
|
@ -133,7 +137,7 @@ func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile,
|
|||
}
|
||||
|
||||
// loadProfile loads type Profile based on its name
|
||||
func loadProfile(name string, miniHome ...string) (*Profile, error) {
|
||||
func LoadProfile(name string, miniHome ...string) (*Profile, error) {
|
||||
cfg, err := DefaultLoader.LoadConfigFromFile(name, miniHome...)
|
||||
p := &Profile{
|
||||
Name: name,
|
||||
|
@ -168,8 +172,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]
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
80
pkg/minikube/config/testdata/delete-all/.minikube/machines/p2_empty_profile_config/config.json
vendored
Normal file
80
pkg/minikube/config/testdata/delete-all/.minikube/machines/p2_empty_profile_config/config.json
vendored
Normal 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"
|
||||
}
|
80
pkg/minikube/config/testdata/delete-all/.minikube/machines/p3_invalid_profile_config/config.json
vendored
Normal file
80
pkg/minikube/config/testdata/delete-all/.minikube/machines/p3_invalid_profile_config/config.json
vendored
Normal 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"
|
||||
}
|
80
pkg/minikube/config/testdata/delete-all/.minikube/machines/p4_partial_profile_config/config.json
vendored
Normal file
80
pkg/minikube/config/testdata/delete-all/.minikube/machines/p4_partial_profile_config/config.json
vendored
Normal 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"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
invalid json file :)
|
72
pkg/minikube/config/testdata/delete-all/.minikube/machines/p8_partial_machine_config/config.json
vendored
Normal file
72
pkg/minikube/config/testdata/delete-all/.minikube/machines/p8_partial_machine_config/config.json
vendored
Normal 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"
|
||||
}
|
||||
},
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p5_missing_machine_config/config.json
vendored
Normal file
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p5_missing_machine_config/config.json
vendored
Normal 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
|
||||
}
|
||||
}
|
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p6_empty_machine_config/config.json
vendored
Normal file
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p6_empty_machine_config/config.json
vendored
Normal 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
|
||||
}
|
||||
}
|
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p7_invalid_machine_config/config.json
vendored
Normal file
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p7_invalid_machine_config/config.json
vendored
Normal 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
|
||||
}
|
||||
}
|
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p8_partial_machine_config/config.json
vendored
Normal file
49
pkg/minikube/config/testdata/delete-all/.minikube/profiles/p8_partial_machine_config/config.json
vendored
Normal 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
|
||||
}
|
||||
}
|
80
pkg/minikube/config/testdata/delete-single/.minikube/machines/p1/config.json
vendored
Normal file
80
pkg/minikube/config/testdata/delete-single/.minikube/machines/p1/config.json
vendored
Normal 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"
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
invalid json 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"
|
||||
}
|
||||
},
|
||||
}
|
49
pkg/minikube/config/testdata/delete-single/.minikube/profiles/p1/config.json
vendored
Normal file
49
pkg/minikube/config/testdata/delete-single/.minikube/profiles/p1/config.json
vendored
Normal 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
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
invalid json 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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
1
pkg/minikube/config/testdata/profile/.minikube/profiles/p4_invalid_file/config.json
vendored
Normal file
1
pkg/minikube/config/testdata/profile/.minikube/profiles/p4_invalid_file/config.json
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
invalid json file :)
|
47
pkg/minikube/config/testdata/profile/.minikube/profiles/p5_partial_config/config.json
vendored
Normal file
47
pkg/minikube/config/testdata/profile/.minikube/profiles/p5_partial_config/config.json
vendored
Normal 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
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
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 machine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/assets"
|
||||
"k8s.io/minikube/pkg/minikube/bootstrapper"
|
||||
"k8s.io/minikube/pkg/minikube/command"
|
||||
)
|
||||
|
||||
type copyFailRunner struct {
|
||||
command.Runner
|
||||
}
|
||||
|
||||
func (copyFailRunner) Copy(a assets.CopyableFile) error {
|
||||
return fmt.Errorf("test error during copy file")
|
||||
}
|
||||
|
||||
func newFakeCommandRunnerCopyFail() command.Runner {
|
||||
return copyFailRunner{command.NewFakeCommandRunner()}
|
||||
}
|
||||
|
||||
func TestCopyBinary(t *testing.T) {
|
||||
var tc = []struct {
|
||||
lastUpdateCheckFilePath string
|
||||
src, dst, desc string
|
||||
err bool
|
||||
runner command.Runner
|
||||
}{
|
||||
{
|
||||
desc: "not existing src",
|
||||
dst: "/tmp/testCopyBinary1",
|
||||
src: "/tmp/testCopyBinary2",
|
||||
err: true,
|
||||
runner: command.NewFakeCommandRunner(),
|
||||
},
|
||||
{
|
||||
desc: "src /etc/hosts",
|
||||
dst: "/tmp/testCopyBinary1",
|
||||
src: "/etc/hosts",
|
||||
err: false,
|
||||
runner: command.NewFakeCommandRunner(),
|
||||
},
|
||||
{
|
||||
desc: "existing src, copy fail",
|
||||
dst: "/etc/passwd",
|
||||
src: "/etc/hosts",
|
||||
err: true,
|
||||
runner: newFakeCommandRunnerCopyFail(),
|
||||
},
|
||||
}
|
||||
for _, test := range tc {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
err := CopyBinary(test.runner, test.src, test.dst)
|
||||
if err != nil && !test.err {
|
||||
t.Fatalf("Error %v expected but not occurred", err)
|
||||
}
|
||||
if err == nil && test.err {
|
||||
t.Fatal("Unexpected error")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCacheBinariesForBootstrapper(t *testing.T) {
|
||||
var tc = []struct {
|
||||
version, clusterBootstrapper string
|
||||
err bool
|
||||
}{
|
||||
{
|
||||
version: "v1.16.0",
|
||||
clusterBootstrapper: bootstrapper.BootstrapperTypeKubeadm,
|
||||
},
|
||||
{
|
||||
version: "invalid version",
|
||||
clusterBootstrapper: bootstrapper.BootstrapperTypeKubeadm,
|
||||
err: true,
|
||||
},
|
||||
}
|
||||
for _, test := range tc {
|
||||
t.Run(test.version, func(t *testing.T) {
|
||||
err := CacheBinariesForBootstrapper(test.version, test.clusterBootstrapper)
|
||||
if err != nil && !test.err {
|
||||
t.Fatalf("Got unexpected error %v", err)
|
||||
}
|
||||
if err == nil && test.err {
|
||||
t.Fatalf("Expected error but got %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
func TestCacheBinary(t *testing.T) {
|
||||
oldMinikubeHome := os.Getenv("MINIKUBE_HOME")
|
||||
defer os.Setenv("MINIKUBE_HOME", oldMinikubeHome)
|
||||
|
||||
minikubeHome, err := ioutil.TempDir("/tmp", "")
|
||||
if err != nil {
|
||||
t.Fatalf("error during creating tmp dir: %v", err)
|
||||
}
|
||||
defer os.RemoveAll(minikubeHome)
|
||||
noWritePermDir, err := ioutil.TempDir("/tmp", "")
|
||||
if err != nil {
|
||||
t.Fatalf("error during creating tmp dir: %v", err)
|
||||
}
|
||||
defer os.RemoveAll(noWritePermDir)
|
||||
err = os.Chmod(noWritePermDir, 0000)
|
||||
if err != nil {
|
||||
t.Fatalf("error (%v) during changing permissions of dir %v", err, noWritePermDir)
|
||||
}
|
||||
|
||||
var tc = []struct {
|
||||
desc, version, osName, archName string
|
||||
minikubeHome, binary, description string
|
||||
err bool
|
||||
}{
|
||||
{
|
||||
desc: "ok kubeadm",
|
||||
version: "v1.16.0",
|
||||
osName: runtime.GOOS,
|
||||
archName: runtime.GOARCH,
|
||||
binary: "kubeadm",
|
||||
err: false,
|
||||
minikubeHome: minikubeHome,
|
||||
},
|
||||
{
|
||||
desc: "minikube home in dir without perms and arm runtime",
|
||||
version: "v1.16.0",
|
||||
osName: runtime.GOOS,
|
||||
archName: "arm",
|
||||
binary: "kubectl",
|
||||
err: true,
|
||||
minikubeHome: noWritePermDir,
|
||||
},
|
||||
{
|
||||
desc: "minikube home in dir without perms",
|
||||
version: "v1.16.0",
|
||||
osName: runtime.GOOS,
|
||||
archName: runtime.GOARCH,
|
||||
binary: "kubectl",
|
||||
err: true,
|
||||
minikubeHome: noWritePermDir,
|
||||
},
|
||||
{
|
||||
desc: "binary foo",
|
||||
version: "v1.16.0",
|
||||
osName: runtime.GOOS,
|
||||
archName: runtime.GOARCH,
|
||||
binary: "foo",
|
||||
err: true,
|
||||
minikubeHome: minikubeHome,
|
||||
},
|
||||
{
|
||||
desc: "version 9000",
|
||||
version: "v9000",
|
||||
osName: runtime.GOOS,
|
||||
archName: runtime.GOARCH,
|
||||
binary: "foo",
|
||||
err: true,
|
||||
minikubeHome: minikubeHome,
|
||||
},
|
||||
{
|
||||
desc: "bad os",
|
||||
version: "v1.16.0",
|
||||
osName: "no-such-os",
|
||||
archName: runtime.GOARCH,
|
||||
binary: "kubectl",
|
||||
err: true,
|
||||
minikubeHome: minikubeHome,
|
||||
},
|
||||
}
|
||||
for _, test := range tc {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
os.Setenv("MINIKUBE_HOME", test.minikubeHome)
|
||||
_, err := CacheBinary(test.binary, test.version, test.osName, test.archName)
|
||||
if err != nil && !test.err {
|
||||
t.Fatalf("Got unexpected error %v", err)
|
||||
}
|
||||
if err == nil && test.err {
|
||||
t.Fatalf("Expected error but got %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -51,3 +51,53 @@ func TestSetPreferredLanguage(t *testing.T) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
func TestT(t *testing.T) {
|
||||
var tests = []struct {
|
||||
description, input, expected string
|
||||
langDef, langPref language.Tag
|
||||
translations map[string]interface{}
|
||||
}{
|
||||
{
|
||||
description: "empty string not default language",
|
||||
input: "",
|
||||
expected: "",
|
||||
langPref: language.English,
|
||||
langDef: language.Lithuanian,
|
||||
},
|
||||
{
|
||||
description: "empty string and default language",
|
||||
input: "",
|
||||
expected: "",
|
||||
langPref: language.English,
|
||||
langDef: language.English,
|
||||
},
|
||||
{
|
||||
description: "existing translation",
|
||||
input: "cat",
|
||||
expected: "kot",
|
||||
langPref: language.Lithuanian,
|
||||
langDef: language.English,
|
||||
translations: map[string]interface{}{"cat": "kot"},
|
||||
},
|
||||
{
|
||||
description: "not existing translation",
|
||||
input: "cat",
|
||||
expected: "cat",
|
||||
langPref: language.Lithuanian,
|
||||
langDef: language.English,
|
||||
translations: map[string]interface{}{"dog": "pies"},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.description, func(t *testing.T) {
|
||||
defaultLanguage = test.langDef
|
||||
preferredLanguage = test.langPref
|
||||
Translations = test.translations
|
||||
got := T(test.input)
|
||||
if test.expected != got {
|
||||
t.Errorf("T(%v) shoud return %v, but got: %v", test.input, test.expected, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,8 +122,8 @@ func (mgr *Manager) run(ctx context.Context, t controller, ready, check, done ch
|
|||
}
|
||||
}
|
||||
|
||||
func (mgr *Manager) cleanup(t controller) *Status {
|
||||
return t.cleanup()
|
||||
func (mgr *Manager) cleanup(t controller) {
|
||||
t.cleanup()
|
||||
}
|
||||
|
||||
// CleanupNotRunningTunnels cleans up tunnels that are not running
|
||||
|
|
|
@ -15,3 +15,30 @@ You can use the `--insecure-registry` flag on the
|
|||
One nifty hack is to allow the kubelet running in minikube to talk to registries deployed inside a pod in the cluster without backing them
|
||||
with TLS certificates. Because the default service cluster IP is known to be available at 10.0.0.1, users can pull images from registries
|
||||
deployed inside the cluster by creating the cluster with `minikube start --insecure-registry "10.0.0.0/24"`.
|
||||
|
||||
### docker on macOS
|
||||
|
||||
Quick guide for configuring minikube and docker on macOS, enabling docker to push images to minikube's registry.
|
||||
|
||||
The first step is to enable the registry addon:
|
||||
|
||||
```
|
||||
minikube addons enable registry
|
||||
```
|
||||
|
||||
When enabled, the registry addon exposes its port 5000 on the minikube's virtual machine.
|
||||
|
||||
In order to make docker accept pushing images to this registry, we have to redirect port 5000 on the docker virtual machine over to port 5000 on the minikube machine. We can (ab)use docker's network configuration to instantiate a container on the docker's host, and run socat there:
|
||||
|
||||
```
|
||||
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
|
||||
```
|
||||
|
||||
Once socat is running it's possible to push images to the minikube registry:
|
||||
|
||||
```
|
||||
docker tag my/image localhost:5000/myimage
|
||||
docker push localhost:5000/myimage
|
||||
```
|
||||
|
||||
After the image is pushed, refer to it by `localhost:5000/{name}` in kubectl specs.
|
||||
|
|
|
@ -16,7 +16,6 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
// a_download_only_test.go filename starts with a, for the purpose that it runs before all parallel tests and downloads the images and caches them.
|
||||
package integration
|
||||
|
||||
import (
|
||||
|
@ -34,10 +33,7 @@ import (
|
|||
"k8s.io/minikube/pkg/minikube/localpath"
|
||||
)
|
||||
|
||||
// Note this test runs before all because filename is alphabetically first
|
||||
// is used to cache images and binaries used by other parallel tests to avoid redownloading.
|
||||
// TestDownloadOnly tests the --download-only option
|
||||
func TestDownloadOnly(t *testing.T) {
|
||||
func TestDownloadAndDeleteAll(t *testing.T) {
|
||||
profile := UniqueProfileName("download")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
||||
defer Cleanup(t, profile, cancel)
|
||||
|
@ -79,5 +75,13 @@ func TestDownloadOnly(t *testing.T) {
|
|||
}
|
||||
})
|
||||
}
|
||||
// This is a weird place to test profile deletion, but this test is serial, and we have a profile to delete!
|
||||
t.Run("DeleteAll", func(t *testing.T) {
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "--all"))
|
||||
if err != nil {
|
||||
t.Errorf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
|
@ -29,6 +29,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -87,6 +88,7 @@ func TestFunctional(t *testing.T) {
|
|||
{"MountCmd", validateMountCmd},
|
||||
{"ProfileCmd", validateProfileCmd},
|
||||
{"ServicesCmd", validateServicesCmd},
|
||||
{"AddonsCmd", validateAddonsCmd},
|
||||
{"PersistentVolumeClaim", validatePersistentVolumeClaim},
|
||||
{"TunnelCmd", validateTunnelCmd},
|
||||
{"SSHCmd", validateSSHCmd},
|
||||
|
@ -314,6 +316,52 @@ func validateServicesCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
}
|
||||
}
|
||||
|
||||
// validateAddonsCmd asserts basic "addon" command functionality
|
||||
func validateAddonsCmd(ctx context.Context, t *testing.T, profile string) {
|
||||
|
||||
// Default output
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "list"))
|
||||
if err != nil {
|
||||
t.Errorf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
listLines := strings.Split(strings.TrimSpace(rr.Stdout.String()), "\n")
|
||||
r := regexp.MustCompile(`-\s[a-z|-]+:\s(enabled|disabled)`)
|
||||
for _, line := range listLines {
|
||||
match := r.MatchString(line)
|
||||
if !match {
|
||||
t.Errorf("Plugin output did not match expected format. Got: %s", line)
|
||||
}
|
||||
}
|
||||
|
||||
// Custom format
|
||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "list", "--format", `"{{.AddonName}}":"{{.AddonStatus}}"`))
|
||||
if err != nil {
|
||||
t.Errorf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
listLines = strings.Split(strings.TrimSpace(rr.Stdout.String()), "\n")
|
||||
r = regexp.MustCompile(`"[a-z|-]+":"(enabled|disabled)"`)
|
||||
for _, line := range listLines {
|
||||
match := r.MatchString(line)
|
||||
if !match {
|
||||
t.Errorf("Plugin output did not match expected custom format. Got: %s", line)
|
||||
}
|
||||
}
|
||||
|
||||
// Custom format shorthand
|
||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "list", "-f", `"{{.AddonName}}":"{{.AddonStatus}}"`))
|
||||
if err != nil {
|
||||
t.Errorf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
listLines = strings.Split(strings.TrimSpace(rr.Stdout.String()), "\n")
|
||||
r = regexp.MustCompile(`"[a-z|-]+":"(enabled|disabled)"`)
|
||||
for _, line := range listLines {
|
||||
match := r.MatchString(line)
|
||||
if !match {
|
||||
t.Errorf("Plugin output did not match expected custom format. Got: %s", line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// validateSSHCmd asserts basic "ssh" command functionality
|
||||
func validateSSHCmd(ctx context.Context, t *testing.T, profile string) {
|
||||
if NoneDriver() {
|
||||
|
|
|
@ -33,7 +33,7 @@ func TestGvisorAddon(t *testing.T) {
|
|||
MaybeSlowParallel(t)
|
||||
|
||||
profile := UniqueProfileName("gvisor")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
|
||||
defer func() {
|
||||
CleanupWithLogs(t, profile, cancel)
|
||||
}()
|
||||
|
|
|
@ -111,6 +111,7 @@
|
|||
"Error getting host status": "",
|
||||
"Error getting machine logs": "",
|
||||
"Error getting machine status": "",
|
||||
"Error getting profiles to delete": "",
|
||||
"Error getting service status": "",
|
||||
"Error getting service with namespace: {{.namespace}} and labels {{.labelName}}:{{.addonName}}: {{.error}}": "",
|
||||
"Error getting the host IP address to use from within the VM": "",
|
||||
|
@ -504,6 +505,8 @@
|
|||
"usage: minikube addons list": "",
|
||||
"usage: minikube addons open ADDON_NAME": "",
|
||||
"usage: minikube config unset PROPERTY_NAME": "",
|
||||
"usage: minikube delete": "",
|
||||
"usage: minikube delete --all": "",
|
||||
"usage: minikube profile [MINIKUBE_PROFILE_NAME]": "",
|
||||
"zsh completion failed": "",
|
||||
"{{.addonName}} was successfully enabled": "",
|
||||
|
@ -516,4 +519,4 @@
|
|||
"{{.prefix}}minikube {{.version}} on {{.platform}}": "{{.prefix}}minikube {{.version}} sur {{.platform}}",
|
||||
"{{.type}} is not yet a supported filesystem. We will try anyways!": "",
|
||||
"{{.url}} is not accessible: {{.error}}": ""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,188 +1,188 @@
|
|||
{
|
||||
"\"{{.minikube_addon}}\" was successfully disabled": "",
|
||||
"\"{{.name}}\" cluster does not exist. Proceeding ahead with cleanup.": "",
|
||||
"\"{{.minikube_addon}}\" was successfully disabled": "已成功禁用 \"{{.minikube_addon}}\"",
|
||||
"\"{{.name}}\" cluster does not exist. Proceeding ahead with cleanup.": "\"{{.name}}\" 集群不存在,将继续清理",
|
||||
"\"{{.name}}\" profile does not exist": "“{{.name}}”配置文件不存在",
|
||||
"\"{{.profile_name}}\" VM does not exist, nothing to stop": "",
|
||||
"\"{{.profile_name}}\" host does not exist, unable to show an IP": "",
|
||||
"\"{{.profile_name}}\" stopped.": "",
|
||||
"'none' driver does not support 'minikube docker-env' command": "",
|
||||
"'none' driver does not support 'minikube mount' command": "",
|
||||
"'none' driver does not support 'minikube ssh' command": "",
|
||||
"A VPN or firewall is interfering with HTTP access to the minikube VM. Alternatively, try a different VM driver: https://minikube.sigs.k8s.io/docs/start/": "",
|
||||
"A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.": "",
|
||||
"A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.": "",
|
||||
"A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.": "",
|
||||
"A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "",
|
||||
"\"{{.profile_name}}\" VM does not exist, nothing to stop": "\"{{.profile_name}}\" 虚拟机不存在,没有什么可供停止的",
|
||||
"\"{{.profile_name}}\" host does not exist, unable to show an IP": "\"{{.profile_name}}\" 主机不存在,无法显示其IP",
|
||||
"\"{{.profile_name}}\" stopped.": "\"{{.profile_name}}\" 已停止",
|
||||
"'none' driver does not support 'minikube docker-env' command": "'none' 驱动不支持 'minikube docker-env' 命令",
|
||||
"'none' driver does not support 'minikube mount' command": "'none' 驱动不支持 'minikube mount' 命令",
|
||||
"'none' driver does not support 'minikube ssh' command": "'none' 驱动不支持 'minikube ssh' 命令",
|
||||
"A VPN or firewall is interfering with HTTP access to the minikube VM. Alternatively, try a different VM driver: https://minikube.sigs.k8s.io/docs/start/": "VPN 或者防火墙正在干扰对 minikube 虚拟机的 HTTP 访问。或者,您可以使用其它的虚拟机驱动:https://minikube.sigs.k8s.io/docs/start/",
|
||||
"A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.": "防火墙正在阻止 minikube 虚拟机中的 Docker 访问互联网,您可能需要对其进行配置为使用代理",
|
||||
"A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.": "防火墙正在干扰 minikube 发送 HTTPS 请求的能力,您可能需要改变 HTTPS_PROXY 环境变量的值",
|
||||
"A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.": "防火墙可能会阻止 minikube 访问互联网。您可能需要将 minikube 配置为使用",
|
||||
"A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "一组在为 kubernetes 生成的证书中使用的 apiserver IP 地址。如果您希望将此 apiserver 设置为可从机器外部访问,则可以使用这组 apiserver IP 地址",
|
||||
"A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "一组在为 kubernetes 生成的证书中使用的 apiserver IP 地址。如果您希望将此 apiserver 设置为可从机器外部访问,则可以使用这组 apiserver IP 地址",
|
||||
"A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "",
|
||||
"A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "一组在为 kubernetes 生成的证书中使用的 apiserver 名称。如果您希望将此 apiserver 设置为可从机器外部访问,则可以使用这组 apiserver 名称",
|
||||
"A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine": "一组在为 kubernetes 生成的证书中使用的 apiserver 名称。如果您希望将此 apiserver 设置为可从机器外部访问,则可以使用这组 apiserver 名称",
|
||||
"A set of key=value pairs that describe configuration that may be passed to different components.\nThe key should be '.' separated, and the first part before the dot is the component to apply the configuration to.\nValid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler\nValid kubeadm parameters:": "一组用于描述可传递给不同组件的配置的键值对。\n其中键应以英文句点“.”分隔,英文句点前面的第一个部分是应用该配置的组件。\n有效组件包括:kubelet、kubeadm、apiserver、controller-manager、etcd、proxy、scheduler\n有效 kubeadm 参数包括:",
|
||||
"A set of key=value pairs that describe feature gates for alpha/experimental features.": "一组用于描述 alpha 版功能/实验性功能的功能限制的键值对。",
|
||||
"Access the kubernetes dashboard running within the minikube cluster": "",
|
||||
"Add an image to local cache.": "",
|
||||
"Add machine IP to NO_PROXY environment variable": "",
|
||||
"Add or delete an image from the local cache.": "",
|
||||
"Additional help topics": "",
|
||||
"Additional mount options, such as cache=fscache": "",
|
||||
"Advanced Commands:": "",
|
||||
"Aliases": "",
|
||||
"Allow user prompts for more information": "",
|
||||
"Access the kubernetes dashboard running within the minikube cluster": "访问在 minikube 集群中运行的 kubernetes dashboard",
|
||||
"Add an image to local cache.": "将 image 添加到本地缓存。",
|
||||
"Add machine IP to NO_PROXY environment variable": "将机器IP添加到环境变量 NO_PROXY 中",
|
||||
"Add or delete an image from the local cache.": "在本地缓存中添加或删除 image。",
|
||||
"Additional help topics": "其他帮助",
|
||||
"Additional mount options, such as cache=fscache": "其他挂载选项,例如:cache=fscache",
|
||||
"Advanced Commands:": "高级命令:",
|
||||
"Aliases": "别名",
|
||||
"Allow user prompts for more information": "允许用户提示以获取更多信息",
|
||||
"Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to \\\"auto\\\" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers": "用于从中拉取 docker 映像的备选映像存储库。如果您对 gcr.io 的访问受到限制,则可以使用该映像存储库。将映像存储库设置为“auto”可让 minikube 为您选择一个存储库。对于中国大陆用户,您可以使用本地 gcr.io 镜像,例如 registry.cn-hangzhou.aliyuncs.com/google_containers",
|
||||
"Amount of RAM allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g)": "为 minikube 虚拟机分配的 RAM 容量(格式:\u003c数字\u003e[\u003c单位\u003e],其中单位 = b、k、m 或 g)",
|
||||
"Amount of RAM allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g).": "",
|
||||
"Amount of time to wait for a service in seconds": "",
|
||||
"Amount of time to wait for service in seconds": "",
|
||||
"Available Commands": "",
|
||||
"Basic Commands:": "",
|
||||
"Cannot find directory {{.path}} for mount": "",
|
||||
"Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "",
|
||||
"Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'": "",
|
||||
"Check that your apiserver flags are valid, or run 'minikube delete'": "",
|
||||
"Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --vm-driver=none": "",
|
||||
"Configuration and Management Commands:": "",
|
||||
"Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=\u003cswitch-name\u003e` to `minikube start`": "",
|
||||
"Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list": "",
|
||||
"Amount of RAM allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g).": "为 minikube 虚拟机分配的 RAM 容量(格式:\u003c数字\u003e[\u003c单位\u003e],其中单位 = b、k、m 或 g)。",
|
||||
"Amount of time to wait for a service in seconds": "等待服务的时间(单位秒)",
|
||||
"Amount of time to wait for service in seconds": "等待服务的时间(单位秒)",
|
||||
"Available Commands": "可用命令",
|
||||
"Basic Commands:": "基本命令:",
|
||||
"Cannot find directory {{.path}} for mount": "找不到用来挂载的 {{.path}} 目录",
|
||||
"Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "检测 minikube 是否正在运行,以及是否根据需要指定了正确的 namespace (-n 标志)",
|
||||
"Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'": "检测您的 --kubernetes-version 前面是否有 'v', 例如:'v1.1.14",
|
||||
"Check that your apiserver flags are valid, or run 'minikube delete'": "请检查您的 apiserver 标志是否有效,或者允许 'minikube delete'",
|
||||
"Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --vm-driver=none": "检查您的防火墙规则是否存在干扰,然后运行 'virt-host-validate' 以检查 KVM 配置问题,如果在虚拟机中运行minikube,请考虑使用 --vm-driver=none",
|
||||
"Configuration and Management Commands:": "配置和管理命令:",
|
||||
"Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=\u003cswitch-name\u003e` to `minikube start`": "根据官方文档配置外部网络交换机,然后添加 `--hyperv-virtual-switch=\u003cswitch-name\u003e` 到 `minikube start`",
|
||||
"Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list": "在 minikube 中配置插件 w/ADDON_NAME(例如:minikube addons configure registry-creds)。查看相关可用的插件列表,请使用:minikube addons list",
|
||||
"Configuring environment for Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}}": "开始为Kubernetes {{.k8sVersion}},{{.runtime}} {{.runtimeVersion}} 配置环境变量",
|
||||
"Configuring local host environment ...": "",
|
||||
"Confirm that you have a working internet connection and that your VM has not run out of resources by using: 'minikube logs'": "",
|
||||
"Confirm that you have supplied the correct value to --hyperv-virtual-switch using the 'Get-VMSwitch' command": "",
|
||||
"Configuring local host environment ...": "开始配置本地主机环境...",
|
||||
"Confirm that you have a working internet connection and that your VM has not run out of resources by using: 'minikube logs'": "使用 'minikube logs' 确认您的互联网连接正常,并且您的虚拟机没有耗尽资源",
|
||||
"Confirm that you have supplied the correct value to --hyperv-virtual-switch using the 'Get-VMSwitch' command": "使用 'Get-VMSwitch' 命令确认已经为 --hyperv-virtual-switch 提供了正确的值",
|
||||
"Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn.": "需要使用的映像镜像的国家/地区代码。留空以使用全球代码。对于中国大陆用户,请将其设置为 cn。",
|
||||
"Created a new profile : {{.profile_name}}": "",
|
||||
"Creating a new profile failed": "",
|
||||
"Created a new profile : {{.profile_name}}": "创建了新的配置文件:{{.profile_name}}",
|
||||
"Creating a new profile failed": "创建新的配置文件失败",
|
||||
"Creating mount {{.name}} ...": "正在创建装载 {{.name}}…",
|
||||
"Creating {{.driver_name}} VM (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...": "",
|
||||
"Default group id used for the mount": "",
|
||||
"Default user id used for the mount": "",
|
||||
"Delete an image from the local cache.": "",
|
||||
"Deletes a local kubernetes cluster": "",
|
||||
"Deletes a local kubernetes cluster. This command deletes the VM, and removes all\nassociated files.": "",
|
||||
"Creating {{.driver_name}} VM (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...": "正在创建 {{.driver_name}} 虚拟机(CPUs={{.number_of_cpus}},Memory={{.memory_size}}MB, Disk={{.disk_size}}MB)...",
|
||||
"Default group id used for the mount": "用于挂载默认的 group id",
|
||||
"Default user id used for the mount": "用于挂载默认的 user id",
|
||||
"Delete an image from the local cache.": "从本地缓存中删除 image。",
|
||||
"Deletes a local kubernetes cluster": "删除本地的 kubernetes 集群",
|
||||
"Deletes a local kubernetes cluster. This command deletes the VM, and removes all\nassociated files.": "删除本地的 kubernetes 集群。此命令还将删除虚拟机,并删除所有的\n相关文件",
|
||||
"Deletes a local kubernetes cluster. This command deletes the VM, and removes all associated files.": "删除本地 kubernetes 集群。此命令会删除虚拟机并移除所有关联的文件。",
|
||||
"Deleting \"{{.profile_name}}\" in {{.driver_name}} ...": "正在删除 {{.driver_name}} 中的“{{.profile_name}}”…",
|
||||
"Disable checking for the availability of hardware virtualization before the vm is started (virtualbox driver only)": "禁用在启动虚拟机之前检查硬件虚拟化的可用性(仅限 virtualbox 驱动程序)",
|
||||
"Disable dynamic memory in your VM manager, or pass in a larger --memory value": "",
|
||||
"Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list": "",
|
||||
"Disable dynamic memory in your VM manager, or pass in a larger --memory value": "禁用虚拟机管理器中的动态内存,或者使用 --memory 传入更大的值",
|
||||
"Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list": "在 minikube 中禁用插件 w/ADDON_NAME(例如:minikube addons disable dashboard)。查看相关可用的插件列表,请使用:minikube addons list",
|
||||
"Disables the filesystem mounts provided by the hypervisors": "停用由管理程序提供的文件系统装载",
|
||||
"Disk size allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g)": "分配给 minikube 虚拟机的磁盘大小(格式:\u003c数字\u003e[\u003c单位\u003e],其中单位 = b、k、m 或 g)",
|
||||
"Disk size allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g).": "",
|
||||
"Display dashboard URL instead of opening a browser": "",
|
||||
"Display the kubernetes addons URL in the CLI instead of opening it in the default browser": "",
|
||||
"Display the kubernetes service URL in the CLI instead of opening it in the default browser": "",
|
||||
"Display values currently set in the minikube config file": "",
|
||||
"Display values currently set in the minikube config file.": "",
|
||||
"Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "",
|
||||
"Docs have been saved at - {{.path}}": "",
|
||||
"Documentation: {{.url}}": "",
|
||||
"Done! kubectl is now configured to use \"{{.name}}\"": "",
|
||||
"Disk size allocated to the minikube VM (format: \u003cnumber\u003e[\u003cunit\u003e], where unit = b, k, m or g).": "分配给 minikube 虚拟机的磁盘大小(格式:\u003c数字\u003e[\u003c单位\u003e],其中单位 = b、k、m 或 g)。",
|
||||
"Display dashboard URL instead of opening a browser": "显示 dashboard URL,而不是打开浏览器",
|
||||
"Display the kubernetes addons URL in the CLI instead of opening it in the default browser": "在终端中显示 kubernetes addons URL,而不是在默认浏览器中打开它",
|
||||
"Display the kubernetes service URL in the CLI instead of opening it in the default browser": "在终端中显示 kubernetes service URL,而不是在默认浏览器中打开它",
|
||||
"Display values currently set in the minikube config file": "显示当前在 minikube 配置文件中设置的值",
|
||||
"Display values currently set in the minikube config file.": "显示当前在 minikube 配置文件中设置的值。",
|
||||
"Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "虚拟机中的 Docker 不可用,尝试运行 'minikube delete' 来重置虚拟机。",
|
||||
"Docs have been saved at - {{.path}}": "文档已保存在 - {{.path}}",
|
||||
"Documentation: {{.url}}": "文档:{{.url}}",
|
||||
"Done! kubectl is now configured to use \"{{.name}}\"": "完成!kubectl 已经配置至 \"{{.name}}\"",
|
||||
"Done! kubectl is now configured to use {{.name}}": "完成!kubectl已经配置至{{.name}}",
|
||||
"Download complete!": "下载完成!",
|
||||
"Downloading VM boot image ...": "",
|
||||
"Downloading driver {{.driver}}:": "",
|
||||
"Downloading {{.name}} {{.version}}": "",
|
||||
"ERROR creating `registry-creds-dpr` secret": "",
|
||||
"ERROR creating `registry-creds-ecr` secret: {{.error}}": "",
|
||||
"ERROR creating `registry-creds-gcr` secret: {{.error}}": "",
|
||||
"Either systemctl is not installed, or Docker is broken. Run 'sudo systemctl start docker' and 'journalctl -u docker'": "",
|
||||
"Downloading VM boot image ...": "正在下载 VM boot image...",
|
||||
"Downloading driver {{.driver}}:": "正在下载驱动 {{.driver}}:",
|
||||
"Downloading {{.name}} {{.version}}": "正在下载 {{.name}} {{.version}}",
|
||||
"ERROR creating `registry-creds-dpr` secret": "创建 `registry-creds-dpr` secret 时出错",
|
||||
"ERROR creating `registry-creds-ecr` secret: {{.error}}": "创建 `registry-creds-ecr` secret 时出错:{{.error}}",
|
||||
"ERROR creating `registry-creds-gcr` secret: {{.error}}": "创建 `registry-creds-gcr` secret 时出错:{{.error}}",
|
||||
"Either systemctl is not installed, or Docker is broken. Run 'sudo systemctl start docker' and 'journalctl -u docker'": "未安装 systemctl 或者 Docker 损坏。请运行 'sudo systemctl start docker' 和 'journalctl -u docker'",
|
||||
"Enable experimental NVIDIA GPU support in minikube": "在 minikube 中启用实验性 NVIDIA GPU 支持",
|
||||
"Enable host resolver for NAT DNS requests (virtualbox driver only)": "为 NAT DNS 请求启用主机解析器(仅限 virtualbox 驱动程序)",
|
||||
"Enable proxy for NAT DNS requests (virtualbox driver only)": "为 NAT DNS 请求启用代理(仅限 virtualbox 驱动程序)",
|
||||
"Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \\\"--network-plugin=cni\\": "启用默认 CNI 插件 (/etc/cni/net.d/k8s.conf)。与“--network-plugin=cni”结合使用",
|
||||
"Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \\\"--network-plugin=cni\\\".": "",
|
||||
"Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list": "",
|
||||
"Enabling dashboard ...": "",
|
||||
"Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \\\"--network-plugin=cni\\\".": "启用默认 CNI 插件 (/etc/cni/net.d/k8s.conf)。与“--network-plugin=cni”结合使用。",
|
||||
"Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list": "启动 minikube 插件 w/ADDON_NAME(例如:minikube addons enable dashboard)。查看相关可用的插件列表,请使用:minikube addons list",
|
||||
"Enabling dashboard ...": "正在开启 dashboard ...",
|
||||
"Environment variables to pass to the Docker daemon. (format: key=value)": "传递给 Docker 守护进程的环境变量。(格式:键值对)",
|
||||
"Error checking driver version: {{.error}}": "检查驱动程序版本时出错:{{.error}}",
|
||||
"Error creating list template": "",
|
||||
"Error creating minikube directory": "",
|
||||
"Error creating status template": "",
|
||||
"Error creating view template": "",
|
||||
"Error executing list template": "",
|
||||
"Error executing status template": "",
|
||||
"Error executing template": "",
|
||||
"Error executing view template": "",
|
||||
"Error finding port for mount": "",
|
||||
"Error getting IP": "",
|
||||
"Error getting bootstrapper": "",
|
||||
"Error getting client": "",
|
||||
"Error getting client: {{.error}}": "",
|
||||
"Error getting cluster": "",
|
||||
"Error getting cluster bootstrapper": "",
|
||||
"Error getting config": "",
|
||||
"Error getting host": "",
|
||||
"Error getting host status": "",
|
||||
"Error getting machine logs": "",
|
||||
"Error getting machine status": "",
|
||||
"Error getting service status": "",
|
||||
"Error getting service with namespace: {{.namespace}} and labels {{.labelName}}:{{.addonName}}: {{.error}}": "",
|
||||
"Error getting the host IP address to use from within the VM": "",
|
||||
"Error creating list template": "创建 list template 时出错",
|
||||
"Error creating minikube directory": "创建 minikube 目录时出错",
|
||||
"Error creating status template": "创建 status template 时出错",
|
||||
"Error creating view template": "创建 view template 时出错",
|
||||
"Error executing list template": "执行 list template 时出错",
|
||||
"Error executing status template": "执行 status template 时出错",
|
||||
"Error executing template": "执行 template 时出错",
|
||||
"Error executing view template": "执行 view template 时出错",
|
||||
"Error finding port for mount": "查找 mount 端口时出错",
|
||||
"Error getting IP": "获取 IP 时出错",
|
||||
"Error getting bootstrapper": "获取 bootstrapper 时出错",
|
||||
"Error getting client": "获取 client 时出错",
|
||||
"Error getting client: {{.error}}": "获取 client 时出错:{{.error}}",
|
||||
"Error getting cluster": "获取 cluster 时出错",
|
||||
"Error getting cluster bootstrapper": "获取 cluster bootstrapper 时出错",
|
||||
"Error getting config": "获取 config 时出错",
|
||||
"Error getting host": "获取 host 时出错",
|
||||
"Error getting host status": "获取 host status 时出错",
|
||||
"Error getting machine logs": "获取 machine logs 时出错",
|
||||
"Error getting machine status": "获取 machine status 时出错",
|
||||
"Error getting service status": "获取 service status 时出错",
|
||||
"Error getting service with namespace: {{.namespace}} and labels {{.labelName}}:{{.addonName}}: {{.error}}": "使用 namespace: {{.namespace}} 和 labels {{.labelName}}:{{.addonName}} 获取 service 时出错:{{.error}}",
|
||||
"Error getting the host IP address to use from within the VM": "从虚拟机中获取 host IP 地址时出错",
|
||||
"Error host driver ip status": "",
|
||||
"Error killing mount process": "",
|
||||
"Error loading api": "",
|
||||
"Error loading profile config": "",
|
||||
"Error loading profile config: {{.error}}": "",
|
||||
"Error killing mount process": "杀死 mount 进程时出错",
|
||||
"Error loading api": "加载 api 时出错",
|
||||
"Error loading profile config": "加载配置文件的配置时出错",
|
||||
"Error loading profile config: {{.error}}": "加载配置文件的配置时出错:{{.error}}",
|
||||
"Error loading profile {{.name}}: {{.error}}": "加载配置文件 {{.name}} 时出错:{{.error}}",
|
||||
"Error opening service": "",
|
||||
"Error opening service": "开启 service 时出错",
|
||||
"Error parsing minikube version: {{.error}}": "解析 minikube 版本时出错:{{.error}}",
|
||||
"Error parsing vmDriver version: {{.error}}": "解析 vmDriver 版本时出错:{{.error}}",
|
||||
"Error reading {{.path}}: {{.error}}": "",
|
||||
"Error restarting cluster": "",
|
||||
"Error setting shell variables": "",
|
||||
"Error starting cluster": "",
|
||||
"Error starting mount": "",
|
||||
"Error unsetting shell variables": "",
|
||||
"Error while setting kubectl current context : {{.error}}": "",
|
||||
"Error writing mount pid": "",
|
||||
"Error: You have selected Kubernetes v{{.new}}, but the existing cluster for your profile is running Kubernetes v{{.old}}. Non-destructive downgrades are not supported, but you can proceed by performing one of the following options:\n\n* Recreate the cluster using Kubernetes v{{.new}}: Run \"minikube delete {{.profile}}\", then \"minikube start {{.profile}} --kubernetes-version={{.new}}\"\n* Create a second cluster with Kubernetes v{{.new}}: Run \"minikube start -p \u003cnew name\u003e --kubernetes-version={{.new}}\"\n* Reuse the existing cluster with Kubernetes v{{.old}} or newer: Run \"minikube start {{.profile}} --kubernetes-version={{.old}}\"": "",
|
||||
"Error reading {{.path}}: {{.error}}": "读取 {{.path}} 时出错:{{.error}}",
|
||||
"Error restarting cluster": "重启 cluster 时出错",
|
||||
"Error setting shell variables": "设置 shell 变量时出错",
|
||||
"Error starting cluster": "开启 cluster 时出错",
|
||||
"Error starting mount": "开启 mount 时出错",
|
||||
"Error unsetting shell variables": "取消设置 shell 变量时出错",
|
||||
"Error while setting kubectl current context : {{.error}}": "设置 kubectl 上下文时出错 :{{.error}}",
|
||||
"Error writing mount pid": "写入 mount pid 时出错",
|
||||
"Error: You have selected Kubernetes v{{.new}}, but the existing cluster for your profile is running Kubernetes v{{.old}}. Non-destructive downgrades are not supported, but you can proceed by performing one of the following options:\n\n* Recreate the cluster using Kubernetes v{{.new}}: Run \"minikube delete {{.profile}}\", then \"minikube start {{.profile}} --kubernetes-version={{.new}}\"\n* Create a second cluster with Kubernetes v{{.new}}: Run \"minikube start -p \u003cnew name\u003e --kubernetes-version={{.new}}\"\n* Reuse the existing cluster with Kubernetes v{{.old}} or newer: Run \"minikube start {{.profile}} --kubernetes-version={{.old}}\"": "错误:您已选择 Kubernetes v{{.new}},但您的配置文件的现有集群正在运行 Kubernetes v{{.old}}。非破坏性降级不受支持,但若要继续操作,您可以执行以下选项之一:\n\n* 使用 Kubernetes v{{.new}} 重新创建现有集群:运行“minikube delete {{.profile}}”,然后运行“minikube start {{.profile}} --kubernetes-version={{.new}}”\n* 使用 Kubernetes v{{.new}} 再创建一个集群:运行“minikube start -p \u003cnew name\u003e --kubernetes-version={{.new}}”\n* 通过 Kubernetes v{{.old}} 或更高版本重复使用现有集群:运行“minikube start {{.profile}} --kubernetes-version={{.old}}”",
|
||||
"Error: You have selected Kubernetes v{{.new}}, but the existing cluster for your profile is running Kubernetes v{{.old}}. Non-destructive downgrades are not supported, but you can proceed by performing one of the following options:\n* Recreate the cluster using Kubernetes v{{.new}}: Run \"minikube delete {{.profile}}\", then \"minikube start {{.profile}} --kubernetes-version={{.new}}\"\n* Create a second cluster with Kubernetes v{{.new}}: Run \"minikube start -p \u003cnew name\u003e --kubernetes-version={{.new}}\"\n* Reuse the existing cluster with Kubernetes v{{.old}} or newer: Run \"minikube start {{.profile}} --kubernetes-version={{.old}}": "错误:您已选择 Kubernetes v{{.new}},但您的配置文件的现有集群正在运行 Kubernetes v{{.old}}。非破坏性降级不受支持,但若要继续操作,您可以执行以下选项之一:\n* 使用 Kubernetes v{{.new}} 重新创建现有集群:运行“minikube delete {{.profile}}”,然后运行“minikube start {{.profile}} --kubernetes-version={{.new}}”\n* 使用 Kubernetes v{{.new}} 再创建一个集群:运行“minikube start -p \u003cnew name\u003e --kubernetes-version={{.new}}”\n* 通过 Kubernetes v{{.old}} 或更高版本重复使用现有集群:运行“minikube start {{.profile}} --kubernetes-version={{.old}}”",
|
||||
"Error: [{{.id}}] {{.error}}": "",
|
||||
"Examples": "",
|
||||
"Error: [{{.id}}] {{.error}}": "错误:[{{.id}}] {{.error}}",
|
||||
"Examples": "示例",
|
||||
"Exiting": "正在退出",
|
||||
"Exiting due to driver incompatibility": "",
|
||||
"Exiting due to driver incompatibility": "由于驱动程序不兼容而退出",
|
||||
"Failed runtime": "",
|
||||
"Failed to cache ISO": "",
|
||||
"Failed to cache and load images": "",
|
||||
"Failed to cache binaries": "",
|
||||
"Failed to cache images": "",
|
||||
"Failed to cache ISO": "缓存ISO 时失败",
|
||||
"Failed to cache and load images": "无法加载 cache 和 images",
|
||||
"Failed to cache binaries": "缓存二进制文件失败",
|
||||
"Failed to cache images": "缓存 images 时失败",
|
||||
"Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "未能更改 {{.minikube_dir_path}} 的权限:{{.error}}",
|
||||
"Failed to check if machine exists": "",
|
||||
"Failed to check main repository and mirrors for images for images": "",
|
||||
"Failed to check if machine exists": "无法检测机器是否存在",
|
||||
"Failed to check main repository and mirrors for images for images": "无法检测主 repository 和 mirrors images 中的 images",
|
||||
"Failed to delete cluster: {{.error}}": "未能删除集群:{{.error}}",
|
||||
"Failed to delete cluster: {{.error}}__1": "未能删除集群:{{.error}}",
|
||||
"Failed to delete images": "",
|
||||
"Failed to delete images from config": "",
|
||||
"Failed to download kubectl": "",
|
||||
"Failed to delete images": "删除 images 时失败",
|
||||
"Failed to delete images from config": "无法从 config 里删除 images",
|
||||
"Failed to download kubectl": "下载 kubectl 失败",
|
||||
"Failed to enable container runtime": "",
|
||||
"Failed to generate config": "",
|
||||
"Failed to get bootstrapper": "",
|
||||
"Failed to generate config": "无法生成 config",
|
||||
"Failed to get bootstrapper": "获取 bootstrapper 失败",
|
||||
"Failed to get command runner": "",
|
||||
"Failed to get driver URL": "",
|
||||
"Failed to get driver URL": "获取 driver URL 失败",
|
||||
"Failed to get image map": "",
|
||||
"Failed to get machine client": "",
|
||||
"Failed to get service URL: {{.error}}": "",
|
||||
"Failed to get service URL: {{.error}}": "获取 service URL 失败:{{.error}}",
|
||||
"Failed to kill mount process: {{.error}}": "未能终止装载进程:{{.error}}",
|
||||
"Failed to list cached images": "",
|
||||
"Failed to remove profile": "",
|
||||
"Failed to save config": "",
|
||||
"Failed to list cached images": "无法列出缓存镜像",
|
||||
"Failed to remove profile": "无法删除配置文件",
|
||||
"Failed to save config": "无法保存配置",
|
||||
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,{{.ip}}": "未能设置 NO_PROXY 环境变量。请使用“export NO_PROXY=$NO_PROXY,{{.ip}}”",
|
||||
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,{{.ip}}`.": "",
|
||||
"Failed to setup certs": "",
|
||||
"Failed to setup kubeconfig": "",
|
||||
"Failed to update cluster": "",
|
||||
"Failed to update config": "",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,{{.ip}}`.": "未能设置 NO_PROXY 环境变量。请使用“export NO_PROXY=$NO_PROXY,{{.ip}}”。",
|
||||
"Failed to setup certs": "设置 certs 失败",
|
||||
"Failed to setup kubeconfig": "设置 kubeconfig 失败",
|
||||
"Failed to update cluster": "更新 cluster 失败",
|
||||
"Failed to update config": "更新 config 失败",
|
||||
"Failed unmount: {{.error}}": "unmount 失败:{{.error}}",
|
||||
"File permissions used for the mount": "用于 mount 的文件权限",
|
||||
"Flags": "标志",
|
||||
"Follow": "跟踪",
|
||||
"For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "为获得最佳结果,请安装 kubectl:https://kubernetes.io/docs/tasks/tools/install-kubectl/",
|
||||
"For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/__1": "为获得最佳结果,请安装 kubectl:https://kubernetes.io/docs/tasks/tools/install-kubectl/",
|
||||
"For more information, see:": "如需了解详情,请参阅:",
|
||||
"Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "",
|
||||
"Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "强制为指定的 shell 配置环境:[fish, cmd, powershell, tcsh, bash, zsh],默认为 auto-detect",
|
||||
"Force minikube to perform possibly dangerous operations": "强制 minikube 执行可能有风险的操作",
|
||||
"Found network options:": "找到的网络选项:",
|
||||
"Found {{.number}} invalid profile(s) !": "",
|
||||
"Gets the kubernetes URL(s) for the specified service in your local cluster": "",
|
||||
"Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time.": "",
|
||||
"Gets the logs of the running instance, used for debugging minikube, not user code.": "",
|
||||
"Gets the status of a local kubernetes cluster": "",
|
||||
"Found {{.number}} invalid profile(s) !": "找到 {{.number}} 个无效的配置文件!",
|
||||
"Gets the kubernetes URL(s) for the specified service in your local cluster": "获取本地集群中指定服务的 kubernetes URL",
|
||||
"Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time.": "获取本地集群中指定服务的 kubernetes URL。如果有多个 URL,他们将一次打印一个",
|
||||
"Gets the logs of the running instance, used for debugging minikube, not user code.": "获取正在运行的实例日志,用于调试 minikube,不是用户代码",
|
||||
"Gets the status of a local kubernetes cluster": "获取本地 kubernetes 集群状态",
|
||||
"Gets the status of a local kubernetes cluster.\n\tExit status contains the status of minikube's VM, cluster and kubernetes encoded on it's bits in this order from right to left.\n\tEg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for kubernetes NOK)": "",
|
||||
"Gets the value of PROPERTY_NAME from the minikube config file": "",
|
||||
"Global Flags": "",
|
||||
|
@ -505,6 +505,8 @@
|
|||
"usage: minikube addons list": "",
|
||||
"usage: minikube addons open ADDON_NAME": "",
|
||||
"usage: minikube config unset PROPERTY_NAME": "",
|
||||
"usage: minikube delete": "",
|
||||
"usage: minikube delete --all": "",
|
||||
"usage: minikube profile [MINIKUBE_PROFILE_NAME]": "",
|
||||
"zsh completion failed": "",
|
||||
"{{.addonName}} was successfully enabled": "",
|
||||
|
@ -517,4 +519,4 @@
|
|||
"{{.prefix}}minikube {{.version}} on {{.platform}}": "{{.platform}} 上的 {{.prefix}}minikube {{.version}}",
|
||||
"{{.type}} is not yet a supported filesystem. We will try anyways!": "",
|
||||
"{{.url}} is not accessible: {{.error}}": ""
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue