Merge branch 'master' of github.com:kubernetes/minikube into boot1
commit
9eaf95415e
|
@ -12,7 +12,7 @@ on:
|
|||
- "!deploy/iso/**"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
build_minikube:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- master
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
generate-docs:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -21,7 +21,7 @@ on:
|
|||
- deleted
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
|
||||
jobs:
|
||||
# Runs before all other jobs
|
||||
|
|
|
@ -7,7 +7,7 @@ on:
|
|||
release:
|
||||
types: [published]
|
||||
env:
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
update-leaderboard:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -14,7 +14,7 @@ on:
|
|||
- "!deploy/iso/**"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
# Runs before all other jobs
|
||||
# builds the minikube binaries
|
||||
|
|
|
@ -12,7 +12,7 @@ on:
|
|||
- "!deploy/iso/**"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
# Runs before all other jobs
|
||||
# builds the minikube binaries
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- cron: "0 2,14 * * *"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
time-to-k8s-public-chart:
|
||||
if: github.repository == 'kubernetes/minikube'
|
||||
|
|
|
@ -5,7 +5,7 @@ on:
|
|||
types: [released]
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
benchmark:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- "translations/**"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
unit_test:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- cron: "0 9 * * 1"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
bump-golang-version:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- cron: "0 10 * * 1"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
bump-golint-version:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- cron: "0 8 * * 1"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
bump-k8s-versions:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -6,7 +6,7 @@ on:
|
|||
- cron: "0 6 * * 1"
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO_VERSION: '1.17.3'
|
||||
GO_VERSION: '1.17.5'
|
||||
jobs:
|
||||
bump-k8s-versions:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
4
Makefile
4
Makefile
|
@ -33,9 +33,9 @@ RPM_REVISION ?= 0
|
|||
|
||||
# used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below
|
||||
# update this only by running `make update-golang-version`
|
||||
GO_VERSION ?= 1.17.3
|
||||
GO_VERSION ?= 1.17.5
|
||||
# update this only by running `make update-golang-version`
|
||||
GO_K8S_VERSION_PREFIX ?= v1.23.0
|
||||
GO_K8S_VERSION_PREFIX ?= v1.24.0
|
||||
|
||||
# replace "x.y.0" => "x.y". kube-cross and golang.org/dl use different formats for x.y.0 go versions
|
||||
KVM_GO_VERSION ?= $(GO_VERSION:.0=)
|
||||
|
|
|
@ -31,6 +31,7 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/minikube/pkg/minikube/cluster"
|
||||
"k8s.io/minikube/pkg/minikube/constants"
|
||||
"k8s.io/minikube/pkg/minikube/detect"
|
||||
"k8s.io/minikube/pkg/minikube/driver"
|
||||
"k8s.io/minikube/pkg/minikube/exit"
|
||||
|
@ -43,11 +44,30 @@ import (
|
|||
|
||||
const (
|
||||
// nineP is the value of --type used for the 9p filesystem.
|
||||
nineP = "9p"
|
||||
defaultMountVersion = "9p2000.L"
|
||||
defaultMsize = 262144
|
||||
nineP = "9p"
|
||||
defaultMount9PVersion = "9p2000.L"
|
||||
mount9PVersionDescription = "Specify the 9p version that the mount should use"
|
||||
defaultMountGID = "docker"
|
||||
mountGIDDescription = "Default group id used for the mount"
|
||||
defaultMountIP = ""
|
||||
mountIPDescription = "Specify the ip that the mount should be setup on"
|
||||
defaultMountMode = 0o755
|
||||
mountModeDescription = "File permissions used for the mount"
|
||||
defaultMountMSize = 262144
|
||||
mountMSizeDescription = "The number of bytes to use for 9p packet payload"
|
||||
mountOptionsDescription = "Additional mount options, such as cache=fscache"
|
||||
defaultMountPort = 0
|
||||
mountPortDescription = "Specify the port that the mount should be setup on, where 0 means any free port."
|
||||
defaultMountType = nineP
|
||||
mountTypeDescription = "Specify the mount filesystem type (supported types: 9p)"
|
||||
defaultMountUID = "docker"
|
||||
mountUIDDescription = "Default user id used for the mount"
|
||||
)
|
||||
|
||||
func defaultMountOptions() []string {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
// placeholders for flag values
|
||||
var (
|
||||
mountIP string
|
||||
|
@ -218,16 +238,16 @@ var mountCmd = &cobra.Command{
|
|||
}
|
||||
|
||||
func init() {
|
||||
mountCmd.Flags().StringVar(&mountIP, "ip", "", "Specify the ip that the mount should be setup on")
|
||||
mountCmd.Flags().Uint16Var(&mountPort, "port", 0, "Specify the port that the mount should be setup on, where 0 means any free port.")
|
||||
mountCmd.Flags().StringVar(&mountType, "type", nineP, "Specify the mount filesystem type (supported types: 9p)")
|
||||
mountCmd.Flags().StringVar(&mountVersion, "9p-version", defaultMountVersion, "Specify the 9p version that the mount should use")
|
||||
mountCmd.Flags().StringVar(&mountIP, constants.MountIPFlag, defaultMountIP, mountIPDescription)
|
||||
mountCmd.Flags().Uint16Var(&mountPort, constants.MountPortFlag, defaultMountPort, mountPortDescription)
|
||||
mountCmd.Flags().StringVar(&mountType, constants.MountTypeFlag, defaultMountType, mountTypeDescription)
|
||||
mountCmd.Flags().StringVar(&mountVersion, constants.Mount9PVersionFlag, defaultMount9PVersion, mount9PVersionDescription)
|
||||
mountCmd.Flags().BoolVar(&isKill, "kill", false, "Kill the mount process spawned by minikube start")
|
||||
mountCmd.Flags().StringVar(&uid, "uid", "docker", "Default user id used for the mount")
|
||||
mountCmd.Flags().StringVar(&gid, "gid", "docker", "Default group id used for the mount")
|
||||
mountCmd.Flags().UintVar(&mode, "mode", 0o755, "File permissions used for the mount")
|
||||
mountCmd.Flags().StringSliceVar(&options, "options", []string{}, "Additional mount options, such as cache=fscache")
|
||||
mountCmd.Flags().IntVar(&mSize, "msize", defaultMsize, "The number of bytes to use for 9p packet payload")
|
||||
mountCmd.Flags().StringVar(&uid, constants.MountUIDFlag, defaultMountUID, mountUIDDescription)
|
||||
mountCmd.Flags().StringVar(&gid, constants.MountGIDFlag, defaultMountGID, mountGIDDescription)
|
||||
mountCmd.Flags().UintVar(&mode, constants.MountModeFlag, defaultMountMode, mountModeDescription)
|
||||
mountCmd.Flags().StringSliceVar(&options, constants.MountOptionsFlag, defaultMountOptions(), mountOptionsDescription)
|
||||
mountCmd.Flags().IntVar(&mSize, constants.MountMSizeFlag, defaultMountMSize, mountMSizeDescription)
|
||||
}
|
||||
|
||||
// getPort uses the requested port or asks the kernel for a free open port that is ready to use
|
||||
|
|
|
@ -83,6 +83,15 @@ const (
|
|||
imageRepository = "image-repository"
|
||||
imageMirrorCountry = "image-mirror-country"
|
||||
mountString = "mount-string"
|
||||
mount9PVersion = "mount-9p-version"
|
||||
mountGID = "mount-gid"
|
||||
mountIPFlag = "mount-ip"
|
||||
mountMode = "mount-mode"
|
||||
mountMSize = "mount-msize"
|
||||
mountOptions = "mount-options"
|
||||
mountPortFlag = "mount-port"
|
||||
mountTypeFlag = "mount-type"
|
||||
mountUID = "mount-uid"
|
||||
disableDriverMounts = "disable-driver-mounts"
|
||||
cacheImages = "cache-images"
|
||||
uuid = "uuid"
|
||||
|
@ -153,6 +162,15 @@ func initMinikubeFlags() {
|
|||
startCmd.Flags().String(containerRuntime, constants.DefaultContainerRuntime, fmt.Sprintf("The container runtime to be used (%s).", strings.Join(cruntime.ValidRuntimes(), ", ")))
|
||||
startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.")
|
||||
startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start.")
|
||||
startCmd.Flags().String(mount9PVersion, defaultMount9PVersion, mount9PVersionDescription)
|
||||
startCmd.Flags().String(mountGID, defaultMountGID, mountGIDDescription)
|
||||
startCmd.Flags().String(mountIPFlag, defaultMountIP, mountIPDescription)
|
||||
startCmd.Flags().Uint(mountMode, defaultMountMode, mountModeDescription)
|
||||
startCmd.Flags().Int(mountMSize, defaultMountMSize, mountMSizeDescription)
|
||||
startCmd.Flags().StringSlice(mountOptions, defaultMountOptions(), mountOptionsDescription)
|
||||
startCmd.Flags().Uint16(mountPortFlag, defaultMountPort, mountPortDescription)
|
||||
startCmd.Flags().String(mountTypeFlag, defaultMountType, mountTypeDescription)
|
||||
startCmd.Flags().String(mountUID, defaultMountUID, mountUIDDescription)
|
||||
startCmd.Flags().StringSlice(config.AddonListFlag, nil, "Enable addons. see `minikube addons list` for a list of valid addon names.")
|
||||
startCmd.Flags().String(criSocket, "", "The cri socket path to be used.")
|
||||
startCmd.Flags().String(networkPlugin, "", "Kubelet network plug-in to use (default: auto)")
|
||||
|
@ -466,6 +484,15 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s
|
|||
CertExpiration: viper.GetDuration(certExpiration),
|
||||
Mount: viper.GetBool(createMount),
|
||||
MountString: viper.GetString(mountString),
|
||||
Mount9PVersion: viper.GetString(mount9PVersion),
|
||||
MountGID: viper.GetString(mountGID),
|
||||
MountIP: viper.GetString(mountIPFlag),
|
||||
MountMode: viper.GetUint(mountMode),
|
||||
MountMSize: viper.GetInt(mountMSize),
|
||||
MountOptions: viper.GetStringSlice(mountOptions),
|
||||
MountPort: uint16(viper.GetUint(mountPortFlag)),
|
||||
MountType: viper.GetString(mountTypeFlag),
|
||||
MountUID: viper.GetString(mountUID),
|
||||
KubernetesConfig: config.KubernetesConfig{
|
||||
KubernetesVersion: k8sVersion,
|
||||
ClusterName: ClusterFlagValue(),
|
||||
|
@ -675,6 +702,15 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC
|
|||
updateDurationFromFlag(cmd, &cc.CertExpiration, certExpiration)
|
||||
updateBoolFromFlag(cmd, &cc.Mount, createMount)
|
||||
updateStringFromFlag(cmd, &cc.MountString, mountString)
|
||||
updateStringFromFlag(cmd, &cc.Mount9PVersion, mount9PVersion)
|
||||
updateStringFromFlag(cmd, &cc.MountGID, mountGID)
|
||||
updateStringFromFlag(cmd, &cc.MountIP, mountIPFlag)
|
||||
updateUintFromFlag(cmd, &cc.MountMode, mountMode)
|
||||
updateIntFromFlag(cmd, &cc.MountMSize, mountMSize)
|
||||
updateStringSliceFromFlag(cmd, &cc.MountOptions, mountOptions)
|
||||
updateUint16FromFlag(cmd, &cc.MountPort, mountPortFlag)
|
||||
updateStringFromFlag(cmd, &cc.MountType, mountTypeFlag)
|
||||
updateStringFromFlag(cmd, &cc.MountUID, mountUID)
|
||||
|
||||
if cmd.Flags().Changed(kubernetesVersion) {
|
||||
cc.KubernetesConfig.KubernetesVersion = getKubernetesVersion(existing)
|
||||
|
@ -746,6 +782,20 @@ func updateDurationFromFlag(cmd *cobra.Command, v *time.Duration, key string) {
|
|||
}
|
||||
}
|
||||
|
||||
// updateUintFromFlag will update the existing uint from the flag.
|
||||
func updateUintFromFlag(cmd *cobra.Command, v *uint, key string) {
|
||||
if cmd.Flags().Changed(key) {
|
||||
*v = viper.GetUint(key)
|
||||
}
|
||||
}
|
||||
|
||||
// updateUint16FromFlag will update the existing uint16 from the flag.
|
||||
func updateUint16FromFlag(cmd *cobra.Command, v *uint16, key string) {
|
||||
if cmd.Flags().Changed(key) {
|
||||
*v = uint16(viper.GetUint(key))
|
||||
}
|
||||
}
|
||||
|
||||
// interpretWaitFlag interprets the wait flag and respects the legacy minikube users
|
||||
// returns map of components to wait for
|
||||
func interpretWaitFlag(cmd cobra.Command) map[string]bool {
|
||||
|
|
|
@ -22,7 +22,7 @@ if (($# < 1)); then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
VERSION_TO_INSTALL=1.17.3
|
||||
VERSION_TO_INSTALL=1.17.5
|
||||
INSTALL_PATH=${1}
|
||||
|
||||
function current_arch() {
|
||||
|
|
|
@ -135,7 +135,7 @@ func runCmd(cmd *exec.Cmd, warnSlow ...bool) (*RunResult, error) {
|
|||
start := time.Now()
|
||||
err := cmd.Run()
|
||||
elapsed := time.Since(start)
|
||||
if warn {
|
||||
if warn && !out.JSON {
|
||||
if elapsed > warnTime {
|
||||
warnLock.Lock()
|
||||
_, ok := alreadyWarnedCmds[rr.Command()]
|
||||
|
|
|
@ -87,6 +87,15 @@ type ClusterConfig struct {
|
|||
CertExpiration time.Duration
|
||||
Mount bool
|
||||
MountString string
|
||||
Mount9PVersion string
|
||||
MountGID string
|
||||
MountIP string
|
||||
MountMode uint
|
||||
MountMSize int
|
||||
MountOptions []string
|
||||
MountPort uint16
|
||||
MountType string
|
||||
MountUID string
|
||||
}
|
||||
|
||||
// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
|
||||
|
|
|
@ -124,6 +124,25 @@ const (
|
|||
|
||||
// DefaultCertExpiration is the amount of time in the future a certificate will expire in by default, which is 3 years
|
||||
DefaultCertExpiration = time.Hour * 24 * 365 * 3
|
||||
|
||||
// Mount9PVersionFlag is the flag used to set the mount 9P version
|
||||
Mount9PVersionFlag = "9p-version"
|
||||
// MountGIDFlag is the flag used to set the mount GID
|
||||
MountGIDFlag = "gid"
|
||||
// MountIPFlag is the flag used to set the mount IP
|
||||
MountIPFlag = "ip"
|
||||
// MountMSizeFlag is the flag used to set the mount msize
|
||||
MountMSizeFlag = "msize"
|
||||
// MountModeFlag is the flag used to set the mount mode
|
||||
MountModeFlag = "mode"
|
||||
// MountOptionsFlag is the flag used to set the mount options
|
||||
MountOptionsFlag = "options"
|
||||
// MountPortFlag is the flag used to set the mount port
|
||||
MountPortFlag = "port"
|
||||
// MountTypeFlag is the flag used to set the mount type
|
||||
MountTypeFlag = "type"
|
||||
// MountUIDFlag is the flag used to set the mount UID
|
||||
MountUIDFlag = "uid"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -51,22 +51,20 @@ func showVersionInfo(k8sVersion string, cr cruntime.Manager) {
|
|||
}
|
||||
|
||||
// configureMounts configures any requested filesystem mounts
|
||||
func configureMounts(wg *sync.WaitGroup, mount bool, mountString string) {
|
||||
func configureMounts(wg *sync.WaitGroup, cc config.ClusterConfig) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
|
||||
if !mount {
|
||||
if !cc.Mount {
|
||||
return
|
||||
}
|
||||
|
||||
out.Step(style.Mounting, "Creating mount {{.name}} ...", out.V{"name": mountString})
|
||||
out.Step(style.Mounting, "Creating mount {{.name}} ...", out.V{"name": cc.MountString})
|
||||
path := os.Args[0]
|
||||
mountDebugVal := 0
|
||||
if klog.V(8).Enabled() {
|
||||
mountDebugVal = 1
|
||||
}
|
||||
profile := viper.GetString("profile")
|
||||
mountCmd := exec.Command(path, "mount", "-p", profile, fmt.Sprintf("--v=%d", mountDebugVal), mountString)
|
||||
|
||||
args := generateMountArgs(profile, cc)
|
||||
mountCmd := exec.Command(path, args...)
|
||||
mountCmd.Env = append(os.Environ(), constants.IsMinikubeChildProcess+"=true")
|
||||
if klog.V(8).Enabled() {
|
||||
mountCmd.Stdout = os.Stdout
|
||||
|
@ -79,3 +77,34 @@ func configureMounts(wg *sync.WaitGroup, mount bool, mountString string) {
|
|||
exit.Error(reason.HostMountPid, "Error writing mount pid", err)
|
||||
}
|
||||
}
|
||||
|
||||
func generateMountArgs(profile string, cc config.ClusterConfig) []string {
|
||||
mountDebugVal := 0
|
||||
if klog.V(8).Enabled() {
|
||||
mountDebugVal = 1
|
||||
}
|
||||
|
||||
args := []string{"mount", cc.MountString}
|
||||
flags := []struct {
|
||||
name string
|
||||
value string
|
||||
}{
|
||||
{"profile", profile},
|
||||
{"v", fmt.Sprintf("%d", mountDebugVal)},
|
||||
{constants.Mount9PVersionFlag, cc.Mount9PVersion},
|
||||
{constants.MountGIDFlag, cc.MountGID},
|
||||
{constants.MountIPFlag, cc.MountIP},
|
||||
{constants.MountMSizeFlag, fmt.Sprintf("%d", cc.MountMSize)},
|
||||
{constants.MountModeFlag, fmt.Sprintf("%d", cc.MountMode)},
|
||||
{constants.MountPortFlag, fmt.Sprintf("%d", cc.MountPort)},
|
||||
{constants.MountTypeFlag, cc.MountType},
|
||||
{constants.MountUIDFlag, cc.MountUID},
|
||||
}
|
||||
for _, flag := range flags {
|
||||
args = append(args, fmt.Sprintf("--%s", flag.name), flag.value)
|
||||
}
|
||||
for _, option := range cc.MountOptions {
|
||||
args = append(args, fmt.Sprintf("--%s", constants.MountOptionsFlag), option)
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
|
|||
|
||||
var wg sync.WaitGroup
|
||||
if !driver.IsKIC(starter.Cfg.Driver) {
|
||||
go configureMounts(&wg, starter.Cfg.Mount, starter.Cfg.MountString)
|
||||
go configureMounts(&wg, *starter.Cfg)
|
||||
}
|
||||
|
||||
wg.Add(1)
|
||||
|
|
|
@ -77,7 +77,16 @@ minikube start [flags]
|
|||
--listen-address string IP Address to use to expose ports (docker and podman driver only)
|
||||
--memory string Amount of RAM to allocate to Kubernetes (format: <number>[<unit>], where unit = b, k, m or g). Use "max" to use the maximum amount of memory.
|
||||
--mount This will start the mount daemon and automatically mount files into minikube.
|
||||
--mount-9p-version string Specify the 9p version that the mount should use (default "9p2000.L")
|
||||
--mount-gid string Default group id used for the mount (default "docker")
|
||||
--mount-ip string Specify the ip that the mount should be setup on
|
||||
--mount-mode uint File permissions used for the mount (default 493)
|
||||
--mount-msize int The number of bytes to use for 9p packet payload (default 262144)
|
||||
--mount-options strings Additional mount options, such as cache=fscache
|
||||
--mount-port uint16 Specify the port that the mount should be setup on, where 0 means any free port.
|
||||
--mount-string string The argument to pass the minikube mount command on start.
|
||||
--mount-type string Specify the mount filesystem type (supported types: 9p) (default "9p")
|
||||
--mount-uid string Default user id used for the mount (default "docker")
|
||||
--namespace string The named space to activate after start (default "default")
|
||||
--nat-nic-type string NIC Type used for nat network. One of Am79C970A, Am79C973, 82540EM, 82543GC, 82545EM, or virtio (virtualbox driver only) (default "virtio")
|
||||
--native-ssh Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'. (default true)
|
||||
|
|
|
@ -21,10 +21,21 @@ package integration
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const (
|
||||
mountGID = "0"
|
||||
mountMSize = "6543"
|
||||
mountMode = "0777"
|
||||
mountPort = "46464"
|
||||
mountUID = "0"
|
||||
)
|
||||
|
||||
// TestMountStart tests using the mount command on start
|
||||
func TestMountStart(t *testing.T) {
|
||||
if NoneDriver() {
|
||||
|
@ -72,7 +83,7 @@ func TestMountStart(t *testing.T) {
|
|||
func validateStartWithMount(ctx context.Context, t *testing.T, profile string) {
|
||||
defer PostMortemLogs(t, profile)
|
||||
|
||||
args := []string{"start", "-p", profile, "--memory=2048", "--mount"}
|
||||
args := []string{"start", "-p", profile, "--memory=2048", "--mount", "--mount-gid", mountGID, "--mount-msize", mountMSize, "--mount-mode", mountMode, "--mount-port", mountPort, "--mount-uid", mountUID}
|
||||
args = append(args, StartArgs()...)
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||
if err != nil {
|
||||
|
@ -84,11 +95,63 @@ func validateStartWithMount(ctx context.Context, t *testing.T, profile string) {
|
|||
func validateMount(ctx context.Context, t *testing.T, profile string) {
|
||||
defer PostMortemLogs(t, profile)
|
||||
|
||||
args := []string{"-p", profile, "ssh", "ls", "/minikube-host"}
|
||||
sshArgs := []string{"-p", profile, "ssh", "--"}
|
||||
|
||||
args := sshArgs
|
||||
args = append(args, "ls", "/minikube-host")
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||
if err != nil {
|
||||
t.Fatalf("mount failed: %q : %v", rr.Command(), err)
|
||||
}
|
||||
|
||||
// Docker has it's own mounting method, it doesn't respect the mounting flags
|
||||
if DockerDriver() {
|
||||
return
|
||||
}
|
||||
|
||||
// skipping macOS due to https://github.com/kubernetes/minikube/issues/13070
|
||||
if runtime.GOOS != "darwin" {
|
||||
args = sshArgs
|
||||
args = append(args, "stat", "--format", "'%a'", "/minikube-host")
|
||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get directory mode: %v", err)
|
||||
}
|
||||
|
||||
const want = "777"
|
||||
if !strings.Contains(rr.Output(), want) {
|
||||
t.Errorf("wanted mode to be %q; got: %q", want, rr.Output())
|
||||
}
|
||||
}
|
||||
|
||||
// We can't get the mount details with Hyper-V
|
||||
if HyperVDriver() {
|
||||
return
|
||||
}
|
||||
|
||||
args = sshArgs
|
||||
args = append(args, "mount", "|", "grep", "9p")
|
||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get mount information: %v", err)
|
||||
}
|
||||
|
||||
flags := []struct {
|
||||
key string
|
||||
expected string
|
||||
}{
|
||||
{"gid", mountGID},
|
||||
{"msize", mountMSize},
|
||||
{"port", mountPort},
|
||||
{"uid", mountUID},
|
||||
}
|
||||
|
||||
for _, flag := range flags {
|
||||
want := fmt.Sprintf("%s=%s", flag.key, flag.expected)
|
||||
if !strings.Contains(rr.Output(), want) {
|
||||
t.Errorf("wanted %s to be: %q; got: %q", flag.key, want, rr.Output())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// validateMountStop stops a cluster
|
||||
|
|
|
@ -173,7 +173,7 @@ func validateVerifyDeleted(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Errorf("expected to see error and volume %q to not exist after deletion but got no error and this output: %s", rr.Command(), rr.Output())
|
||||
}
|
||||
|
||||
rr, err = Run(t, exec.CommandContext(ctx, "sudo", bin, "network", "ls"))
|
||||
rr, err = Run(t, exec.CommandContext(ctx, bin, "network", "ls"))
|
||||
if err != nil {
|
||||
t.Errorf("failed to get list of networks: %v", err)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
/*
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
"Add, remove, or list additional nodes": "",
|
||||
"Adding node {{.name}} to cluster {{.cluster}}": "",
|
||||
"Additional help topics": "",
|
||||
"Additional mount options, such as cache=fscache": "",
|
||||
"Adds a node to the given cluster config, and starts it.": "",
|
||||
"Adds a node to the given cluster.": "",
|
||||
"Advanced Commands:": "",
|
||||
|
@ -129,8 +128,6 @@
|
|||
"Current context is \"{{.context}}\"": "",
|
||||
"DEPRECATED, use `driver` instead.": "",
|
||||
"DEPRECATED: Replaced by --cni=bridge": "",
|
||||
"Default group id used for the mount": "",
|
||||
"Default user id used for the mount": "",
|
||||
"Delete an image from the local cache.": "",
|
||||
"Delete the existing '{{.name}}' cluster using: '{{.delcommand}}', or start the existing '{{.name}}' cluster using: '{{.command}} --driver={{.old}}'": "",
|
||||
"Deletes a local Kubernetes cluster": "",
|
||||
|
@ -286,7 +283,6 @@
|
|||
"Failed to update cluster": "",
|
||||
"Failed to update config": "",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
|
@ -584,10 +580,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "Spezifizieren Sie arbiträre Flags, die an den Docker-Daemon übergeben werden. (Format: Schlüssel = Wert)",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "",
|
||||
|
@ -690,7 +682,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
|
@ -292,7 +292,6 @@
|
|||
"Failed to update cluster": "",
|
||||
"Failed to update config": "",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
|
@ -590,10 +589,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "Permite indicar marcas arbitrarias que se transferirán al daemon de Docker (el formato es \"clave=valor\").",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "",
|
||||
|
@ -696,7 +691,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
|
@ -282,7 +282,6 @@
|
|||
"Failed to update cluster": "",
|
||||
"Failed to update config": "",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "フラグ",
|
||||
"Follow": "たどる",
|
||||
|
@ -586,10 +585,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "Docker デーモンに渡す任意のフラグを指定します(形式: key=value)",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "コントロールプレーンのノード {{.name}} を {{.cluster}} 上で起動しています",
|
||||
|
|
|
@ -309,7 +309,6 @@
|
|||
"Failed to update cluster": "클러스터를 수정하는 데 실패하였습니다",
|
||||
"Failed to update config": "컨피그를 수정하는 데 실패하였습니다",
|
||||
"Failed unmount: {{.error}}": "마운트 해제에 실패하였습니다: {{.error}}",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
|
@ -603,10 +602,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "{{.cluster}} 클러스터의 {{.name}} 컨트롤 플레인 노드를 시작하는 중",
|
||||
|
@ -701,7 +696,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
|
@ -296,7 +296,6 @@
|
|||
"Failed to update cluster": "Aktualizacja klastra nie powiodła się",
|
||||
"Failed to update config": "Aktualizacja konfiguracji nie powiodła się",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
|
@ -603,10 +602,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "",
|
||||
|
@ -709,7 +704,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
"Add, remove, or list additional nodes": "",
|
||||
"Adding node {{.name}} to cluster {{.cluster}}": "",
|
||||
"Additional help topics": "",
|
||||
"Additional mount options, such as cache=fscache": "",
|
||||
"Adds a node to the given cluster config, and starts it.": "",
|
||||
"Adds a node to the given cluster.": "",
|
||||
"Advanced Commands:": "",
|
||||
|
@ -125,8 +124,6 @@
|
|||
"Current context is \"{{.context}}\"": "",
|
||||
"DEPRECATED, use `driver` instead.": "",
|
||||
"DEPRECATED: Replaced by --cni=bridge": "",
|
||||
"Default group id used for the mount": "",
|
||||
"Default user id used for the mount": "",
|
||||
"Delete an image from the local cache.": "",
|
||||
"Delete the existing '{{.name}}' cluster using: '{{.delcommand}}', or start the existing '{{.name}}' cluster using: '{{.command}} --driver={{.old}}'": "",
|
||||
"Deletes a local Kubernetes cluster": "",
|
||||
|
@ -270,7 +267,6 @@
|
|||
"Failed to update cluster": "",
|
||||
"Failed to update config": "",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
|
@ -554,10 +550,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "Запускается control plane узел {{.name}} в кластере {{.cluster}}",
|
||||
|
@ -647,7 +639,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
"Add, remove, or list additional nodes": "",
|
||||
"Adding node {{.name}} to cluster {{.cluster}}": "",
|
||||
"Additional help topics": "",
|
||||
"Additional mount options, such as cache=fscache": "",
|
||||
"Adds a node to the given cluster config, and starts it.": "",
|
||||
"Adds a node to the given cluster.": "",
|
||||
"Advanced Commands:": "",
|
||||
|
@ -125,8 +124,6 @@
|
|||
"Current context is \"{{.context}}\"": "",
|
||||
"DEPRECATED, use `driver` instead.": "",
|
||||
"DEPRECATED: Replaced by --cni=bridge": "",
|
||||
"Default group id used for the mount": "",
|
||||
"Default user id used for the mount": "",
|
||||
"Delete an image from the local cache.": "",
|
||||
"Delete the existing '{{.name}}' cluster using: '{{.delcommand}}', or start the existing '{{.name}}' cluster using: '{{.command}} --driver={{.old}}'": "",
|
||||
"Deletes a local Kubernetes cluster": "",
|
||||
|
@ -270,7 +267,6 @@
|
|||
"Failed to update cluster": "",
|
||||
"Failed to update config": "",
|
||||
"Failed unmount: {{.error}}": "",
|
||||
"File permissions used for the mount": "",
|
||||
"Filter to use only VM Drivers": "",
|
||||
"Flags": "",
|
||||
"Follow": "",
|
||||
|
@ -554,10 +550,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "",
|
||||
|
@ -647,7 +639,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
|
@ -685,10 +685,6 @@
|
|||
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
|
||||
"Specify arbitrary flags to pass to the Docker daemon. (format: key=value)": "指定要传递给 Docker 守护进程的任意标志。(格式:key=value)",
|
||||
"Specify arbitrary flags to pass to the build. (format: key=value)": "",
|
||||
"Specify the 9p version that the mount should use": "",
|
||||
"Specify the ip that the mount should be setup on": "",
|
||||
"Specify the mount filesystem type (supported types: 9p)": "",
|
||||
"Specify the port that the mount should be setup on, where 0 means any free port.": "",
|
||||
"Specifying extra disks is currently only supported for the following drivers: {{.supported_drivers}}. If you can contribute to add this feature, please create a PR.": "",
|
||||
"StartHost failed, but will try again: {{.error}}": "",
|
||||
"Starting control plane node {{.name}} in cluster {{.cluster}}": "",
|
||||
|
@ -797,7 +793,6 @@
|
|||
"The node {{.name}} has ran out of memory.": "",
|
||||
"The node {{.name}} network is not available. Please verify network settings.": "",
|
||||
"The none driver is not compatible with multi-node clusters.": "",
|
||||
"The number of bytes to use for 9p packet payload": "",
|
||||
"The number of nodes to spin up. Defaults to 1.": "",
|
||||
"The output format. One of 'json', 'table'": "输出的格式。'json' 或者 'table'",
|
||||
"The path on the file system where the docs in markdown need to be saved": "",
|
||||
|
|
Loading…
Reference in New Issue